From 6373d119691aac21d145d937cf6aa2a167893743 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Thu, 18 Jun 2009 23:55:57 +0000 Subject: [PATCH] 2009-06-14 Hui Zhu Michael Snyder * infrun.c (handle_inferior_event): Reverse-next through trampoline. --- gdb/ChangeLog | 3 +++ gdb/infrun.c | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0d5e763163e..3c4748ca2d3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -4,6 +4,9 @@ * infrun.c (handle_inferior_event): Improve reverse stepping through function epilogue. + * infrun.c (handle_inferior_event): Reverse-next through + trampoline. + 2009-06-18 Paul Pluzhnikov * dwarf2-frame.c (struct comp_unit): Use bfd_size_type for diff --git a/gdb/infrun.c b/gdb/infrun.c index 7488912c06b..e9d870d242c 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3777,10 +3777,21 @@ infrun: not switching back to stepped thread, it has vanished\n"); keep_going (ecs); return; } - /* Normal (staticly linked) function call return. */ - init_sal (&sr_sal); - sr_sal.pc = ecs->stop_func_start; - insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id); + if (gdbarch_skip_trampoline_code(current_gdbarch, + get_current_frame (), + stop_pc)) + { + /* We are in a function call trampoline. + Keep stepping backward to get to the caller. */ + ecs->event_thread->stepping_over_breakpoint = 1; + } + else + { + /* Normal function call return (static or dynamic). */ + init_sal (&sr_sal); + sr_sal.pc = ecs->stop_func_start; + insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id); + } } else insert_step_resume_breakpoint_at_caller (frame); -- 2.30.2