summaryrefslogtreecommitdiff
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
commit63a46f2b27bae898892f026ac6797aa83a0f0da0 (patch)
treef8f26a9e886fe5db7549e67a44698bf59b8a4469 /gdb/dummy-frame.c
parent155cbbc210c9d9815bc15bc8d634674c2fe1cba1 (diff)
downloadgdb-63a46f2b27bae898892f026ac6797aa83a0f0da0.tar.gz
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 e6c9ca6199e..e16056c4412 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);
+
+}