diff options
author | Kevin Pouget <kpouget@sourceware.org> | 2011-10-27 11:04:27 +0000 |
---|---|---|
committer | Kevin Pouget <kpouget@sourceware.org> | 2011-10-27 11:04:27 +0000 |
commit | 2231f1fb609de30056ec5d3f526b39ee146efcab (patch) | |
tree | c7f513cc242b04a687017f406ba7507fca657df7 /gdb/frame.h | |
parent | f77b9a5df0dca976e9fa9c8731c313d5b54befe1 (diff) | |
download | gdb-2231f1fb609de30056ec5d3f526b39ee146efcab.zip gdb-2231f1fb609de30056ec5d3f526b39ee146efcab.tar.gz gdb-2231f1fb609de30056ec5d3f526b39ee146efcab.tar.bz2 |
Move unwind reasons to an external .def file
gdb/
* frame.c (frame_stop_reason_string): Rewrite using
unwind_stop_reasons.def.
* frame.h (enum unwind_stop_reason): Likewise.
* python/py-frame.c (gdbpy_initialize_frames): Likewise.
(gdbpy_frame_stop_reason_string): Use new enum unwind_stop_reason
constants for bound-checking.
* unwind_stop_reasons.def: New file.
* stack.c (backtrace_command_1): Handle UNWIND_FIRST_ERROR as an alias
instead of a distinct value.
doc/
* gdb.texinfo ((Frames In Python): Document
gdb.FRAME_UNWIND_FIRST_ERROR contant.
Diffstat (limited to 'gdb/frame.h')
-rw-r--r-- | gdb/frame.h | 51 |
1 files changed, 10 insertions, 41 deletions
diff --git a/gdb/frame.h b/gdb/frame.h index a261a91..55972de 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -446,47 +446,16 @@ extern struct address_space *get_frame_address_space (struct frame_info *); enum unwind_stop_reason { - /* No particular reason; either we haven't tried unwinding yet, - or we didn't fail. */ - UNWIND_NO_REASON, - - /* The previous frame's analyzer returns an invalid result - from this_id. - - FIXME drow/2006-08-16: This is how GDB used to indicate end of - stack. We should migrate to a model where frames always have a - valid ID, and this becomes not just an error but an internal - error. But that's a project for another day. */ - UNWIND_NULL_ID, - - /* This frame is the outermost. */ - UNWIND_OUTERMOST, - - /* All the conditions after this point are considered errors; - abnormal stack termination. If a backtrace stops for one - of these reasons, we'll let the user know. This marker - is not a valid stop reason. */ - UNWIND_FIRST_ERROR, - - /* Can't unwind further, because that would require knowing the - values of registers or memory that haven't been collected. */ - UNWIND_UNAVAILABLE, - - /* This frame ID looks like it ought to belong to a NEXT frame, - but we got it for a PREV frame. Normally, this is a sign of - unwinder failure. It could also indicate stack corruption. */ - UNWIND_INNER_ID, - - /* This frame has the same ID as the previous one. That means - that unwinding further would almost certainly give us another - frame with exactly the same ID, so break the chain. Normally, - this is a sign of unwinder failure. It could also indicate - stack corruption. */ - UNWIND_SAME_ID, - - /* The frame unwinder didn't find any saved PC, but we needed - one to unwind further. */ - UNWIND_NO_SAVED_PC, +#define SET(name, description) name, +#define FIRST_ENTRY(name) UNWIND_FIRST = name, +#define LAST_ENTRY(name) UNWIND_LAST = name, +#define FIRST_ERROR(name) UNWIND_FIRST_ERROR = name, + +#include "unwind_stop_reasons.def" +#undef SET +#undef FIRST_ENTRY +#undef LAST_ENTRY +#undef FIRST_ERROR }; /* Return the reason why we can't unwind past this frame. */ |