diff options
author | Chris Moller <cmoller@cygnus> | 2010-04-23 12:08:07 +0000 |
---|---|---|
committer | Chris Moller <cmoller@cygnus> | 2010-04-23 12:08:07 +0000 |
commit | 8bd10a10b3917698e13bb1101d13c93d8c1db3a1 (patch) | |
tree | fca410c452286453fc101dc0fcd5baf810499a4a /gdb/symtab.c | |
parent | f6973bdcb778ca7a54817a696cb0c6457f4ae96f (diff) | |
download | gdb-8bd10a10b3917698e13bb1101d13c93d8c1db3a1.zip gdb-8bd10a10b3917698e13bb1101d13c93d8c1db3a1.tar.gz gdb-8bd10a10b3917698e13bb1101d13c93d8c1db3a1.tar.bz2 |
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.
* gdb.base/Makefile.in (EXECUTABLES): Added pr10179.
* gdb.base/pr10179-a.c:
* gdb.base/pr10179-b.c:
* gdb.base/pr10179.exp: New files.
* gdb.texinfo (Setting Breakpoints): Added description of
filename-qualified rbreak.
* refcard.tex (Breakpoints and Watchpoints): Added brief
description of filename-qualified rbreak.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 28084e7..1d6b648 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -3248,8 +3248,31 @@ rbreak_command (char *regexp, int from_tty) 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); |