Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Add set/show debug unwind command
@ 2012-06-15  7:51 Tristan Gingold
  2012-06-15 17:31 ` Joel Brobecker
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Tristan Gingold @ 2012-06-15  7:51 UTC (permalink / raw)
  To: gdb-patches@sourceware.org ml

Hi,

while working on the Win64 SEH unwinder (my next patch), I have found useful to have a debug flag for unwinder.

Tested by building gdb.

Tristan.

2012-06-15  Tristan Gingold  <gingold@adacore.com>

	* frame-unwind.c (show_unwind_debug): New function
	(unwind_debug): New variable.
	(_initialize_frame_unwind): Add show debug unwind command.
	* frame-unwind.h (unwind_debug): Declare.

diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index c90144f..e6035cc 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -27,6 +27,8 @@
 #include "exceptions.h"
 #include "gdb_assert.h"
 #include "gdb_obstack.h"
+#include "command.h"
+#include "gdbcmd.h"
 
 static struct gdbarch_data *frame_unwind_data;
 
@@ -237,6 +239,17 @@ frame_unwind_got_address (struct frame_info *frame, int regnum,
   return reg_val;
 }
 
+/* Flag to control debugging.  */
+
+int unwind_debug;
+static void
+show_unwind_debug (struct ui_file *file, int from_tty,
+		  struct cmd_list_element *c, const char *value)
+{
+  fprintf_filtered (file, _("unwind debugging is %s.\n"), value);
+}
+
+
 /* -Wmissing-prototypes */
 extern initialize_file_ftype _initialize_frame_unwind;
 
@@ -244,4 +257,14 @@ void
 _initialize_frame_unwind (void)
 {
   frame_unwind_data = gdbarch_data_register_pre_init (frame_unwind_init);
+
+  /* Debug this files internals.  */
+  add_setshow_zinteger_cmd ("unwind", class_maintenance, &unwind_debug,  _("\
+Set unwind debugging."), _("\
+Show unwind debugging."), _("\
+When non-zero, frame specific internal debugging is enabled."),
+			    NULL,
+			    show_unwind_debug,
+			    &setdebuglist, &showdebuglist);
+
 }
diff --git a/gdb/frame-unwind.h b/gdb/frame-unwind.h
index f82d763..64405b9 100644
--- a/gdb/frame-unwind.h
+++ b/gdb/frame-unwind.h
@@ -217,4 +217,8 @@ struct value *frame_unwind_got_bytes (struct frame_info *frame, int regnum,
 struct value *frame_unwind_got_address (struct frame_info *frame, int regnum,
 					CORE_ADDR addr);
 
+/* Flag to control debugging.  */
+
+extern int unwind_debug;
+
 #endif


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-06-18 16:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-15  7:51 [RFA] Add set/show debug unwind command Tristan Gingold
2012-06-15 17:31 ` Joel Brobecker
2012-06-15 17:40 ` Joel Brobecker
2012-06-15 18:18 ` Pedro Alves
2012-06-15 18:22   ` Joel Brobecker
2012-06-18  9:12     ` Tristan Gingold
2012-06-18 15:50       ` Joel Brobecker
2012-06-18 16:11       ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox