From 27dd396ad2037c5942a062e6683c957e17336dda Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 17 Sep 2012 07:17:28 +0000 Subject: [PATCH] gdb/ PR 14119 * frame.c (skip_inlined_frames): Skip also TAILCALL_FRAME frames. (frame_pop): Drop also TAILCALL_FRAME frames. * infcmd.c (finish_command): Ignore also TAILCALL_FRAME frames. gdb/testsuite/ PR 14119 * gdb.arch/amd64-tailcall-ret.S: New file. * gdb.arch/amd64-tailcall-ret.c: New file. * gdb.arch/amd64-tailcall-ret.exp: New file. * gdb.reverse/amd64-tailcall-reverse.S: New file. * gdb.reverse/amd64-tailcall-reverse.c: New file. * gdb.reverse/amd64-tailcall-reverse.exp: New file. --- gdb/ChangeLog | 7 +++++++ gdb/frame.c | 8 +++++++- gdb/infcmd.c | 5 +++++ gdb/testsuite/ChangeLog | 10 ++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d59d2428215..23976109e68 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2012-09-17 Jan Kratochvil + + PR 14119 + * frame.c (skip_inlined_frames): Skip also TAILCALL_FRAME frames. + (frame_pop): Drop also TAILCALL_FRAME frames. + * infcmd.c (finish_command): Ignore also TAILCALL_FRAME frames. + 2012-09-17 Jan Kratochvil Pedro Alves diff --git a/gdb/frame.c b/gdb/frame.c index e012f2dbe75..b7698733c2a 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -309,7 +309,8 @@ fprint_frame (struct ui_file *file, struct frame_info *fi) static struct frame_info * skip_inlined_frames (struct frame_info *frame) { - while (get_frame_type (frame) == INLINE_FRAME) + while (get_frame_type (frame) == INLINE_FRAME + || get_frame_type (frame) == TAILCALL_FRAME) frame = get_prev_frame (frame); return frame; @@ -814,6 +815,11 @@ frame_pop (struct frame_info *this_frame) if (!prev_frame) error (_("Cannot pop the initial frame.")); + /* Ignore TAILCALL_FRAME type frames, they were executed already before + entering THISFRAME. */ + while (get_frame_type (prev_frame) == TAILCALL_FRAME) + prev_frame = get_prev_frame (prev_frame); + /* Make a copy of all the register values unwound from this frame. Save them in a scratch buffer so that there isn't a race between trying to extract the old values from the current regcache while diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 475ac90e1cc..7e31600219e 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1777,6 +1777,11 @@ finish_command (char *arg, int from_tty) return; } + /* Ignore TAILCALL_FRAME type frames, they were executed already before + entering THISFRAME. */ + while (get_frame_type (frame) == TAILCALL_FRAME) + frame = get_prev_frame (frame); + /* Find the function we will return from. */ function = find_pc_function (get_frame_pc (get_selected_frame (NULL))); diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 6e193af8ade..40d3f6f08c8 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2012-09-17 Jan Kratochvil + + PR 14119 + * gdb.arch/amd64-tailcall-ret.S: New file. + * gdb.arch/amd64-tailcall-ret.c: New file. + * gdb.arch/amd64-tailcall-ret.exp: New file. + * gdb.reverse/amd64-tailcall-reverse.S: New file. + * gdb.reverse/amd64-tailcall-reverse.c: New file. + * gdb.reverse/amd64-tailcall-reverse.exp: New file. + 2012-09-17 Jan Kratochvil PR 14548 -- 2.47.2