aboutsummaryrefslogtreecommitdiff
path: root/src/openocd.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-08-05 14:58:37 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-08-05 14:58:37 +0000
commit09bb073239279be4df77a40377da66a741f43c5c (patch)
tree819400d3cbeca93b549682c88285292f1bdcccdb /src/openocd.c
parent0ca1eb2804f548a1a325a83d754ff7e2f24de560 (diff)
downloadriscv-openocd-09bb073239279be4df77a40377da66a741f43c5c.zip
riscv-openocd-09bb073239279be4df77a40377da66a741f43c5c.tar.gz
riscv-openocd-09bb073239279be4df77a40377da66a741f43c5c.tar.bz2
GDB monitor commands now also get halted state upon e.g. "reset halt".
git-svn-id: svn://svn.berlios.de/openocd/trunk@892 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/openocd.c')
-rw-r--r--src/openocd.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/openocd.c b/src/openocd.c
index c694b6a..67d890e 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -74,6 +74,22 @@ void exit_handler(void)
jtag->quit();
}
+static int log_target_callback_event_handler(struct target_s *target, enum target_event event, void *priv)
+{
+ switch (event)
+ {
+ case TARGET_EVENT_HALTED:
+ target_arch_state(target);
+ break;
+ default:
+ break;
+ }
+
+ return ERROR_OK;
+}
+
+
+
/* OpenOCD can't really handle failure of this command. Patches welcome! :-) */
int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
@@ -128,6 +144,10 @@ int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, char **arg
gdb_init();
tcl_init(); /* allows tcl to just connect without going thru telnet */
+ target_register_event_callback(log_target_callback_event_handler, cmd_ctx);
+
+
+
return ERROR_OK;
}