mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 01:28:46 +00:00
2005-05-12 Orjan Friberg <orjanf@axis.com>
* target.h (struct target_ops): Add insert_watchpoint, remove_watchpoint, stopped_by_watchpoint, stopped_data_address function pointers for hardware watchpoint support. * linux-low.h (struct linux_target_ops): Ditto. * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint) (linux_stopped_by_watchpoint, linux_stopped_data_address): New. Add to linux_target_ops. * remote-utils.c (prepare_resume_reply): Add watchpoint information to reply packet. * server.c (main): Recognize 'Z' and 'z' packets.
This commit is contained in:
@@ -509,6 +509,66 @@ main (int argc, char *argv[])
|
||||
signal = mywait (&status, 1);
|
||||
prepare_resume_reply (own_buf, status, signal);
|
||||
break;
|
||||
case 'Z':
|
||||
{
|
||||
char *lenptr;
|
||||
char *dataptr;
|
||||
CORE_ADDR addr = strtoul (&own_buf[3], &lenptr, 16);
|
||||
int len = strtol (lenptr + 1, &dataptr, 16);
|
||||
char type = own_buf[1];
|
||||
|
||||
if (the_target->insert_watchpoint == NULL
|
||||
|| (type < '2' || type > '4'))
|
||||
{
|
||||
/* No watchpoint support or not a watchpoint command;
|
||||
unrecognized either way. */
|
||||
own_buf[0] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
int res;
|
||||
|
||||
res = (*the_target->insert_watchpoint) (type, addr, len);
|
||||
if (res == 0)
|
||||
write_ok (own_buf);
|
||||
else if (res == 1)
|
||||
/* Unsupported. */
|
||||
own_buf[0] = '\0';
|
||||
else
|
||||
write_enn (own_buf);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'z':
|
||||
{
|
||||
char *lenptr;
|
||||
char *dataptr;
|
||||
CORE_ADDR addr = strtoul (&own_buf[3], &lenptr, 16);
|
||||
int len = strtol (lenptr + 1, &dataptr, 16);
|
||||
char type = own_buf[1];
|
||||
|
||||
if (the_target->remove_watchpoint == NULL
|
||||
|| (type < '2' || type > '4'))
|
||||
{
|
||||
/* No watchpoint support or not a watchpoint command;
|
||||
unrecognized either way. */
|
||||
own_buf[0] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
int res;
|
||||
|
||||
res = (*the_target->remove_watchpoint) (type, addr, len);
|
||||
if (res == 0)
|
||||
write_ok (own_buf);
|
||||
else if (res == 1)
|
||||
/* Unsupported. */
|
||||
own_buf[0] = '\0';
|
||||
else
|
||||
write_enn (own_buf);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'k':
|
||||
fprintf (stderr, "Killing inferior\n");
|
||||
kill_inferior ();
|
||||
|
||||
Reference in New Issue
Block a user