Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* ping: Re: PATCH : allow to set length of hw watchpoints (e.g. for Valgrind gdbserver)
@ 2011-05-21 22:20 Philippe Waroquiers
  2011-05-26 19:02 ` Tom Tromey
  2011-05-27  3:25 ` ping: Re: PATCH : allow to set length of hw watchpoints (e.g. for Valgrind gdbserver) Yao Qi
  0 siblings, 2 replies; 32+ messages in thread
From: Philippe Waroquiers @ 2011-05-21 22:20 UTC (permalink / raw)
  To: gdb-patches; +Cc: Philippe Waroquiers

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

 
>> These are fine, but please leave 2 spaces between sentences in the
>> NEWS entry.
> I assume there will be some other comments (maybe related to ssize_t).
> I will update NEWS together with handling the other comments.

There was no other comments, so attached a new version of the patch,
only difference is 2 spaces in sentences in NEWS entry.

Thanks

Philippe

[-- Attachment #2: set-length-limit-4.txt --]
[-- Type: text/plain, Size: 4824 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	21 May 2011 19:48:36 -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.446
diff -c -p -r1.446 remote.c
*** gdb/remote.c	12 May 2011 12:09:16 -0000	1.446
--- gdb/remote.c	21 May 2011 19:48:42 -0000
*************** remote_remove_watchpoint (CORE_ADDR addr
*** 7756,7764 ****
--- 7756,7778 ----
  
  
  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
*** 10326,10331 ****
--- 10340,10347 ----
    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."
*** 10735,10740 ****
--- 10751,10765 ----
  					   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.838
diff -c -p -r1.838 gdb.texinfo
*** gdb/doc/gdb.texinfo	13 May 2011 22:36:07 -0000	1.838
--- gdb/doc/gdb.texinfo	21 May 2011 19:49:12 -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] 32+ messages in thread

end of thread, other threads:[~2011-07-27  1:29 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-21 22:20 ping: Re: PATCH : allow to set length of hw watchpoints (e.g. for Valgrind gdbserver) Philippe Waroquiers
2011-05-26 19:02 ` Tom Tromey
2011-05-29 13:01   ` Philippe Waroquiers
2011-05-30 15:26     ` Joel Brobecker
2011-05-31 19:07     ` x86 watchpoints bug (Re: ping: Re: PATCH : allow to set length of hw watchpoints (e.g. for Valgrind gdbserver)) Pedro Alves
2011-05-31 20:25       ` Philippe Waroquiers
2011-05-31 20:53         ` Pedro Alves
2011-05-31 21:29       ` Pedro Alves
2011-05-31 22:15         ` Philippe Waroquiers
2011-05-31 23:04           ` Pedro Alves
2011-06-01 14:35             ` Pedro Alves
2011-06-08 22:55               ` Philippe Waroquiers
2011-06-09  0:00                 ` Pedro Alves
2011-06-09 22:16                   ` Philippe Waroquiers
2011-07-21 17:20                     ` Pedro Alves
2011-07-22 16:40                       ` Philippe Waroquiers
2011-07-22 16:43                         ` Pedro Alves
2011-07-23 16:28                           ` Thiago Jung Bauermann
2011-07-26 20:02                             ` software watchpoints bug (was: Re: x86 watchpoints bug) Pedro Alves
2011-07-27  3:45                               ` Thiago Jung Bauermann
2011-07-22 17:19                         ` x86 watchpoints bug (Re: ping: Re: PATCH : allow to set length of hw watchpoints (e.g. for Valgrind gdbserver)) Pedro Alves
2011-05-27  3:25 ` ping: Re: PATCH : allow to set length of hw watchpoints (e.g. for Valgrind gdbserver) Yao Qi
2011-05-27 17:53   ` Tom Tromey
2011-05-27 17:59     ` Pedro Alves
2011-05-30  4:06       ` Yao Qi
2011-05-30  5:34         ` Philippe Waroquiers
2011-05-30  5:48           ` Yao Qi
2011-05-30  6:31             ` Philippe Waroquiers
2011-05-31 17:31         ` Pedro Alves
2011-05-31 18:06           ` Philippe Waroquiers
2011-06-01 15:15             ` Pedro Alves
2011-06-05 20:55               ` Philippe Waroquiers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox