aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2007-01-29 16:36:01 +0000
committerJoel Brobecker <brobecker@gnat.com>2007-01-29 16:36:01 +0000
commit87680a14102a1e14320cc77de8fa4894bd994984 (patch)
treec244d40096a086ce8b5d9701b5206a95c387bc0f /gdb/target.c
parentc7b8f16e1836203e1ff854c486411106ecc99f6b (diff)
downloadfsf-binutils-gdb-87680a14102a1e14320cc77de8fa4894bd994984.zip
fsf-binutils-gdb-87680a14102a1e14320cc77de8fa4894bd994984.tar.gz
fsf-binutils-gdb-87680a14102a1e14320cc77de8fa4894bd994984.tar.bz2
* target.c (maintenance_print_target_stack): New function.
(initialize_targets): Add new "maintenance print target-stack" command.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 6893c87..caa2279 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -2769,6 +2769,21 @@ do_monitor_command (char *cmd,
target_rcmd (cmd, gdb_stdtarg);
}
+/* Print the name of each layers of our target stack. */
+
+static void
+maintenance_print_target_stack (char *cmd, int from_tty)
+{
+ struct target_ops *t;
+
+ printf_filtered (_("The current target stack is:\n"));
+
+ for (t = target_stack; t != NULL; t = t->beneath)
+ {
+ printf_filtered (" - %s (%s)\n", t->to_shortname, t->to_longname);
+ }
+}
+
void
initialize_targets (void)
{
@@ -2802,5 +2817,9 @@ result in significant performance improvement for remote targets."),
add_com ("monitor", class_obscure, do_monitor_command,
_("Send a command to the remote monitor (remote targets only)."));
+ add_cmd ("target-stack", class_maintenance, maintenance_print_target_stack,
+ _("Print the name of each layer of the internal target stack."),
+ &maintenanceprintlist);
+
target_dcache = dcache_init ();
}