Index: testsuite/ChangeLog
authorAndrew Cagney <cagney@redhat.com>
Mon, 5 May 2003 18:33:11 +0000 (18:33 +0000)
committerAndrew Cagney <cagney@redhat.com>
Mon, 5 May 2003 18:33:11 +0000 (18:33 +0000)
2003-05-05  Andrew Cagney  <cagney@redhat.com>

* gdb.base/maint.exp: Add tests for "maint print dummy-frames".

Index: doc/ChangeLog
2003-05-05  Andrew Cagney  <cagney@redhat.com>

* gdb.texinfo (Maintenance Commands): Document "maint print
dummy-frames".

2003-05-05  Andrew Cagney  <cagney@redhat.com>

* dummy-frame.c: Include "command.h" and "gdbcmd.h".
(fprint_dummy_frames): New function.
(maintenance_print_dummy_frames): New function.
(_initialize_dummy_frame): Add command "maint print dummy-frames".
* frame.c (fprint_frame_id): Make global.
* frame.h (fprint_frame_id): Declare.
* Makefile.in (dummy-frame.o): Update dependencies.

gdb/ChangeLog
gdb/Makefile.in
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/dummy-frame.c
gdb/frame.c
gdb/frame.h
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/maint.exp

index cf8b1a0..0e6d58c 100644 (file)
@@ -1,5 +1,15 @@
 2003-05-05  Andrew Cagney  <cagney@redhat.com>
 
+       * dummy-frame.c: Include "command.h" and "gdbcmd.h".
+       (fprint_dummy_frames): New function.
+       (maintenance_print_dummy_frames): New function.
+       (_initialize_dummy_frame): Add command "maint print dummy-frames".
+       * frame.c (fprint_frame_id): Make global.
+       * frame.h (fprint_frame_id): Declare.
+       * Makefile.in (dummy-frame.o): Update dependencies.
+
+2003-05-05  Andrew Cagney  <cagney@redhat.com>
+
        * gdbarch.sh (DEPRECATED_REGISTER_SIZE): Rename REGISTER_SIZE.
        (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS): Rename
        SIZEOF_CALL_DUMMY_WORDS.
index 46b4f40..43d544d 100644 (file)
@@ -1662,7 +1662,8 @@ doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) \
 dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h)
 dsrec.o: dsrec.c $(defs_h) $(serial_h) $(srec_h)
 dummy-frame.o: dummy-frame.c $(defs_h) $(dummy_frame_h) $(regcache_h) \
-       $(frame_h) $(inferior_h) $(gdb_assert_h) $(frame_unwind_h)
+       $(frame_h) $(inferior_h) $(gdb_assert_h) $(frame_unwind_h) \
+       $(command_h) $(gdbcmd_h)
 dve3900-rom.o: dve3900-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
        $(serial_h) $(inferior_h) $(command_h) $(gdb_string_h) $(regcache_h)
 dwarf2cfi.o: dwarf2cfi.c $(defs_h) $(gdbcore_h) $(symtab_h) $(symfile_h) \
index 3a4789a..9ad87b5 100644 (file)
@@ -7,6 +7,11 @@
 
 2003-05-04  Andrew Cagney  <cagney@redhat.com>
 
+       * gdb.texinfo (Maintenance Commands): Document "maint print
+       dummy-frames".
+
+2003-05-04  Andrew Cagney  <cagney@redhat.com>
+
        * gdb.texinfo (GDB/MI Symbol Query): Use @{ and @}.
 
 2003-05-03  J. Brobecker  <brobecker@gnat.com>
index 370ad3a..7bb99c6 100644 (file)
@@ -19373,6 +19373,28 @@ Create a core file? (y or n) @kbd{n}
 Takes an optional parameter that is used as the text of the error or
 warning message.
 
+@kindex maint print dummy-frames
+@item maint print dummy-frames
+
+Prints the contents of @value{GDBN}'s internal dummy-frame stack.
+
+@smallexample
+(gdb) @kbd{b add}
+@dots{}
+(gdb) @kbd{print add(2,3)}
+Breakpoint 2, add (a=2, b=3) at @dots{}
+58       return (a + b);
+The program being debugged stopped while in a function called from GDB.
+@dots{}
+(gdb) @kbd{maint print dummy-frames}
+0x1a57c80: pc=0x01014068 fp=0x0200bddc sp=0x0200bdd6
+ top=0x0200bdd4 id=@{stack=0x200bddc,code=0x101405c@}
+ call_lo=0x01014000 call_hi=0x01014001
+(gdb) 
+@end smallexample
+
+Takes an optional file parameter.
+
 @kindex maint print registers
 @kindex maint print raw-registers
 @kindex maint print cooked-registers
