diff options
author | Randolph Chung <tausq@debian.org> | 2004-06-11 23:39:51 +0000 |
---|---|---|
committer | Randolph Chung <tausq@debian.org> | 2004-06-11 23:39:51 +0000 |
commit | 1b2bfbb99935e44d1a13cc5355ad9768d1daf6d2 (patch) | |
tree | 6f016883506cabd688f84c447ee49d4e686a5743 /gdb | |
parent | a9d61c86001ed4fe7915ded6034a5ba12d6b53b2 (diff) | |
download | binutils-1b2bfbb99935e44d1a13cc5355ad9768d1daf6d2.zip binutils-1b2bfbb99935e44d1a13cc5355ad9768d1daf6d2.tar.gz binutils-1b2bfbb99935e44d1a13cc5355ad9768d1daf6d2.tar.bz2 |
2004-06-11 Randolph Chung <tausq@debian.org>
* infrun.c (handle_inferior_event): Handle the case when a trampoline
ends up in the runtime resolver, and if the trampoline has no name.
Rearrange the code so that all the trampoline processing happens before
other step-out-of-range handling.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/infrun.c | 105 |
2 files changed, 68 insertions, 44 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e6fb978..e59c919 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2004-06-11 Randolph Chung <tausq@debian.org> + + * infrun.c (handle_inferior_event): Handle the case when a trampoline + ends up in the runtime resolver, and if the trampoline has no name. + Rearrange the code so that all the trampoline processing happens before + other step-out-of-range handling. + 2004-06-11 Martin Hunt <hunt@redhat.com> * mips-tdep.c (mips_gdbarch_init): Recognize vr4120 diff --git a/gdb/infrun.c b/gdb/infrun.c index f85c49c..8aba9c1 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2319,36 +2319,6 @@ process_event_stop_test: return; } - if (step_over_calls == STEP_OVER_UNDEBUGGABLE - && ecs->stop_func_name == NULL) - { - /* The inferior just stepped into, or returned to, an - undebuggable function (where there is no symbol, not even a - minimal symbol, corresponding to the address where the - inferior stopped). Since we want to skip this kind of code, - we keep going until the inferior returns from this - function. */ - if (step_stop_if_no_debug) - { - /* If we have no line number and the step-stop-if-no-debug - is set, we stop the step so that the user has a chance to - switch in assembly mode. */ - stop_step = 1; - print_stop_reason (END_STEPPING_RANGE, 0); - stop_stepping (ecs); - return; - } - else - { - /* Set a breakpoint at callee's return address (the address - at which the caller will resume). */ - insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()), - ecs); - keep_going (ecs); - return; - } - } - if (frame_id_eq (frame_unwind_id (get_current_frame ()), step_frame_id)) { @@ -2393,6 +2363,22 @@ process_event_stop_test: if (real_stop_pc != 0) ecs->stop_func_start = real_stop_pc; + if (IN_SOLIB_DYNSYM_RESOLVE_CODE (ecs->stop_func_start)) + { + struct symtab_and_line sr_sal; + init_sal (&sr_sal); + sr_sal.pc = ecs->stop_func_start; + + check_for_old_step_resume_breakpoint (); + step_resume_breakpoint = + set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume); + if (breakpoints_inserted) + insert_breakpoints (); + + keep_going (ecs); + return; + } + /* If we have line number information for the function we are thinking of stepping into, step into it. @@ -2428,20 +2414,6 @@ process_event_stop_test: return; } - /* We've wandered out of the step range. */ - - ecs->sal = find_pc_line (stop_pc, 0); - - if (step_range_end == 1) - { - /* It is stepi or nexti. We always want to stop stepping after - one instruction. */ - stop_step = 1; - print_stop_reason (END_STEPPING_RANGE, 0); - stop_stepping (ecs); - return; - } - /* If we're in the return path from a shared library trampoline, we want to proceed through the trampoline when stepping. */ if (IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name)) @@ -2474,6 +2446,51 @@ process_event_stop_test: } } + /* NOTE: tausq/2004-05-24: This if block used to be done before all + the trampoline processing logic, however, there are some trampolines + that have no names, so we should do trampoline handling first. */ + if (step_over_calls == STEP_OVER_UNDEBUGGABLE + && ecs->stop_func_name == NULL) + { + /* The inferior just stepped into, or returned to, an + undebuggable function (where there is no symbol, not even a + minimal symbol, corresponding to the address where the + inferior stopped). Since we want to skip this kind of code, + we keep going until the inferior returns from this + function. */ + if (step_stop_if_no_debug) + { + /* If we have no line number and the step-stop-if-no-debug + is set, we stop the step so that the user has a chance to + switch in assembly mode. */ + stop_step = 1; + print_stop_reason (END_STEPPING_RANGE, 0); + stop_stepping (ecs); + return; + } + else + { + /* Set a breakpoint at callee's return address (the address + at which the caller will resume). */ + insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()), + ecs); + keep_going (ecs); + return; + } + } + + if (step_range_end == 1) + { + /* It is stepi or nexti. We always want to stop stepping after + one instruction. */ + stop_step = 1; + print_stop_reason (END_STEPPING_RANGE, 0); + stop_stepping (ecs); + return; + } + + ecs->sal = find_pc_line (stop_pc, 0); + if (ecs->sal.line == 0) { /* We have no line number information. That means to stop |