aboutsummaryrefslogtreecommitdiff
path: root/gdb/dummy-frame.c
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/dummy-frame.c
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/dummy-frame.c')
-rw-r--r--gdb/dummy-frame.c48
1 files changed, 48 insertions, 0 deletions
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);
+
+}