* PR10179, Add support to set a breakpoint at every function in a file
@ 2010-04-20 19:21 Chris Moller
2010-04-20 19:23 ` Michael Snyder
2010-04-20 19:44 ` Tom Tromey
0 siblings, 2 replies; 12+ messages in thread
From: Chris Moller @ 2010-04-20 19:21 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 202 bytes --]
Allows the argument to rbreak to specify a file to which to limit the
regex search for function names. This allows, e.g.,
rbr file.c : .*
which sets bps in every function in the specified file.
[-- Attachment #2: pr10179.patch --]
[-- Type: text/x-patch, Size: 5800 bytes --]
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.11638
diff -u -r1.11638 ChangeLog
--- ChangeLog 19 Apr 2010 17:06:08 -0000 1.11638
+++ ChangeLog 20 Apr 2010 19:14:05 -0000
@@ -1,3 +1,13 @@
+2010-04-20 Chris Moller <cmoller@redhat.com>
+
+ PR filename-filtered rbreak/10179
+
+ * symtab.c (rbreak_command): Added code to detect a filename
+ specification in conjunction with the function specification (in
+ the form of "filename : regex", checking to make sure that the
+ colon isn't part of a qualified function name). If the filename
+ is discovered, it's passed to search_symbols.
+
2010-04-19 Pedro Alves <pedro@codesourcery.com>
* ada-lang.c (print_recreate_exception)
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.231
diff -u -r1.231 symtab.c
--- symtab.c 9 Apr 2010 15:31:41 -0000 1.231
+++ symtab.c 20 Apr 2010 19:14:09 -0000
@@ -3248,8 +3248,30 @@
struct cleanup *old_chain;
char *string = NULL;
int len = 0;
+ char **files = NULL;
+ int nfiles = 0;
- search_symbols (regexp, FUNCTIONS_DOMAIN, 0, (char **) NULL, &ss);
+ if (regexp)
+ {
+ char * colon = strchr (regexp, ':');
+ if (colon && *(colon + 1) != ':')
+ {
+ int ix;
+ char * ta;
+
+ ix = colon - regexp;
+ ta = alloca (ix + 1);
+ memcpy (ta, regexp, ix);
+ ta[ix--] = 0;
+ while (isspace (ta[ix])) { ta[ix--] = 0; }
+ files = &ta;
+ nfiles = 1;
+ regexp = colon + 1;
+ while (isspace (*regexp)) { regexp++; }
+ }
+ }
+
+ search_symbols (regexp, FUNCTIONS_DOMAIN, nfiles, files, &ss);
old_chain = make_cleanup_free_search_symbols (ss);
make_cleanup (free_current_contents, &string);
Index: testsuite/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v
retrieving revision 1.2237
diff -u -r1.2237 ChangeLog
--- testsuite/ChangeLog 19 Apr 2010 03:13:06 -0000 1.2237
+++ testsuite/ChangeLog 20 Apr 2010 19:14:25 -0000
@@ -1,3 +1,12 @@
+2010-04-20 Chris Moller <cmoller@redhat.com>
+
+ PR filename-filtered rbreak/10179
+
+ * gdb.base/Makefile.in (EXECUTABLES): Added pr10179.
+ * gdb.base/pr10179-a.c:
+ * gdb.base/pr10179-b.c:
+ * gdb.base/pr10179.exp: New files.
+
2010-04-19 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/solib-display.exp: Replace gdb_exit, gdb_start,
Index: testsuite/gdb.base/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/Makefile.in,v
retrieving revision 1.5
diff -u -r1.5 Makefile.in
--- testsuite/gdb.base/Makefile.in 15 Sep 2009 03:30:08 -0000 1.5
+++ testsuite/gdb.base/Makefile.in 20 Apr 2010 19:14:26 -0000
@@ -12,7 +12,8 @@
scope section_command setshow setvar shmain sigall signals \
solib solib_sl so-impl-ld so-indr-cl \
step-line step-test structs structs2 \
- twice-tmp varargs vforked-prog watchpoint whatis catch-syscall
+ twice-tmp varargs vforked-prog watchpoint whatis catch-syscall \
+ pr10179
MISCELLANEOUS = coremmap.data ../foobar.baz \
shr1.sl shr2.sl solib_sl.sl solib1.sl solib2.sl
Index: testsuite/gdb.base/pr10179-a.c
===================================================================
RCS file: testsuite/gdb.base/pr10179-a.c
diff -N testsuite/gdb.base/pr10179-a.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.base/pr10179-a.c 20 Apr 2010 19:14:26 -0000
@@ -0,0 +1,17 @@
+#include <stdio.h>
+
+extern int foo2();
+
+int
+foo1()
+{
+}
+
+int
+bar1()
+{
+}
+
+main()
+{
+}
Index: testsuite/gdb.base/pr10179-b.c
===================================================================
RCS file: testsuite/gdb.base/pr10179-b.c
diff -N testsuite/gdb.base/pr10179-b.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.base/pr10179-b.c 20 Apr 2010 19:14:26 -0000
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+int
+foo2()
+{
+}
Index: testsuite/gdb.base/pr10179.exp
===================================================================
RCS file: testsuite/gdb.base/pr10179.exp
diff -N testsuite/gdb.base/pr10179.exp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.base/pr10179.exp 20 Apr 2010 19:14:26 -0000
@@ -0,0 +1,38 @@
+# Copyright 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set testname pr10179
+set sources "pr10179-a.c pr10179-b.c"
+
+if {[build_executable ${testname}.exp $testname $sources {debug}] == -1} {
+ return -1
+}
+
+clean_restart ${testname}
+
+if ![runto_main] {
+ untested pr10179
+ return -1
+}
+
+gdb_test "rbreak foo.*" "Breakpoint \[0-9\]+\[^\\n\]*\\nint foo\[12\]\[^\\n\]*\\nBreakpoint \[0-9\]+\[^\\n\]*\\nint foo\[12\].*"
+
+gdb_test "delete breakpoints" ".*" "" "Delete all breakpoints.*" "y"
+
+gdb_test "rbreak pr10179-a.c:foo.*" "Breakpoint \[0-9\]+\[^\\n\]*\\nint foo.*"
+
+gdb_test "delete breakpoints" ".*" "" "Delete all breakpoints.*" "y"
+
+gdb_test "rbreak pr10179-a.c : .*" "Breakpoint \[0-9\]+\[^\\n\]*\\nint bar1\[^\\n\]*\\nBreakpoint \[0-9\]+\[^\\n\]*\\nint foo1\[^\\n\]*\\nBreakpoint \[0-9\]+\[^\\n\]*\\nint main\[^\\n\]*.*"
[-- Attachment #3: pr10179-dum.diff --]
[-- Type: text/x-patch, Size: 1502 bytes --]
--- virgin.sum 2010-04-20 07:57:00.781326349 -0400
+++ patched.sum 2010-04-20 14:58:34.042326421 -0400
@@ -1,4 +1,4 @@
-Test Run By moller on Tue Apr 20 07:47:19 2010
+Test Run By moller on Tue Apr 20 13:49:38 2010
Native configuration is i686-pc-linux-gnu
=== gdb tests ===
@@ -5982,6 +5982,10 @@
PASS: gdb.base/pointers.exp: ptype pppppC
PASS: gdb.base/pointers.exp: ptype ppppppC
PASS: gdb.base/pointers.exp: p instance.array_variable + 0
+Running ../../../src/gdb/testsuite/gdb.base/pr10179.exp ...
+PASS: gdb.base/pr10179.exp: rbreak foo.*
+PASS: gdb.base/pr10179.exp: rbreak pr10179-a.c:foo.*
+PASS: gdb.base/pr10179.exp: rbreak pr10179-a.c : .*
Running ../../../src/gdb/testsuite/gdb.base/pr11022.exp ...
PASS: gdb.base/pr11022.exp: set breakpoint
PASS: gdb.base/pr11022.exp: set watchpoint
@@ -16452,7 +16456,7 @@
PASS: gdb.threads/watchthreads.exp: successfully compiled posix threads test case
PASS: gdb.threads/watchthreads.exp: watch args[0]
PASS: gdb.threads/watchthreads.exp: watch args[1]
-PASS: gdb.threads/watchthreads.exp: disable 3
+PASS: gdb.threads/watchthreads.exp: disable 2
PASS: gdb.threads/watchthreads.exp: threaded watch loop
PASS: gdb.threads/watchthreads.exp: first watchpoint on args[0] hit
PASS: gdb.threads/watchthreads.exp: first watchpoint on args[1] hit
@@ -16733,7 +16737,7 @@
=== gdb Summary ===
-# of expected passes 15909
+# of expected passes 15912
# of unexpected failures 19
# of expected failures 44
# of untested testcases 4
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: PR10179, Add support to set a breakpoint at every function in a file 2010-04-20 19:21 PR10179, Add support to set a breakpoint at every function in a file Chris Moller @ 2010-04-20 19:23 ` Michael Snyder 2010-04-20 19:25 ` Chris Moller 2010-04-20 19:44 ` Tom Tromey 1 sibling, 1 reply; 12+ messages in thread From: Michael Snyder @ 2010-04-20 19:23 UTC (permalink / raw) To: Chris Moller; +Cc: gdb-patches Chris Moller wrote: > Allows the argument to rbreak to specify a file to which to limit the > regex search for function names. This allows, e.g., > > rbr file.c : .* > > which sets bps in every function in the specified file. I like the idea very much, but I don't quite understand the extra white space? ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: PR10179, Add support to set a breakpoint at every function in a file 2010-04-20 19:23 ` Michael Snyder @ 2010-04-20 19:25 ` Chris Moller 2010-04-20 19:27 ` Michael Snyder 0 siblings, 1 reply; 12+ messages in thread From: Chris Moller @ 2010-04-20 19:25 UTC (permalink / raw) To: Michael Snyder; +Cc: gdb-patches On 04/20/10 15:23, Michael Snyder wrote: > Chris Moller wrote: >> Allows the argument to rbreak to specify a file to which to limit the >> regex search for function names. This allows, e.g., >> >> rbr file.c : .* >> >> which sets bps in every function in the specified file. > > I like the idea very much, but I don't quite understand > the extra white space? > > The whitespace is optional, included just for clarity. All the WS is stripped from both the filename and the regex before they're passed to the search. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: PR10179, Add support to set a breakpoint at every function in a file 2010-04-20 19:25 ` Chris Moller @ 2010-04-20 19:27 ` Michael Snyder 2010-04-20 19:30 ` Chris Moller 0 siblings, 1 reply; 12+ messages in thread From: Michael Snyder @ 2010-04-20 19:27 UTC (permalink / raw) To: Chris Moller; +Cc: gdb-patches Chris Moller wrote: > On 04/20/10 15:23, Michael Snyder wrote: >> Chris Moller wrote: >>> Allows the argument to rbreak to specify a file to which to limit the >>> regex search for function names. This allows, e.g., >>> >>> rbr file.c : .* >>> >>> which sets bps in every function in the specified file. >> I like the idea very much, but I don't quite understand >> the extra white space? >> >> > > The whitespace is optional, included just for clarity. All the WS is > stripped from both the filename and the regex before they're passed to > the search. Thanks. Worth a doco mention? ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: PR10179, Add support to set a breakpoint at every function in a file 2010-04-20 19:27 ` Michael Snyder @ 2010-04-20 19:30 ` Chris Moller 2010-04-20 19:35 ` Michael Snyder 0 siblings, 1 reply; 12+ messages in thread From: Chris Moller @ 2010-04-20 19:30 UTC (permalink / raw) To: gdb-patches On 04/20/10 15:27, Michael Snyder wrote: > Chris Moller wrote: >> On 04/20/10 15:23, Michael Snyder wrote: >>> Chris Moller wrote: >>>> Allows the argument to rbreak to specify a file to which to limit >>>> the regex search for function names. This allows, e.g., >>>> >>>> rbr file.c : .* >>>> >>>> which sets bps in every function in the specified file. >>> I like the idea very much, but I don't quite understand >>> the extra white space? >>> >>> >> >> The whitespace is optional, included just for clarity. All the WS is >> stripped from both the filename and the regex before they're passed >> to the search. > > Thanks. > > Worth a doco mention? Sure, if that's what folks want, I'll add some words to gdb.texinfo and refcard.tex ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: PR10179, Add support to set a breakpoint at every function in a file 2010-04-20 19:30 ` Chris Moller @ 2010-04-20 19:35 ` Michael Snyder 0 siblings, 0 replies; 12+ messages in thread From: Michael Snyder @ 2010-04-20 19:35 UTC (permalink / raw) To: Chris Moller; +Cc: gdb-patches Chris Moller wrote: > On 04/20/10 15:27, Michael Snyder wrote: >> Chris Moller wrote: >>> On 04/20/10 15:23, Michael Snyder wrote: >>>> Chris Moller wrote: >>>>> Allows the argument to rbreak to specify a file to which to limit >>>>> the regex search for function names. This allows, e.g., >>>>> >>>>> rbr file.c : .* >>>>> >>>>> which sets bps in every function in the specified file. >>>> I like the idea very much, but I don't quite understand >>>> the extra white space? >>>> >>>> >>> The whitespace is optional, included just for clarity. All the WS is >>> stripped from both the filename and the regex before they're passed >>> to the search. >> Thanks. >> >> Worth a doco mention? > > Sure, if that's what folks want, I'll add some words to gdb.texinfo and > refcard.tex As far as the code goes, I don't think we allow single-line blocks, and I personally don't care much for such short variable names that don't convey much about what they are for... ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: PR10179, Add support to set a breakpoint at every function in a file 2010-04-20 19:21 PR10179, Add support to set a breakpoint at every function in a file Chris Moller 2010-04-20 19:23 ` Michael Snyder @ 2010-04-20 19:44 ` Tom Tromey 2010-04-21 2:56 ` Chris Moller 1 sibling, 1 reply; 12+ messages in thread From: Tom Tromey @ 2010-04-20 19:44 UTC (permalink / raw) To: Chris Moller; +Cc: gdb-patches >>>>> "Chris" == Chris Moller <cmoller@redhat.com> writes: Chris> +2010-04-20 Chris Moller <cmoller@redhat.com> Chris> + PR filename-filtered rbreak/10179 This particular syntax probably won't have the desired effect. The commit script only recognizes a few specific formats. It should be just "PR category/NNNN", like "PR breakpoints/10179". Chris> + * symtab.c (rbreak_command): Added code to detect a filename Chris> + specification in conjunction with the function specification (in Chris> + the form of "filename : regex", checking to make sure that the Chris> + colon isn't part of a qualified function name). If the filename Chris> + is discovered, it's passed to search_symbols. The description is too long. It should only describe what is changing. Any further details belong in the code. Chris> + char * colon = strchr (regexp, ':'); Extra space after "*". Chris> + int ix; Chris> + char * ta; I agree with Michael about the names. Chris> + while (isspace (ta[ix])) { ta[ix--] = 0; } As Michael, this isn't our style. This requires a documentation and NEWS patch. Tom ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: PR10179, Add support to set a breakpoint at every function in a file 2010-04-20 19:44 ` Tom Tromey @ 2010-04-21 2:56 ` Chris Moller 2010-04-21 21:24 ` Michael Snyder ` (2 more replies) 0 siblings, 3 replies; 12+ messages in thread From: Chris Moller @ 2010-04-21 2:56 UTC (permalink / raw) To: tromey; +Cc: gdb-patches [-- Attachment #1: Type: text/plain, Size: 1403 bytes --] I don't recall that I've ever ever updated any of the doc files before, so, in case anyone wants to look at them, I've attached a new patch that include doc updates. On 04/20/10 15:44, Tom Tromey wrote: >>>>>> "Chris" == Chris Moller<cmoller@redhat.com> writes: >>>>>> > > Chris> +2010-04-20 Chris Moller<cmoller@redhat.com> > Chris> + PR filename-filtered rbreak/10179 > > This particular syntax probably won't have the desired effect. > The commit script only recognizes a few specific formats. > It should be just "PR category/NNNN", like "PR breakpoints/10179". > > Chris> + * symtab.c (rbreak_command): Added code to detect a filename > Chris> + specification in conjunction with the function specification (in > Chris> + the form of "filename : regex", checking to make sure that the > Chris> + colon isn't part of a qualified function name). If the filename > Chris> + is discovered, it's passed to search_symbols. > > The description is too long. It should only describe what is changing. > Any further details belong in the code. > > Chris> + char * colon = strchr (regexp, ':'); > > Extra space after "*". > > Chris> + int ix; > Chris> + char * ta; > > I agree with Michael about the names. > > Chris> + while (isspace (ta[ix])) { ta[ix--] = 0; } > > As Michael, this isn't our style. > > This requires a documentation and NEWS patch. > > Tom > [-- Attachment #2: pr10179r2.patch --] [-- Type: text/x-patch, Size: 9078 bytes --] ? doc/gdb.aux ? doc/gdb.log ? testsuite/gdb.base/pr10179 Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.11638 diff -u -r1.11638 ChangeLog --- ChangeLog 19 Apr 2010 17:06:08 -0000 1.11638 +++ ChangeLog 21 Apr 2010 02:52:30 -0000 @@ -1,3 +1,11 @@ +2010-04-20 Chris Moller <cmoller@redhat.com> + + PR 10179 + + * symtab.c (rbreak_command): Added code to include a filename + specification in the rbreak argument. + * NEWS: Added a brief description of filename-qualified rbreak. + 2010-04-19 Pedro Alves <pedro@codesourcery.com> * ada-lang.c (print_recreate_exception) Index: NEWS =================================================================== RCS file: /cvs/src/src/gdb/NEWS,v retrieving revision 1.373 diff -u -r1.373 NEWS --- NEWS 19 Apr 2010 00:48:43 -0000 1.373 +++ NEWS 21 Apr 2010 02:52:34 -0000 @@ -47,6 +47,10 @@ single `break' command creates multiple breakpoints (e.g., breakpoints on overloaded c++ functions). +* The `rbreak' command now accepts a filename specification as part of + its argument, limiting the functions selected by the regex to those + in the specified file. + * New commands save breakpoints <filename> Index: symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.231 diff -u -r1.231 symtab.c --- symtab.c 9 Apr 2010 15:31:41 -0000 1.231 +++ symtab.c 21 Apr 2010 02:52:37 -0000 @@ -3248,8 +3248,31 @@ struct cleanup *old_chain; char *string = NULL; int len = 0; + char **files = NULL; + int nfiles = 0; - search_symbols (regexp, FUNCTIONS_DOMAIN, 0, (char **) NULL, &ss); + if (regexp) + { + char *colon = strchr (regexp, ':'); + if (colon && *(colon + 1) != ':') + { + int colon_index; + char * file_name; + + colon_index = colon - regexp; + file_name = alloca (colon_index + 1); + memcpy (file_name, regexp, colon_index); + file_name[colon_index--] = 0; + while (isspace (file_name[colon_index])) + file_name[colon_index--] = 0; + files = &file_name; + nfiles = 1; + regexp = colon + 1; + while (isspace (*regexp)) regexp++; + } + } + + search_symbols (regexp, FUNCTIONS_DOMAIN, nfiles, files, &ss); old_chain = make_cleanup_free_search_symbols (ss); make_cleanup (free_current_contents, &string); Index: doc/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/doc/ChangeLog,v retrieving revision 1.1051 diff -u -r1.1051 ChangeLog --- doc/ChangeLog 19 Apr 2010 01:08:25 -0000 1.1051 +++ doc/ChangeLog 21 Apr 2010 02:52:43 -0000 @@ -1,3 +1,10 @@ +2010-04-20 Chris Moller <cmoller@redhat.com> + + * gdb.texinfo (Setting Breakpoints): Added description of + filename-qualified rbreak. + * refcard.tex (Breakpoints and Watchpoints): Added brief + description of ilename-qualified rbreak. + 2010-04-19 Pedro Alves <pedro@codesourcery.com> PR breakpoints/8554. Index: doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.708 diff -u -r1.708 gdb.texinfo --- doc/gdb.texinfo 19 Apr 2010 00:48:44 -0000 1.708 +++ doc/gdb.texinfo 21 Apr 2010 02:53:10 -0000 @@ -3355,7 +3355,7 @@ @kindex rbreak @cindex regular expression -@cindex breakpoints in functions matching a regexp +@cindex breakpoints at functions matching a regexp @cindex set breakpoints in many functions @item rbreak @var{regex} Set breakpoints on all functions matching the regular expression @@ -3385,6 +3385,19 @@ (@value{GDBP}) rbreak . @end smallexample +@item rbreak @var{filename:regex} +If @code{rbreak} is called with a filename qualification, it limits +the search for functions matching the given regular expression to the +specified file. This can be used, for example, to set breakponts on +every function in a given file: + +@smallexample +(@value{GDBP}) rbreak file.c:. +@end smallexample + +The colon separating the filename qualifier from the regex may +optionally be surrounded by spaces. + @kindex info breakpoints @cindex @code{$_} and @code{info breakpoints} @item info breakpoints @r{[}@var{n}@r{]} Index: doc/refcard.tex =================================================================== RCS file: /cvs/src/src/gdb/doc/refcard.tex,v retrieving revision 1.7 diff -u -r1.7 refcard.tex --- doc/refcard.tex 1 Jan 2010 11:20:05 -0000 1.7 +++ doc/refcard.tex 21 Apr 2010 02:53:11 -0000 @@ -325,7 +325,8 @@ cond {\it n} \opt{\it expr}&new conditional expression on breakpoint {\it n}; make unconditional if no {\it expr}\cr tbreak $\ldots$&temporary break; disable when reached\cr -rbreak {\it regex}&break on all functions matching {\it regex}\cr +rbreak \opt{\it file\tt:}{\it regex}&break on all functions matching {\it +regex} \opt{in \it file}\cr watch {\it expr}&set a watchpoint for expression {\it expr}\cr catch {\it event}&break at {\it event}, which may be {\tt catch}, {\tt throw}, {\tt exec}, {\tt fork}, {\tt vfork}, {\tt load}, or {\tt unload}.\cr Index: testsuite/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v retrieving revision 1.2237 diff -u -r1.2237 ChangeLog --- testsuite/ChangeLog 19 Apr 2010 03:13:06 -0000 1.2237 +++ testsuite/ChangeLog 21 Apr 2010 02:53:27 -0000 @@ -1,3 +1,12 @@ +2010-04-20 Chris Moller <cmoller@redhat.com> + + PR 10179 + + * gdb.base/Makefile.in (EXECUTABLES): Added pr10179. + * gdb.base/pr10179-a.c: + * gdb.base/pr10179-b.c: + * gdb.base/pr10179.exp: New files. + 2010-04-19 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.base/solib-display.exp: Replace gdb_exit, gdb_start, Index: testsuite/gdb.base/Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/Makefile.in,v retrieving revision 1.5 diff -u -r1.5 Makefile.in --- testsuite/gdb.base/Makefile.in 15 Sep 2009 03:30:08 -0000 1.5 +++ testsuite/gdb.base/Makefile.in 21 Apr 2010 02:53:28 -0000 @@ -12,7 +12,8 @@ scope section_command setshow setvar shmain sigall signals \ solib solib_sl so-impl-ld so-indr-cl \ step-line step-test structs structs2 \ - twice-tmp varargs vforked-prog watchpoint whatis catch-syscall + twice-tmp varargs vforked-prog watchpoint whatis catch-syscall \ + pr10179 MISCELLANEOUS = coremmap.data ../foobar.baz \ shr1.sl shr2.sl solib_sl.sl solib1.sl solib2.sl Index: testsuite/gdb.base/pr10179-a.c =================================================================== RCS file: testsuite/gdb.base/pr10179-a.c diff -N testsuite/gdb.base/pr10179-a.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ testsuite/gdb.base/pr10179-a.c 21 Apr 2010 02:53:28 -0000 @@ -0,0 +1,17 @@ +#include <stdio.h> + +extern int foo2(); + +int +foo1() +{ +} + +int +bar1() +{ +} + +main() +{ +} Index: testsuite/gdb.base/pr10179-b.c =================================================================== RCS file: testsuite/gdb.base/pr10179-b.c diff -N testsuite/gdb.base/pr10179-b.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ testsuite/gdb.base/pr10179-b.c 21 Apr 2010 02:53:28 -0000 @@ -0,0 +1,6 @@ +#include <stdio.h> + +int +foo2() +{ +} Index: testsuite/gdb.base/pr10179.exp =================================================================== RCS file: testsuite/gdb.base/pr10179.exp diff -N testsuite/gdb.base/pr10179.exp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ testsuite/gdb.base/pr10179.exp 21 Apr 2010 02:53:28 -0000 @@ -0,0 +1,38 @@ +# Copyright 2010 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +set testname pr10179 +set sources "pr10179-a.c pr10179-b.c" + +if {[build_executable ${testname}.exp $testname $sources {debug}] == -1} { + return -1 +} + +clean_restart ${testname} + +if ![runto_main] { + untested pr10179 + return -1 +} + +gdb_test "rbreak foo.*" "Breakpoint \[0-9\]+\[^\\n\]*\\nint foo\[12\]\[^\\n\]*\\nBreakpoint \[0-9\]+\[^\\n\]*\\nint foo\[12\].*" + +gdb_test "delete breakpoints" ".*" "" "Delete all breakpoints.*" "y" + +gdb_test "rbreak pr10179-a.c:foo.*" "Breakpoint \[0-9\]+\[^\\n\]*\\nint foo.*" + +gdb_test "delete breakpoints" ".*" "" "Delete all breakpoints.*" "y" + +gdb_test "rbreak pr10179-a.c : .*" "Breakpoint \[0-9\]+\[^\\n\]*\\nint bar1\[^\\n\]*\\nBreakpoint \[0-9\]+\[^\\n\]*\\nint foo1\[^\\n\]*\\nBreakpoint \[0-9\]+\[^\\n\]*\\nint main\[^\\n\]*.*" ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: PR10179, Add support to set a breakpoint at every function in a file 2010-04-21 2:56 ` Chris Moller @ 2010-04-21 21:24 ` Michael Snyder 2010-04-21 22:27 ` Tom Tromey 2010-04-23 9:30 ` Eli Zaretskii 2 siblings, 0 replies; 12+ messages in thread From: Michael Snyder @ 2010-04-21 21:24 UTC (permalink / raw) To: Chris Moller; +Cc: tromey, gdb-patches Chris Moller wrote: > I don't recall that I've ever ever updated any of the doc files before, > so, in case anyone wants to look at them, I've attached a new patch that > include doc updates. Hi Chris, Thanks for addressing my other comments. Just one more --- + while (isspace (*regexp)) regexp++; This line should be split into two lines. Michael ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: PR10179, Add support to set a breakpoint at every function in a file 2010-04-21 2:56 ` Chris Moller 2010-04-21 21:24 ` Michael Snyder @ 2010-04-21 22:27 ` Tom Tromey 2010-04-23 9:30 ` Eli Zaretskii 2 siblings, 0 replies; 12+ messages in thread From: Tom Tromey @ 2010-04-21 22:27 UTC (permalink / raw) To: Chris Moller; +Cc: gdb-patches >>>>> "Chris" == Chris Moller <cmoller@redhat.com> writes: Chris> + char * file_name; Extra space. Chris> + * refcard.tex (Breakpoints and Watchpoints): Added brief Chris> + description of ilename-qualified rbreak. Typo in "filename". Chris> +specified file. This can be used, for example, to set breakponts on Typo in "breakpoints". The doc changes look ok to me, but please wait for a review from Eli. thanks, Tom ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: PR10179, Add support to set a breakpoint at every function in a file 2010-04-21 2:56 ` Chris Moller 2010-04-21 21:24 ` Michael Snyder 2010-04-21 22:27 ` Tom Tromey @ 2010-04-23 9:30 ` Eli Zaretskii 2010-04-23 12:09 ` Chris Moller 2 siblings, 1 reply; 12+ messages in thread From: Eli Zaretskii @ 2010-04-23 9:30 UTC (permalink / raw) To: Chris Moller; +Cc: tromey, gdb-patches > Date: Tue, 20 Apr 2010 22:56:14 -0400 > From: Chris Moller <cmoller@redhat.com> > CC: gdb-patches@sourceware.org > > --- NEWS 19 Apr 2010 00:48:43 -0000 1.373 > +++ NEWS 21 Apr 2010 02:52:34 -0000 > @@ -47,6 +47,10 @@ > single `break' command creates multiple breakpoints (e.g., > breakpoints on overloaded c++ functions). > > +* The `rbreak' command now accepts a filename specification as part of > + its argument, limiting the functions selected by the regex to those > + in the specified file. > + This part is okay. > + * refcard.tex (Breakpoints and Watchpoints): Added brief > + description of ilename-qualified rbreak. ^^^^^^^ A typo. > +@item rbreak @var{filename:regex} This should separate filename and regex, because they are 2 distinct arguments. @item rbreak @var{filename}:@var{regex} > +If @code{rbreak} is called with a filename qualification, it limits > +the search for functions matching the given regular expression to the > +specified file. This can be used, for example, to set breakponts on > +every function in a given file: It is a good idea to mention in the text the arguments to the command. Like this: @item rbreak @var{file}:@var{regex} If @code{rbreak} is called with a filename qualification, it limits the search for functions matching the given regular expression to the specified @var{file}. This can be used, for example, to set breakponts on every function in a given file: Okay with these changes. Thanks. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: PR10179, Add support to set a breakpoint at every function in a file 2010-04-23 9:30 ` Eli Zaretskii @ 2010-04-23 12:09 ` Chris Moller 0 siblings, 0 replies; 12+ messages in thread From: Chris Moller @ 2010-04-23 12:09 UTC (permalink / raw) To: Eli Zaretskii; +Cc: gdb-patches On 04/23/10 05:28, Eli Zaretskii wrote: >> Date: Tue, 20 Apr 2010 22:56:14 -0400 >> From: Chris Moller<cmoller@redhat.com> >> CC: gdb-patches@sourceware.org >> >> --- NEWS 19 Apr 2010 00:48:43 -0000 1.373 >> +++ NEWS 21 Apr 2010 02:52:34 -0000 >> @@ -47,6 +47,10 @@ >> single `break' command creates multiple breakpoints (e.g., >> breakpoints on overloaded c++ functions). >> >> +* The `rbreak' command now accepts a filename specification as part of >> + its argument, limiting the functions selected by the regex to those >> + in the specified file. >> + >> > > This part is okay. > > >> + * refcard.tex (Breakpoints and Watchpoints): Added brief >> + description of ilename-qualified rbreak. >> > ^^^^^^^ > A typo. > > >> +@item rbreak @var{filename:regex} >> > > This should separate filename and regex, because they are 2 distinct > arguments. > > @item rbreak @var{filename}:@var{regex} > > >> +If @code{rbreak} is called with a filename qualification, it limits >> +the search for functions matching the given regular expression to the >> +specified file. This can be used, for example, to set breakponts on >> +every function in a given file: >> > > It is a good idea to mention in the text the arguments to the > command. Like this: > > @item rbreak @var{file}:@var{regex} > > If @code{rbreak} is called with a filename qualification, it limits > the search for functions matching the given regular expression to the > specified @var{file}. This can be used, for example, to set > breakponts on every function in a given file: > > Okay with these changes. > Fixed up and committed. Thanks. > Thanks. > ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2010-04-23 12:09 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-04-20 19:21 PR10179, Add support to set a breakpoint at every function in a file Chris Moller 2010-04-20 19:23 ` Michael Snyder 2010-04-20 19:25 ` Chris Moller 2010-04-20 19:27 ` Michael Snyder 2010-04-20 19:30 ` Chris Moller 2010-04-20 19:35 ` Michael Snyder 2010-04-20 19:44 ` Tom Tromey 2010-04-21 2:56 ` Chris Moller 2010-04-21 21:24 ` Michael Snyder 2010-04-21 22:27 ` Tom Tromey 2010-04-23 9:30 ` Eli Zaretskii 2010-04-23 12:09 ` Chris Moller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox