summaryrefslogtreecommitdiff
path: root/ddb
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2017-04-02 00:13:56 +0200
committerJustus Winter <justus@gnupg.org>2017-08-05 17:08:36 +0200
commite8b45fe8b5c6801f60e2825d09a2bda22e80372a (patch)
tree3a2c1ebf8d9e5deb402f491776f9617ca4b6a4cc /ddb
parentc9f2f450f92528f04ee00ead0a3fd79b475f2d2c (diff)
ddb: debug traps and port references
* ddb/db_command.c (db_debug_all_traps_cmd): New declaration and function. (db_debug_port_references_cmd): Likewise. * doc/mach.texi: Describe new commands. * i386/i386/db_interface.h (db_debug_all_traps): New declaration. * i386/i386/trap.c (db_debug_all_traps): New function. * ipc/mach_port.c (db_debug_port_references): New function. * ipc/mach_port.h (db_debug_port_references): New declaration.
Diffstat (limited to 'ddb')
-rw-r--r--ddb/db_command.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/ddb/db_command.c b/ddb/db_command.c
index 721f04fe..11bca7ac 100644
--- a/ddb/db_command.c
+++ b/ddb/db_command.c
@@ -332,6 +332,23 @@ struct db_command db_show_cmds[] = {
{ (char *)0, }
};
+void
+db_debug_all_traps_cmd(db_expr_t addr,
+ int have_addr,
+ db_expr_t count,
+ const char *modif);
+void
+db_debug_port_references_cmd(db_expr_t addr,
+ int have_addr,
+ db_expr_t count,
+ const char *modif);
+
+struct db_command db_debug_cmds[] = {
+ { "traps", db_debug_all_traps_cmd, 0, 0 },
+ { "references", db_debug_port_references_cmd, 0, 0 },
+ { (char *)0, }
+};
+
struct db_command db_command_table[] = {
#ifdef DB_MACHINE_COMMANDS
/* this must be the first entry, if it exists */
@@ -364,6 +381,7 @@ struct db_command db_command_table[] = {
{ "macro", db_def_macro_cmd, CS_OWN, 0 },
{ "dmacro", db_del_macro_cmd, CS_OWN, 0 },
{ "show", 0, 0, db_show_cmds },
+ { "debug", 0, 0, db_debug_cmds },
{ "reset", db_reset_cpu, 0, 0 },
{ "reboot", db_reset_cpu, 0, 0 },
{ "halt", db_halt_cpu, 0, 0 },
@@ -538,4 +556,32 @@ db_option(modif, option)
return(FALSE);
}
+void
+db_debug_all_traps_cmd(db_expr_t addr,
+ int have_addr,
+ db_expr_t count,
+ const char *modif)
+{
+ if (strcmp (modif, "on") == 0)
+ db_debug_all_traps (TRUE);
+ else if (strcmp (modif, "off") == 0)
+ db_debug_all_traps (FALSE);
+ else
+ db_error ("debug traps /on|/off\n");
+}
+
+void
+db_debug_port_references_cmd(db_expr_t addr,
+ int have_addr,
+ db_expr_t count,
+ const char *modif)
+{
+ if (strcmp (modif, "on") == 0)
+ db_debug_port_references (TRUE);
+ else if (strcmp (modif, "off") == 0)
+ db_debug_port_references (FALSE);
+ else
+ db_error ("debug references /on|/off\n");
+}
+
#endif /* MACH_KDB */