diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2016-02-05 09:32:53 +0100 |
---|---|---|
committer | Markus Metzger <markus.t.metzger@intel.com> | 2016-02-12 09:44:42 +0100 |
commit | 2f3ef606b91298855e9ea13ae0e0316c23f06c9b (patch) | |
tree | b8a03927519de2b858f1dd3db151a29e0326a769 /gdb | |
parent | 95c00d15cbd7234382513975af72d21c395c82c0 (diff) | |
download | fsf-binutils-gdb-2f3ef606b91298855e9ea13ae0e0316c23f06c9b.zip fsf-binutils-gdb-2f3ef606b91298855e9ea13ae0e0316c23f06c9b.tar.gz fsf-binutils-gdb-2f3ef606b91298855e9ea13ae0e0316c23f06c9b.tar.bz2 |
frame: add skip_tailcall_frames
Add a new function skip_tailcall_frames to skip TAILCALL_FRAME frames.
gdb/
* frame.h (skip_tailcall_frames): New.
* frame.c (skip_tailcall_frames): New.
(frame_pop): Call skip_tailcall_frames.
* infcmd.c (finish_command): Call skip_tailcall_frames.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/frame.c | 14 | ||||
-rw-r--r-- | gdb/frame.h | 4 | ||||
-rw-r--r-- | gdb/infcmd.c | 3 |
4 files changed, 24 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5edafdf..d21bb3f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2016-02-12 Markus Metzger <markus.t.metzger@intel.com> + + * frame.h (skip_tailcall_frames): New. + * frame.c (skip_tailcall_frames): New. + (frame_pop): Call skip_tailcall_frames. + * infcmd.c (finish_command): Call skip_tailcall_frames. + 2016-02-11 Pedro Alves <palves@redhat.com> * Makefile.in (check-parallel): New rule. diff --git a/gdb/frame.c b/gdb/frame.c index 48c9b33..b7832c7 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -438,6 +438,17 @@ skip_artificial_frames (struct frame_info *frame) return frame; } +/* See frame.h. */ + +struct frame_info * +skip_tailcall_frames (struct frame_info *frame) +{ + while (get_frame_type (frame) == TAILCALL_FRAME) + frame = get_prev_frame (frame); + + return frame; +} + /* Compute the frame's uniq ID that can be used to, later, re-find the frame. */ @@ -972,8 +983,7 @@ frame_pop (struct frame_info *this_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); + prev_frame = skip_tailcall_frames (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 diff --git a/gdb/frame.h b/gdb/frame.h index 2e05dfa..7e8b01e 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -820,5 +820,9 @@ extern int frame_unwinder_is (struct frame_info *fi, extern enum language get_frame_language (struct frame_info *frame); +/* Return the first non-tailcall frame above FRAME or FRAME if it is not a + tailcall frame. */ + +extern struct frame_info *skip_tailcall_frames (struct frame_info *frame); #endif /* !defined (FRAME_H) */ diff --git a/gdb/infcmd.c b/gdb/infcmd.c index df13896..930dc61 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -2002,8 +2002,7 @@ finish_command (char *arg, int from_tty) /* Ignore TAILCALL_FRAME type frames, they were executed already before entering THISFRAME. */ - while (get_frame_type (frame) == TAILCALL_FRAME) - frame = get_prev_frame (frame); + frame = skip_tailcall_frames (frame); /* Find the function we will return from. */ |