2005-12-01 21:07:06 +00:00
|
|
|
2005-12-01 Jeff Johnston <jjohnstn@redhat.com>
|
|
|
|
|
|
|
|
* frame.c (backtrace_past_zero_pc): New static variable.
|
|
|
|
(get_prev_frame): Don't return NULL for zero pc value if
|
|
|
|
backtrace past-zero-frame option is turned on.
|
|
|
|
(_initialize_frame): Initialize new command to allow backtracing
|
|
|
|
past a zero pc value (set backtrace past-zero-pc).
|
|
|
|
|
|
|
|
testsuite/gdb.base:
|
|
|
|
2005-12-01 Jeff Johnston <jjohnstn@redhat.com>
|
|
|
|
|
|
|
|
* setshow.exp: Add testing of "set backtrace past-zero-pc" option.
|
|
|
|
|
2007-11-01 20:24:20 +00:00
|
|
|
2007-10-15 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
Port to GDB-6.7.
|
|
|
|
|
2010-07-21 21:30:20 +00:00
|
|
|
Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.base/setshow.exp
|
2006-07-11 06:33:02 +00:00
|
|
|
===================================================================
|
2010-07-21 21:30:20 +00:00
|
|
|
--- gdb-7.1.90.20100711.orig/gdb/testsuite/gdb.base/setshow.exp 2010-06-11 22:56:06.000000000 +0200
|
|
|
|
+++ gdb-7.1.90.20100711/gdb/testsuite/gdb.base/setshow.exp 2010-07-12 10:46:06.000000000 +0200
|
|
|
|
@@ -96,6 +96,16 @@ if { ![target_info exists use_gdb_stub]
|
2005-12-01 21:07:06 +00:00
|
|
|
delete_breakpoints
|
|
|
|
gdb_test "run" "Starting program:.*foo bar blup baz bubble.*" "passing args"
|
|
|
|
}
|
|
|
|
+#test show backtrace past-zero-pc
|
|
|
|
+gdb_test "show backtrace past-zero-pc" "Whether backtraces should continue past a zero pc value is off." "default show backtrace past-zero-pc (off)"
|
|
|
|
+#test set backtrace past-zero-pc on
|
|
|
|
+gdb_test "set backtrace past-zero-pc on" "" "set backtrace past-zero-pc on"
|
|
|
|
+#test show backtrace past-zero-pc
|
|
|
|
+gdb_test "show backtrace past-zero-pc" "Whether backtraces should continue past a zero pc value is on." "show backtrace past-zero-pc (on)"
|
|
|
|
+#test set backtrace past-zero-pc off
|
|
|
|
+gdb_test "set backtrace past-zero-pc off" "" "set backtrace past-zero-pc off"
|
|
|
|
+#test show backtrace past-zero-pc
|
|
|
|
+gdb_test "show backtrace past-zero-pc" "Whether backtraces should continue past a zero pc value is off." "show backtrace past-zero-pc (off)"
|
|
|
|
#test set check range on
|
2010-07-21 21:30:20 +00:00
|
|
|
gdb_test "set check range on" ".*" "set check range on"
|
2005-12-01 21:07:06 +00:00
|
|
|
#test show check range on
|
2010-07-21 21:30:20 +00:00
|
|
|
Index: gdb-7.1.90.20100711/gdb/frame.c
|
2006-07-11 06:33:02 +00:00
|
|
|
===================================================================
|
2010-07-21 21:30:20 +00:00
|
|
|
--- gdb-7.1.90.20100711.orig/gdb/frame.c 2010-07-12 10:00:56.000000000 +0200
|
|
|
|
+++ gdb-7.1.90.20100711/gdb/frame.c 2010-07-12 10:45:18.000000000 +0200
|
|
|
|
@@ -185,6 +185,16 @@ Whether backtraces should continue past
|
2006-07-11 06:33:02 +00:00
|
|
|
value);
|
|
|
|
}
|
2005-12-01 21:07:06 +00:00
|
|
|
|
|
|
|
+static int backtrace_past_zero_pc;
|
2006-07-11 06:33:02 +00:00
|
|
|
+static void
|
|
|
|
+show_backtrace_past_zero_pc (struct ui_file *file, int from_tty,
|
|
|
|
+ struct cmd_list_element *c, const char *value)
|
|
|
|
+{
|
|
|
|
+ fprintf_filtered (file, _("\
|
|
|
|
+Whether backtraces should continue past a zero pc value is %s.\n"),
|
|
|
|
+ value);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static int backtrace_past_entry;
|
2005-12-01 21:07:06 +00:00
|
|
|
static void
|
2006-07-11 06:33:02 +00:00
|
|
|
show_backtrace_past_entry (struct ui_file *file, int from_tty,
|
2010-07-21 21:30:20 +00:00
|
|
|
@@ -1784,9 +1794,7 @@ get_prev_frame (struct frame_info *this_
|
2005-12-01 21:07:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (this_frame->level > 0
|
|
|
|
-#if 0
|
|
|
|
- && backtrace_past_zero_pc
|
|
|
|
-#endif
|
|
|
|
+ && !backtrace_past_zero_pc
|
|
|
|
&& get_frame_type (this_frame) == NORMAL_FRAME
|
|
|
|
&& get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME
|
|
|
|
&& get_frame_pc (this_frame) == 0)
|
2010-07-21 21:30:20 +00:00
|
|
|
@@ -2271,6 +2279,17 @@ the rest of the stack trace."),
|
2006-07-11 06:33:02 +00:00
|
|
|
&set_backtrace_cmdlist,
|
2005-12-01 21:07:06 +00:00
|
|
|
&show_backtrace_cmdlist);
|
|
|
|
|
|
|
|
+ add_setshow_boolean_cmd ("past-zero-pc", class_obscure,
|
2006-07-11 06:33:02 +00:00
|
|
|
+ &backtrace_past_zero_pc, _("\
|
|
|
|
+Set whether backtraces should continue past a zero pc value."), _("\
|
|
|
|
+Show whether backtraces should continue past a zero pc value."), _("\
|
2005-12-01 21:07:06 +00:00
|
|
|
+Normally GDB stops backtracing when it finds a zero pc.\n\
|
2006-07-11 06:33:02 +00:00
|
|
|
+Set this variable if you need to see the rest of the stack trace."),
|
|
|
|
+ NULL,
|
|
|
|
+ show_backtrace_past_zero_pc,
|
|
|
|
+ &set_backtrace_cmdlist,
|
|
|
|
+ &show_backtrace_cmdlist);
|
2005-12-01 21:07:06 +00:00
|
|
|
+
|
2006-07-11 06:33:02 +00:00
|
|
|
add_setshow_integer_cmd ("limit", class_obscure,
|
|
|
|
&backtrace_limit, _("\
|
|
|
|
Set an upper bound on the number of backtrace levels."), _("\
|