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 cf8b1a02031e70240c1d9e8c6baa5f14beb52571..0e6d58cd186bd5a979a0e1f0aaf1881975ca9b9b 100644 (file)
@@ -1,3 +1,13 @@
+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.
index 46b4f40cb2f1502b9b8f06c10986f2c075a84211..43d544dab146e0c1d700693cefcafbff4a086474 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 3a4789a41b7dd8419263ddc75ff046d738eb9e65..9ad87b5631257120f47f719a24a3b51091e8a7d5 100644 (file)
@@ -5,6 +5,11 @@
        FIX_CALL_DUMMY, CALL_DUMMY_BREAKPOINT_OFFSET and
        CALL_DUMMY_BREAKPOINT_OFFSET deprecated.
 
+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 @}.
index 370ad3aa6e433cbf1b6e4bd15b0780d5d711644a..7bb99c630fa077a5a60929aa6d9a7e16d08534dd 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 e6c9ca6199e430dc26ab4fb4d470488bc950a54e..e16056c4412b2be410c9673b32a58ee891afae6d 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 4af3d6c5474cf74b9552f8c4635f53279772d1f2..b881a74d3453c1d38fe2cae10ef798334eb96b86 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 cb629d995c02e5cdb384d68f6cfdf31b1d175699..a8f05f35f8b649e537958004ccbe28f01f098958 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 a9a0436bd949aa28cb66848549190c6e45a6e774..d85e0ceafe4cf1a4a85c35e4521759b1ee92474f 100644 (file)
@@ -1,3 +1,7 @@
+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
index d8286508699237e247f240011c509610595e3f23..f82bf0202b0f415193c27c5395c32b00be23ebfa 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 $"\
This page took 0.046975 seconds and 4 git commands to generate.