aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/openocd.texi12
-rw-r--r--src/target/target.c7
2 files changed, 19 insertions, 0 deletions
diff --git a/doc/openocd.texi b/doc/openocd.texi
index 52a51c1..55e6e76 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -9191,6 +9191,18 @@ read_memory 0x20000000 32 2
@end example
@end deffn
+@deffn {Command} {debug_reason}
+Displays the current debug reason:
+@code{debug-request},
+@code{breakpoint},
+@code{watchpoint},
+@code{watchpoint-and-breakpoint},
+@code{single-step},
+@code{target-not-halted},
+@code{program-exit},
+@code{exception-catch} or @code{undefined}.
+@end deffn
+
@deffn {Command} {halt} [ms]
@deffnx {Command} {wait_halt} [ms]
The @command{halt} command first sends a halt request to the target,
diff --git a/src/target/target.c b/src/target/target.c
index 45698a6..5168305 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -6737,6 +6737,13 @@ static const struct command_registration target_exec_command_handlers[] = {
.usage = "address width data ['phys']",
},
{
+ .name = "debug_reason",
+ .mode = COMMAND_EXEC,
+ .handler = handle_target_debug_reason,
+ .help = "displays the debug reason of this target",
+ .usage = "",
+ },
+ {
.name = "reset_nag",
.handler = handle_target_reset_nag,
.mode = COMMAND_ANY,