index e6c9ca6..e16056c 100644 (file)
@@ -29,6 +29,8 @@
 #include "inferior.h"
 #include "gdb_assert.h"
 #include "frame-unwind.h"
+#include "command.h"
+#include "gdbcmd.h"
 
 static void dummy_frame_this_id (struct frame_info *next_frame,
                                 void **this_prologue_cache,
@@ -419,3 +421,49 @@ dummy_frame_p (CORE_ADDR pc)
   else
     return NULL;
 }
+
+static void
+fprint_dummy_frames (struct ui_file *file)
+{
+  struct dummy_frame *s;
+  for (s = dummy_frame_stack; s != NULL; s = s->next)
+    {
+      gdb_print_host_address (s, file);
+      fprintf_unfiltered (file, ":");
+      fprintf_unfiltered (file, " pc=0x%s", paddr (s->pc));
+      fprintf_unfiltered (file, " fp=0x%s", paddr (s->fp));
+      fprintf_unfiltered (file, " sp=0x%s", paddr (s->sp));
+      fprintf_unfiltered (file, " top=0x%s", paddr (s->top));
+      fprintf_unfiltered (file, " id=");
+      fprint_frame_id (file, s->id);
+      fprintf_unfiltered (file, " call_lo=0x%s", paddr (s->call_lo));
+      fprintf_unfiltered (file, " call_hi=0x%s", paddr (s->call_hi));
+      fprintf_unfiltered (file, "\n");
+    }
+}
+
+static void
+maintenance_print_dummy_frames (char *args, int from_tty)
+{
+  if (args == NULL)
+    fprint_dummy_frames (gdb_stdout);
+  else
+    {
+      struct ui_file *file = gdb_fopen (args, "w");
+      if (file == NULL)
+       perror_with_name ("maintenance print dummy-frames");
+      fprint_dummy_frames (file);    
+      ui_file_delete (file);
+    }
+}
+
+extern void _initialize_dummy_frame (void);
+
+void
+_initialize_dummy_frame (void)
+{
+  add_cmd ("dummy-frames", class_maintenance, maintenance_print_dummy_frames,
+          "Print the contents of the internal dummy-frame stack.",
+          &maintenanceprintlist);
+
+}
index 4af3d6c..b881a74 100644 (file)
@@ -139,7 +139,7 @@ static int frame_debug;
 
 static int backtrace_below_main;
 
-static void
+void
 fprint_frame_id (struct ui_file *file, struct frame_id id)
 {
   fprintf_unfiltered (file, "{stack=0x%s,code=0x%s}",
index cb629d9..a8f05f3 100644 (file)
@@ -95,6 +95,10 @@ extern int frame_id_eq (struct frame_id l, struct frame_id r);
    above about frameless functions.  */
 extern int frame_id_inner (struct frame_id l, struct frame_id r);
 
+/* Write the internal representation of a frame ID on the specified
+   stream.  */
+extern void fprint_frame_id (struct ui_file *file, struct frame_id id);
+
 
 /* For every stopped thread, GDB tracks two frames: current and
    selected.  Current frame is the inner most frame of the selected
index a9a0436..d85e0ce 100644 (file)
@@ -1,5 +1,9 @@
 2003-05-05  Andrew Cagney  <cagney@redhat.com>
 
+       * gdb.base/maint.exp: Add tests for "maint print dummy-frames".
+
+2003-05-05  Andrew Cagney  <cagney@redhat.com>
+
        * gdb.base/watchpoint.exp: Rename CALL_DUMMY_BREAKPOINT_OFFSET to
        DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET in comments.
 
index d828650..f82bf02 100644 (file)
@@ -35,6 +35,7 @@
 #maintenance info -- Commands for showing internal info about the program being debugged
 #maintenance internal-error -- Give GDB an internal error.
 #
+#maintenance print dummy-frames -- Print the dummy frame stack
 #maintenance print statistics -- Print statistics about internal gdb state
 #maintenance print objfiles -- Print dump of current object file definitions
 #maintenance print psymbols -- Print dump of current partial symbol definitions
@@ -186,6 +187,9 @@ gdb_expect  {
         timeout         { fail "(timeout) maint print statistics" }
         }
 
+# There aren't any ...
+gdb_test "maint print dummy-frames" ""
+
 send_gdb "maint print objfiles\n"
 
 # To avoid timeouts, we avoid expects with many .* patterns that match
@@ -524,6 +528,9 @@ gdb_expect  {
         timeout         { fail "(timeout) help maint print statistics" }
         }
 
+gdb_test "help maint print dummy-frames" \
+       "Print the contents of the internal dummy-frame stack."
+
 send_gdb "help maint print objfiles\n"
 gdb_expect  {
         -re "Print dump of current object file definitions\\..*$gdb_prompt $"\