aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2018-07-02 22:28:22 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2018-07-09 18:07:01 +0100
commit055303e28f70880f7b2c3e44df0ba7646fc85cf8 (patch)
treee20d45709411b0a546e6a53a1a77f699b3d7ae95 /gdb/remote.c
parent2af4d0d938d76e96ccb862a23d05862154262de9 (diff)
downloadgdb-055303e28f70880f7b2c3e44df0ba7646fc85cf8.zip
gdb-055303e28f70880f7b2c3e44df0ba7646fc85cf8.tar.gz
gdb-055303e28f70880f7b2c3e44df0ba7646fc85cf8.tar.bz2
gdb: Use add_setshow_zuinteger_unlimited_cmd in remote.c
Switch to use add_setshow_zuinteger_unlimited_cmd for some of the control variables in remote.c. The variables hardware-watchpoint-limit, hardware-breakpoint-limit, and hardware-watchpoint-length-limit are all changed. For example, a user will now see this: (gdb) show remote hardware-breakpoint-limit The maximum number of target hardware breakpoints is unlimited. Instead of this: (gdb) show remote hardware-breakpoint-limit The maximum number of target hardware breakpoints is -1. And can do this: (gdb) set remote hardware-breakpoint-limit unlimited However, previously any negative value implied "unlimited", now only -1, or the text "unlimited" can be used for unlimited. Any other negative value will give an error about invalid input. This is a small change in the user interface, but, hopefully, this will not cause too many problems. I've also added show functions for these three variables to allow for internationalisation. gdb/ChangeLog: * remote.c (show_hardware_watchpoint_limit): New function. (show_hardware_watchpoint_length_limit): New function. (show_hardware_breakpoint_limit): New function. (_initialize_remote): Use add_setshow_zuinteger_unlimited_cmd where appropriate, update help text. gdb/doc/ChangeLog: * gdb.texinfo (Remote Configuration): Update descriptions for set/show of hardware-watchpoint-limit, hardware-breakpoint-limit, and hardware-watchpoint-length-limit variables.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c61
1 files changed, 45 insertions, 16 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index d5accc6..297c198 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1728,6 +1728,39 @@ show_memory_write_packet_size (const char *args, int from_tty)
show_memory_packet_size (&memory_write_packet_config);
}
+/* Show the number of hardware watchpoints that can be used. */
+
+static void
+show_hardware_watchpoint_limit (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+ fprintf_filtered (file, _("The maximum number of target hardware "
+ "watchpoints is %s.\n"), value);
+}
+
+/* Show the length limit (in bytes) for hardware watchpoints. */
+
+static void
+show_hardware_watchpoint_length_limit (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+ fprintf_filtered (file, _("The maximum length (in bytes) of a target "
+ "hardware watchpoint is %s.\n"), value);
+}
+
+/* Show the number of hardware breakpoints that can be used. */
+
+static void
+show_hardware_breakpoint_limit (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+ fprintf_filtered (file, _("The maximum number of target hardware "
+ "breakpoints is %s.\n"), value);
+}
+
long
remote_target::get_memory_write_packet_size ()
{
@@ -14347,32 +14380,28 @@ further restriction and ``limit'' to enable that restriction."),
_("Show the maximum number of bytes per memory-read packet."),
&remote_show_cmdlist);
- add_setshow_zinteger_cmd ("hardware-watchpoint-limit", no_class,
+ add_setshow_zuinteger_unlimited_cmd ("hardware-watchpoint-limit", no_class,
&remote_hw_watchpoint_limit, _("\
Set the maximum number of target hardware watchpoints."), _("\
Show the maximum number of target hardware watchpoints."), _("\
-Specify a negative limit for unlimited."),
- NULL, NULL, /* FIXME: i18n: The maximum
- number of target hardware
- watchpoints is %s. */
- &remote_set_cmdlist, &remote_show_cmdlist);
- add_setshow_zinteger_cmd ("hardware-watchpoint-length-limit", no_class,
+Specify \"unlimited\" for unlimited hardware watchpoints."),
+ NULL, show_hardware_watchpoint_limit,
+ &remote_set_cmdlist,
+ &remote_show_cmdlist);
+ add_setshow_zuinteger_unlimited_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. */
+Specify \"unlimited\" to allow watchpoints of unlimited size."),
+ NULL, show_hardware_watchpoint_length_limit,
&remote_set_cmdlist, &remote_show_cmdlist);
- add_setshow_zinteger_cmd ("hardware-breakpoint-limit", no_class,
+ add_setshow_zuinteger_unlimited_cmd ("hardware-breakpoint-limit", no_class,
&remote_hw_breakpoint_limit, _("\
Set the maximum number of target hardware breakpoints."), _("\
Show the maximum number of target hardware breakpoints."), _("\
-Specify a negative limit for unlimited."),
- NULL, NULL, /* FIXME: i18n: The maximum
- number of target hardware
- breakpoints is %s. */
+Specify \"unlimited\" for unlimited hardware breakpoints."),
+ NULL, show_hardware_breakpoint_limit,
&remote_set_cmdlist, &remote_show_cmdlist);
add_setshow_zuinteger_cmd ("remoteaddresssize", class_obscure,