diff options
author | Orjan Friberg <orjanf@axis.com> | 2005-05-12 12:14:23 +0000 |
---|---|---|
committer | Orjan Friberg <orjanf@axis.com> | 2005-05-12 12:14:23 +0000 |
commit | e013ee27c925f173a7e402fce26a2c75f78f9f40 (patch) | |
tree | b4791156d9d0694fda9746c7c550ba420ebcc427 /gdb/gdbserver/linux-low.c | |
parent | 119b882a3d5bbb167438b2020cbadd17ba4a9202 (diff) | |
download | gdb-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/linux-low.c')
-rw-r--r-- | gdb/gdbserver/linux-low.c | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 4244fc9..c7dab4c 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -1467,7 +1467,47 @@ linux_read_auxv (CORE_ADDR offset, char *myaddr, unsigned int len) return n; } - +/* These watchpoint related wrapper functions simply pass on the function call + if the target has registered a corresponding function. */ + +static int +linux_insert_watchpoint (char type, CORE_ADDR addr, int len) +{ + if (the_low_target.insert_watchpoint != NULL) + return the_low_target.insert_watchpoint (type, addr, len); + else + /* Unsupported (see target.h). */ + return 1; +} + +static int +linux_remove_watchpoint (char type, CORE_ADDR addr, int len) +{ + if (the_low_target.remove_watchpoint != NULL) + return the_low_target.remove_watchpoint (type, addr, len); + else + /* Unsupported (see target.h). */ + return 1; +} + +static int +linux_stopped_by_watchpoint (void) +{ + if (the_low_target.stopped_by_watchpoint != NULL) + return the_low_target.stopped_by_watchpoint (); + else + return 0; +} + +static CORE_ADDR +linux_stopped_data_address (void) +{ + if (the_low_target.stopped_data_address != NULL) + return the_low_target.stopped_data_address (); + else + return 0; +} + static struct target_ops linux_target_ops = { linux_create_inferior, linux_attach, @@ -1483,6 +1523,10 @@ static struct target_ops linux_target_ops = { linux_look_up_symbols, linux_send_signal, linux_read_auxv, + linux_insert_watchpoint, + linux_remove_watchpoint, + linux_stopped_by_watchpoint, + linux_stopped_data_address, }; static void |