This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch, rfa:doco] Add set/show remote hardware-breakpoint/watchpoint-limit


Hello,

This follows up a number of previous posts. It adds the commands:

	set remote hardware-breakpoint-limit
	set remote hardware-watchpoint-limit
	show remote hardware-breakpoint-limit
	show remote hardware-watchpoint-limit

A limit of -1 is infinite, zero is zero. It also uses the i18n friendly add_setshow_cmd().

Eli, how is the doco?

Andrew
2003-02-19  Andrew Cagney  <ac131313 at redhat dot com>

	* remote.c (_initialize_remote): Add commands "set/show remote
	hardware-watchpoint-limit" and "set/show remote
	hardware-breakpoint-limit".
	(remote_hw_watchpoint_limit): Initialize to -1.
	(remote_hw_breakpoint_limit): Ditto.
	(remote_check_watch_resources): Treat a limit of -1 as unlimited.

Index: doc/ChangeLog
2003-02-19  Andrew Cagney  <ac131313 at redhat dot com>

	* gdb.texinfo (Set Breaks): Add cross reference to "set remote
	hardware-breakpoint-limit".
	(Set Watchpoints): Add cross reference to "set remote
	hardware-watchpoint-limit".
	(Remote configuration options): New section.

Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.94
diff -u -r1.94 remote.c
--- remote.c	14 Nov 2002 00:25:03 -0000	1.94
+++ remote.c	20 Feb 2003 03:47:47 -0000
@@ -4839,8 +4839,8 @@
 }
 
 
-int remote_hw_watchpoint_limit = 0;
-int remote_hw_breakpoint_limit = 0;
+int remote_hw_watchpoint_limit = -1;
+int remote_hw_breakpoint_limit = -1;
 
 int
 remote_check_watch_resources (int type, int cnt, int ot)
@@ -4849,6 +4849,8 @@
     {
       if (remote_hw_breakpoint_limit == 0)
 	return 0;
+      else if (remote_hw_breakpoint_limit < 0)
+	return 1;
       else if (cnt <= remote_hw_breakpoint_limit)
 	return 1;
     }
@@ -4856,6 +4858,8 @@
     {
       if (remote_hw_watchpoint_limit == 0)
 	return 0;
+      else if (remote_hw_watchpoint_limit < 0)
+	return 1;
       else if (ot)
 	return -1;
       else if (cnt <= remote_hw_watchpoint_limit)
@@ -6143,6 +6147,19 @@
 	   show_memory_read_packet_size,
 	   "Show the maximum number of bytes per memory-read packet.\n",
 	   &remote_show_cmdlist);
+
+  add_setshow_cmd ("hardware-watchpoint-limit", no_class,
+		   var_zinteger, &remote_hw_watchpoint_limit, "\
+Set the maximum number of target hardware watchpoints.\n\
+Specify a negative limit for unlimited.", "\
+Show the maximum number of target hardware watchpoints.\n",
+		   NULL, NULL, &remote_set_cmdlist, &remote_show_cmdlist);
+  add_setshow_cmd ("hardware-breakpoint-limit", no_class,
+		   var_zinteger, &remote_hw_breakpoint_limit, "\
+Set the maximum number of target hardware breakpoints.\n\
+Specify a negative limit for unlimited.", "\
+Show the maximum number of target hardware breakpoints.\n",
+		   NULL, NULL, &remote_set_cmdlist, &remote_show_cmdlist);
 
   add_show_from_set
     (add_set_cmd ("remoteaddresssize", class_obscure,
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.147
diff -u -r1.147 gdb.texinfo
--- doc/gdb.texinfo	4 Feb 2003 22:52:51 -0000	1.147
+++ doc/gdb.texinfo	20 Feb 2003 03:47:49 -0000
@@ -2514,6 +2514,8 @@
 @value{GDBN} will reject this command if more than two are used.  Delete
 or disable unused hardware breakpoints before setting new ones
 (@pxref{Disabling, ,Disabling}).  @xref{Conditions, ,Break conditions}.
+ at xref{set remote hardware-breakpoint-limit}.
+
 
 @kindex thbreak
 @item thbreak @var{args}
@@ -2750,6 +2752,8 @@
 watchpoints, in contrast, watch an expression in all threads.)
 @end quotation
 
+ at xref{set remote hardware-watchpoint-limit}.
+
 @node Set Catchpoints
 @subsection Setting catchpoints
 @cindex catchpoints, setting
@@ -10352,6 +10356,7 @@
 @menu
 * Server::	                Using the gdbserver program
 * NetWare::                     Using the gdbserve.nlm program
+* Remote configuration::        Remote configuration
 * remote stub::                 Implementing a remote stub
 @end menu
 
@@ -10522,6 +10527,23 @@
 
 @noindent
 communications with the server via serial line @file{/dev/ttyb}.
+ at end table
+
+ at node Remote configuration
+ at section Remote configuration
+
+The following configuration options are available when debugging remote
+programs:
+
+ at table @code
+ at kindex set remote hardware-watchpoint-limit
+ at kindex set remote hardware-breakpoint-limit
+ at anchor{set remote hardware-watchpoint-limit}
+ at anchor{set remote hardware-breakpoint-limit}
+ at item set remote hardware-watchpoint-limit @var{limit}
+ at itemx set remote hardware-breakpoint-limit @var{limit}
+Restrict @value{GDBN} to using @var{limit} remote hardware breakpoint or
+watchpoints.  A limit of -1, the default, is treated as unlimited.
 @end table
 
 @node remote stub

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]