diff options
author | Michael Snyder <msnyder@vmware.com> | 2009-07-18 23:35:31 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2009-07-18 23:35:31 +0000 |
commit | fdd654f3cc49fd91c43c4786e17b8e4fa04c1803 (patch) | |
tree | f0c80b27df20deee9dccc1fc04a7f73ef2d75840 | |
parent | 99f752754d3dff5aa3b377cd310132419aee618e (diff) | |
download | gdb-fdd654f3cc49fd91c43c4786e17b8e4fa04c1803.zip gdb-fdd654f3cc49fd91c43c4786e17b8e4fa04c1803.tar.gz gdb-fdd654f3cc49fd91c43c4786e17b8e4fa04c1803.tar.bz2 |
2009-07-18 Michael Snyder <msnyder@vmware.com>
* infrun.c (handle_inferior_event): Remove an execution_direction
check in the "check for subroutine calls" test, and add some
additional handling for reverse-stepping through shared libraries.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/infrun.c | 38 |
2 files changed, 41 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 882330b..d8dfeee 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2009-07-18 Michael Snyder <msnyder@vmware.com> + + * infrun.c (handle_inferior_event): Remove an execution_direction + check in the "check for subroutine calls" test, and add some + additional handling for reverse-stepping through shared libraries. + 2009-07-18 Anthony Green <green@moxielogic.com> * moxie-tdep.c (moxie_analyze_prologue): Take gdbarch as last diff --git a/gdb/infrun.c b/gdb/infrun.c index 9f6cfc9..72ef8ee 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3776,9 +3776,8 @@ infrun: not switching back to stepped thread, it has vanished\n"); previous frame must have valid frame IDs. */ if (!frame_id_eq (get_stack_frame_id (frame), ecs->event_thread->step_stack_frame_id) - && (frame_id_eq (frame_unwind_caller_id (frame), - ecs->event_thread->step_stack_frame_id) - || execution_direction == EXEC_REVERSE)) + && frame_id_eq (frame_unwind_caller_id (frame), + ecs->event_thread->step_stack_frame_id)) { CORE_ADDR real_stop_pc; @@ -3806,6 +3805,7 @@ infrun: not switching back to stepped thread, it has vanished\n"); /* Reverse stepping through solib trampolines. */ if (execution_direction == EXEC_REVERSE + && ecs->event_thread->step_over_calls != STEP_OVER_NONE && (gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc) || (ecs->stop_func_start == 0 && in_solib_dynsym_resolve_code (stop_pc)))) @@ -3923,6 +3923,38 @@ infrun: not switching back to stepped thread, it has vanished\n"); return; } + /* Reverse stepping through solib trampolines. */ + + if (execution_direction == EXEC_REVERSE + && ecs->event_thread->step_over_calls != STEP_OVER_NONE) + { + if (gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc) + || (ecs->stop_func_start == 0 + && in_solib_dynsym_resolve_code (stop_pc))) + { + /* Any solib trampoline code can be handled in reverse + by simply continuing to single-step. We have already + executed the solib function (backwards), and a few + steps will take us back through the trampoline to the + caller. */ + keep_going (ecs); + return; + } + else if (in_solib_dynsym_resolve_code (stop_pc)) + { + /* Stepped backward into the solib dynsym resolver. + Set a breakpoint at its start and continue, then + one more step will take us out. */ + struct symtab_and_line sr_sal; + init_sal (&sr_sal); + sr_sal.pc = ecs->stop_func_start; + insert_step_resume_breakpoint_at_sal (gdbarch, + sr_sal, null_frame_id); + keep_going (ecs); + return; + } + } + /* If we're in the return path from a shared library trampoline, we want to proceed through the trampoline when stepping. */ if (gdbarch_in_solib_return_trampoline (gdbarch, |