summaryrefslogtreecommitdiff
path: root/src/target/target.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-03-05 10:28:32 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-03-05 10:28:32 +0000
commit6d95014674415e3b9ea9d46d5148d3410f96bbfd (patch)
tree44aac36e9d004c270e1208f2052367ff24dbca42 /src/target/target.c
parent6445cc6479cc04d7d88447526394210f5867c0ba (diff)
downloadopenocd+libswd-6d95014674415e3b9ea9d46d5148d3410f96bbfd.tar.gz
openocd+libswd-6d95014674415e3b9ea9d46d5148d3410f96bbfd.tar.bz2
openocd+libswd-6d95014674415e3b9ea9d46d5148d3410f96bbfd.tar.xz
openocd+libswd-6d95014674415e3b9ea9d46d5148d3410f96bbfd.zip
* fixed malloc corruption in target->debug_reason
* GDB remote server will now remain online even if the target is in a funny state, e.g. if it requires a reset, it is running while GDB is not in the continue or step packet, e.g. via monitor resume/halt commands in GDB script. * Added some _DEBUG_GDB_IO_ debug tools * Fixed a couple of GDB server lockups, e.g. when O packets detect a severed connection * added ACK upon connection (send +). * added keep-alive messages to reset so GDB protocol remains happy. * fixed crash when timing out connection to GDB git-svn-id: svn://svn.berlios.de/openocd/trunk@445 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/target.c')
-rw-r--r--src/target/target.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/target/target.c b/src/target/target.c
index 76f7449b..06abb37c 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -122,7 +122,7 @@ char *target_debug_reason_strings[] =
{
"debug request", "breakpoint", "watchpoint",
"watchpoint and breakpoint", "single step",
- "target not halted"
+ "target not halted", "undefined"
};
char *target_endianess_strings[] =
@@ -362,7 +362,11 @@ int target_process_reset(struct command_context_s *cmd_ctx)
command_print(cmd_ctx, "Timed out waiting for reset");
goto done;
}
- usleep(100*1000); /* Do not eat all cpu */
+ /* this will send alive messages on e.g. GDB remote protocol.
+ * GDB warns me that I'm sending a zero length formatting message,
+ * which is strange, but in fact what is intended here. */
+ usleep(500*1000);
+ USER_N("");
goto again;
}
}
@@ -1178,6 +1182,7 @@ int handle_target_command(struct command_context_s *cmd_ctx, char *cmd, char **a
(*last_target_p)->backup_working_area = 0;
(*last_target_p)->state = TARGET_UNKNOWN;
+ (*last_target_p)->debug_reason = DBG_REASON_UNDEFINED;
(*last_target_p)->reg_cache = NULL;
(*last_target_p)->breakpoints = NULL;
(*last_target_p)->watchpoints = NULL;