diff options
author | Philippe Waroquiers <philippe@sourceware.org> | 2011-07-26 20:57:54 +0000 |
---|---|---|
committer | Philippe Waroquiers <philippe@sourceware.org> | 2011-07-26 20:57:54 +0000 |
commit | 480a3f21c0e24c01710eae60a9ac75f0c3eca997 (patch) | |
tree | 111f8c45b2ae6b8eb317cae98127493de2e94aa5 /gdb/remote.c | |
parent | efa80663c6860c65971ea1d3e6284c2676074d10 (diff) | |
download | gdb-480a3f21c0e24c01710eae60a9ac75f0c3eca997.zip gdb-480a3f21c0e24c01710eae60a9ac75f0c3eca997.tar.gz gdb-480a3f21c0e24c01710eae60a9ac75f0c3eca997.tar.bz2 |
2011-07-26 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* remote.c (remote_region_ok_for_hw_watchpoint): New function.
(remote_hw_watchpoint_length_limit): New variable.
(_initialize_remote) add set,show cmds for this new variable.
* gdb.texinfo: document these new commands.
* NEWS: Mention these new commands.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index e7e417f..b17cb50 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -7763,9 +7763,23 @@ remote_remove_watchpoint (CORE_ADDR addr, int len, int type, int remote_hw_watchpoint_limit = -1; +int remote_hw_watchpoint_length_limit = -1; int remote_hw_breakpoint_limit = -1; static int +remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +{ + if (remote_hw_watchpoint_length_limit == 0) + return 0; + else if (remote_hw_watchpoint_length_limit < 0) + return 1; + else if (len <= remote_hw_watchpoint_length_limit) + return 1; + else + return 0; +} + +static int remote_check_watch_resources (int type, int cnt, int ot) { if (type == bp_hardware_breakpoint) @@ -10356,6 +10370,8 @@ Specify the serial device it is connected to\n\ remote_ops.to_can_use_hw_breakpoint = remote_check_watch_resources; remote_ops.to_insert_hw_breakpoint = remote_insert_hw_breakpoint; remote_ops.to_remove_hw_breakpoint = remote_remove_hw_breakpoint; + remote_ops.to_region_ok_for_hw_watchpoint + = remote_region_ok_for_hw_watchpoint; remote_ops.to_insert_watchpoint = remote_insert_watchpoint; remote_ops.to_remove_watchpoint = remote_remove_watchpoint; remote_ops.to_kill = remote_kill; @@ -10751,6 +10767,15 @@ Specify a negative limit for unlimited."), number of target hardware watchpoints is %s. */ &remote_set_cmdlist, &remote_show_cmdlist); + add_setshow_zinteger_cmd ("hardware-watchpoint-length-limit", no_class, + &remote_hw_watchpoint_length_limit, _("\ +Set the maximum length (in bytes) of a target hardware watchpoint."), _("\ +Show the maximum length (in bytes) of a target hardware watchpoint."), _("\ +Specify a negative limit for unlimited."), + NULL, NULL, /* FIXME: i18n: The maximum + length (in bytes) of a target + hardware watchpoint is %s. */ + &remote_set_cmdlist, &remote_show_cmdlist); add_setshow_zinteger_cmd ("hardware-breakpoint-limit", no_class, &remote_hw_breakpoint_limit, _("\ Set the maximum number of target hardware breakpoints."), _("\ |