public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* allow to set length of hw watchpoints (e.g. for Valgrind gdbserver)
@ 2011-07-07  1:55 Philippe Waroquiers
  2011-07-19 20:13 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Waroquiers @ 2011-07-07  1:55 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 5151 bytes --]

Updated patch to a recent cvs version + undone the changes related
to fixing bug in x86/amd64 hardware registers, as Pedro Alves was doing a better fix
(see http://sourceware.org/ml/gdb-patches/2011-06/msg00002.html , not yet comitted).


For the copyright assignment: I just received today the news that the signed papers
arrived back at FSF, and will be processed tomorrow.

Thanks

Philippe

(patch included in-line below + as an attachment)



Index: gdb/NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.441
diff -c -p -r1.441 NEWS
*** gdb/NEWS 13 May 2011 22:36:06 -0000 1.441
--- gdb/NEWS 7 Jul 2011 00:36:22 -0000
***************
*** 3,8 ****
--- 3,18 ----
  
  *** Changes since GDB 7.3
  
+ * GDB has two new commands: "set remote hardware-watchpoint-length-limit"
+   and "show remote hardware-watchpoint-length-limit".  These allows to
+   set or show the maximum length limit (in bytes) of a remote
+   target hardware watchpoint.
+ 
+   This allows e.g. to use "unlimited" hardware watchpoints with the
+   gdbserver integrated in Valgrind version >= 3.7.0.  Such Valgrind
+   watchpoints are slower than real hardware watchpoints but are
+   significantly faster than gdb software watchpoints.
+ 
  * libthread-db-search-path now supports two special values: $sdir and $pdir.
    $sdir specifies the default system locations of shared libraries.
    $pdir specifies the directory where the libpthread used by the application
Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.453
diff -c -p -r1.453 remote.c
*** gdb/remote.c 6 Jul 2011 02:43:12 -0000 1.453
--- gdb/remote.c 7 Jul 2011 00:36:29 -0000
*************** remote_remove_watchpoint (CORE_ADDR addr
*** 7774,7782 ****
--- 7774,7796 ----
  
  
  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)
*************** Specify the serial device it is connecte
*** 10355,10360 ****
--- 10369,10376 ----
    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;
*************** Specify a negative limit for unlimited."
*** 10750,10755 ****
--- 10766,10780 ----
          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."), _("\
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.845
diff -c -p -r1.845 gdb.texinfo
*** gdb/doc/gdb.texinfo 5 Jul 2011 04:34:57 -0000 1.845
--- gdb/doc/gdb.texinfo 7 Jul 2011 00:36:54 -0000
*************** responses.
*** 16578,16583 ****
--- 16578,16595 ----
  Restrict @value{GDBN} to using @var{limit} remote hardware breakpoint or
  watchpoints.  A limit of -1, the default, is treated as unlimited.
  
+ @cindex limit hardware watchpoints length
+ @cindex remote target, limit watchpoints length
+ @anchor{set remote hardware-watchpoint-length-limit}
+ @item set remote hardware-watchpoint-length-limit @var{limit}
+ Restrict @value{GDBN} to using @var{limit} bytes for the maximum length of
+ a remote hardware watchpoint.  A limit of -1, the default, is treated
+ as unlimited.
+ 
+ @item show remote hardware-watchpoint-length-limit
+ Show the current limit (in bytes) of the maximum length of
+ a remote hardware watchpoint.
+ 
  @item set remote exec-file @var{filename}
  @itemx show remote exec-file
  @anchor{set remote exec-file}

[-- Attachment #2: set-length-limit-final.txt --]
[-- Type: text/plain, Size: 4819 bytes --]

Index: gdb/NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.441
diff -c -p -r1.441 NEWS
*** gdb/NEWS	13 May 2011 22:36:06 -0000	1.441
--- gdb/NEWS	7 Jul 2011 00:36:22 -0000
***************
*** 3,8 ****
--- 3,18 ----
  
  *** Changes since GDB 7.3
  
+ * GDB has two new commands: "set remote hardware-watchpoint-length-limit"
+   and "show remote hardware-watchpoint-length-limit".  These allows to
+   set or show the maximum length limit (in bytes) of a remote
+   target hardware watchpoint.
+ 
+   This allows e.g. to use "unlimited" hardware watchpoints with the
+   gdbserver integrated in Valgrind version >= 3.7.0.  Such Valgrind
+   watchpoints are slower than real hardware watchpoints but are
+   significantly faster than gdb software watchpoints.
+ 
  * libthread-db-search-path now supports two special values: $sdir and $pdir.
    $sdir specifies the default system locations of shared libraries.
    $pdir specifies the directory where the libpthread used by the application
Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.453
diff -c -p -r1.453 remote.c
*** gdb/remote.c	6 Jul 2011 02:43:12 -0000	1.453
--- gdb/remote.c	7 Jul 2011 00:36:29 -0000
*************** remote_remove_watchpoint (CORE_ADDR addr
*** 7774,7782 ****
--- 7774,7796 ----
  
  
  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)
*************** Specify the serial device it is connecte
*** 10355,10360 ****
--- 10369,10376 ----
    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;
*************** Specify a negative limit for unlimited."
*** 10750,10755 ****
--- 10766,10780 ----
  					   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."), _("\
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.845
diff -c -p -r1.845 gdb.texinfo
*** gdb/doc/gdb.texinfo	5 Jul 2011 04:34:57 -0000	1.845
--- gdb/doc/gdb.texinfo	7 Jul 2011 00:36:54 -0000
*************** responses.
*** 16578,16583 ****
--- 16578,16595 ----
  Restrict @value{GDBN} to using @var{limit} remote hardware breakpoint or
  watchpoints.  A limit of -1, the default, is treated as unlimited.
  
+ @cindex limit hardware watchpoints length
+ @cindex remote target, limit watchpoints length
+ @anchor{set remote hardware-watchpoint-length-limit}
+ @item set remote hardware-watchpoint-length-limit @var{limit}
+ Restrict @value{GDBN} to using @var{limit} bytes for the maximum length of
+ a remote hardware watchpoint.  A limit of -1, the default, is treated
+ as unlimited.
+ 
+ @item show remote hardware-watchpoint-length-limit
+ Show the current limit (in bytes) of the maximum length of
+ a remote hardware watchpoint.
+ 
  @item set remote exec-file @var{filename}
  @itemx show remote exec-file
  @anchor{set remote exec-file}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: allow to set length of hw watchpoints (e.g. for Valgrind gdbserver)
  2011-07-07  1:55 allow to set length of hw watchpoints (e.g. for Valgrind gdbserver) Philippe Waroquiers
@ 2011-07-19 20:13 ` Tom Tromey
  2011-07-20  2:05   ` Philippe Waroquiers
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2011-07-19 20:13 UTC (permalink / raw)
  To: Philippe Waroquiers; +Cc: gdb-patches

>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:

Philippe> Updated patch to a recent cvs version + undone the changes
Philippe> related to fixing bug in x86/amd64 hardware registers, as
Philippe> Pedro Alves was doing a better fix (see
Philippe> http://sourceware.org/ml/gdb-patches/2011-06/msg00002.html ,
Philippe> not yet comitted).

Thanks for doing this.

Philippe> For the copyright assignment: I just received today the news
Philippe> that the signed papers arrived back at FSF, and will be
Philippe> processed tomorrow.

The code bits are ok; the docs have to be reviewed separately.

BTW, your mailer mangled the patch.

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: allow to set length of hw watchpoints (e.g. for Valgrind gdbserver)
  2011-07-19 20:13 ` Tom Tromey
@ 2011-07-20  2:05   ` Philippe Waroquiers
  2011-07-20 13:59     ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Waroquiers @ 2011-07-20  2:05 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> The code bits are ok; the docs have to be reviewed separately.
The documentation was reviewed by Eli Zaretskii
see  http://sourceware.org/ml/gdb-patches/2011-05/msg00505.html

> BTW, your mailer mangled the patch.
A file was also attached to http://sourceware.org/ml/gdb-patches/2011-07/msg00223.html
If this file is not ok; tell me.

Thanks

Philippe

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: allow to set length of hw watchpoints (e.g. for Valgrind gdbserver)
  2011-07-20  2:05   ` Philippe Waroquiers
@ 2011-07-20 13:59     ` Tom Tromey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2011-07-20 13:59 UTC (permalink / raw)
  To: Philippe Waroquiers; +Cc: gdb-patches

>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:

>> The code bits are ok; the docs have to be reviewed separately.
Philippe> The documentation was reviewed by Eli Zaretskii
Philippe> see  http://sourceware.org/ml/gdb-patches/2011-05/msg00505.html

Great, then you are good to go.

Do you have a sourceware account set up?
If not, contact me.

>> BTW, your mailer mangled the patch.
Philippe> A file was also attached to
Philippe> http://sourceware.org/ml/gdb-patches/2011-07/msg00223.html
Philippe> If this file is not ok; tell me.

Maybe there is also some issue with my mailer; because here the
attachment also looked mangled, but it looks ok on the web site.

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-20 13:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-07  1:55 allow to set length of hw watchpoints (e.g. for Valgrind gdbserver) Philippe Waroquiers
2011-07-19 20:13 ` Tom Tromey
2011-07-20  2:05   ` Philippe Waroquiers
2011-07-20 13:59     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).