aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-05-05 18:33:11 +0000
committerAndrew Cagney <cagney@redhat.com>2003-05-05 18:33:11 +0000
commit00905d52fe94f8ad61bfb36a7a427ae6b9578aa7 (patch)
tree1c6ab224709140c14ff8770ee1693b2c74250c3d /gdb
parentb1e29e332aca04fd8b4b795d1c2ee1eb8fa7ba42 (diff)
downloadgdb-00905d52fe94f8ad61bfb36a7a427ae6b9578aa7.zip
gdb-00905d52fe94f8ad61bfb36a7a427ae6b9578aa7.tar.gz
gdb-00905d52fe94f8ad61bfb36a7a427ae6b9578aa7.tar.bz2
Index: testsuite/ChangeLog
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/Makefile.in3
-rw-r--r--gdb/doc/ChangeLog5
-rw-r--r--gdb/doc/gdb.texinfo22
-rw-r--r--gdb/dummy-frame.c48
-rw-r--r--gdb/frame.c2
-rw-r--r--gdb/frame.h4
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.base/maint.exp7
9 files changed, 103 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cf8b1a0..0e6d58c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 46b4f40..43d544d 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -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) \
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 3a4789a..9ad87b5 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -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>
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 370ad3a..7bb99c6 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -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
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index e6c9ca6..e16056c 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -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);
+
+}
diff --git a/gdb/frame.c b/gdb/frame.c
index 4af3d6c..b881a74 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -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}",
diff --git a/gdb/frame.h b/gdb/frame.h
index cb629d9..a8f05f3 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -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
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index a9a0436..d85e0ce 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -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.
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index d828650..f82bf02 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -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 $"\