summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-12-29 17:41:43 +0000
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-12-29 17:41:43 +0000
commitdfe1b3f31478817951ee8c493d5eec605b43cc6a (patch)
tree83ca8a710e39b4362a1f99eca4fcd232114dde68 /src
parent6c9b804d6187edda4f46f8458deec0b17ec76bb9 (diff)
downloadopenocd+libswd-dfe1b3f31478817951ee8c493d5eec605b43cc6a.tar.gz
openocd+libswd-dfe1b3f31478817951ee8c493d5eec605b43cc6a.tar.bz2
openocd+libswd-dfe1b3f31478817951ee8c493d5eec605b43cc6a.tar.xz
openocd+libswd-dfe1b3f31478817951ee8c493d5eec605b43cc6a.zip
- add support for extended gdb packet R (restart), requires gdb to be started with target extended-remote
git-svn-id: svn://svn.berlios.de/openocd/trunk@247 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/server/gdb_server.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index 0ec1af73..ef45c772 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -1656,6 +1656,7 @@ int gdb_input(connection_t *connection)
int packet_size;
int retval;
gdb_connection_t *gdb_con = connection->priv;
+ static int extended_protocol = 0;
/* drain input buffer */
do
@@ -1728,14 +1729,26 @@ int gdb_input(connection_t *connection)
break;
case 'D':
retval = gdb_detach(connection, target);
+ extended_protocol = 0;
break;
case 'X':
if ((retval = gdb_write_memory_binary_packet(connection, target, packet, packet_size)) != ERROR_OK)
return retval;
break;
case 'k':
+ if (extended_protocol != 0)
+ break;
gdb_put_packet(connection, "OK", 2);
return ERROR_SERVER_REMOTE_CLOSED;
+ case '!':
+ /* handle extended remote protocol */
+ extended_protocol = 1;
+ gdb_put_packet(connection, "OK", 2);
+ break;
+ case 'R':
+ /* handle extended restart packet */
+ target_process_reset(connection->cmd_ctx);
+ break;
default:
/* ignore unkown packets */
DEBUG("ignoring 0x%2.2x packet", packet[0]);