aboutsummaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorKevin Pouget <kpouget@sourceware.org>2011-10-27 11:04:27 +0000
committerKevin Pouget <kpouget@sourceware.org>2011-10-27 11:04:27 +0000
commit2231f1fb609de30056ec5d3f526b39ee146efcab (patch)
treec7f513cc242b04a687017f406ba7507fca657df7 /gdb/frame.c
parentf77b9a5df0dca976e9fa9c8731c313d5b54befe1 (diff)
downloadgdb-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.c')
-rw-r--r--gdb/frame.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index 5824020..e5e442a 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -2351,23 +2351,11 @@ frame_stop_reason_string (enum unwind_stop_reason reason)
{
switch (reason)
{
- case UNWIND_NULL_ID:
- return _("unwinder did not report frame ID");
+#define SET(name, description) \
+ case name: return _(description);
+#include "unwind_stop_reasons.def"
+#undef SET
- case UNWIND_UNAVAILABLE:
- return _("Not enough registers or memory available to unwind further");
-
- case UNWIND_INNER_ID:
- return _("previous frame inner to this frame (corrupt stack?)");
-
- case UNWIND_SAME_ID:
- return _("previous frame identical to this frame (corrupt stack?)");
-
- case UNWIND_NO_SAVED_PC:
- return _("frame did not save the PC");
-
- case UNWIND_NO_REASON:
- case UNWIND_FIRST_ERROR:
default:
internal_error (__FILE__, __LINE__,
"Invalid frame stop reason");