- 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
This commit is contained in:
parent
6c9b804d61
commit
dfe1b3f314
|
@ -1656,6 +1656,7 @@ int gdb_input(connection_t *connection)
|
||||||
int packet_size;
|
int packet_size;
|
||||||
int retval;
|
int retval;
|
||||||
gdb_connection_t *gdb_con = connection->priv;
|
gdb_connection_t *gdb_con = connection->priv;
|
||||||
|
static int extended_protocol = 0;
|
||||||
|
|
||||||
/* drain input buffer */
|
/* drain input buffer */
|
||||||
do
|
do
|
||||||
|
@ -1728,14 +1729,26 @@ int gdb_input(connection_t *connection)
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
retval = gdb_detach(connection, target);
|
retval = gdb_detach(connection, target);
|
||||||
|
extended_protocol = 0;
|
||||||
break;
|
break;
|
||||||
case 'X':
|
case 'X':
|
||||||
if ((retval = gdb_write_memory_binary_packet(connection, target, packet, packet_size)) != ERROR_OK)
|
if ((retval = gdb_write_memory_binary_packet(connection, target, packet, packet_size)) != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
break;
|
break;
|
||||||
case 'k':
|
case 'k':
|
||||||
|
if (extended_protocol != 0)
|
||||||
|
break;
|
||||||
gdb_put_packet(connection, "OK", 2);
|
gdb_put_packet(connection, "OK", 2);
|
||||||
return ERROR_SERVER_REMOTE_CLOSED;
|
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:
|
default:
|
||||||
/* ignore unkown packets */
|
/* ignore unkown packets */
|
||||||
DEBUG("ignoring 0x%2.2x packet", packet[0]);
|
DEBUG("ignoring 0x%2.2x packet", packet[0]);
|
||||||
|
|
Loading…
Reference in New Issue