aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/server.c
diff options
context:
space:
mode:
authorOrjan Friberg <orjanf@axis.com>2005-05-12 12:14:23 +0000
committerOrjan Friberg <orjanf@axis.com>2005-05-12 12:14:23 +0000
commite013ee27c925f173a7e402fce26a2c75f78f9f40 (patch)
treeb4791156d9d0694fda9746c7c550ba420ebcc427 /gdb/gdbserver/server.c
parent119b882a3d5bbb167438b2020cbadd17ba4a9202 (diff)
downloadgdb-e013ee27c925f173a7e402fce26a2c75f78f9f40.zip
gdb-e013ee27c925f173a7e402fce26a2c75f78f9f40.tar.gz
gdb-e013ee27c925f173a7e402fce26a2c75f78f9f40.tar.bz2
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.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r--gdb/gdbserver/server.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index c8ba5a2..137ae9e 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -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 ();