From: David Carlton <carlton@math.stanford.edu>
To: Elena Zannoni <ezannoni@redhat.com>
Cc: gdb-patches@sources.redhat.com, Jim Blandy <jimb@redhat.com>
Subject: Re: [rfa] try to remove uses of DEPRECATED_SYMBOL_NAME in symtab.h
Date: Mon, 03 Mar 2003 18:04:00 -0000 [thread overview]
Message-ID: <ro13cm4iaxp.fsf@jackfruit.Stanford.EDU> (raw)
In-Reply-To: <15970.39249.629140.373607@localhost.redhat.com>
On Sun, 2 Mar 2003 18:52:49 -0500, Elena Zannoni <ezannoni@redhat.com> said:
> I think it would make more sense to get rid of the REGEXP macro
> completely. There are only 4 occurrences, and you are really
> simplifying it. This should go in as one commit.
> As a separate commit you can check in the rest of this patch, to fix
> gdb/33.
> i.e. deal with one macro at the time.
Good idea. Here's the regexp patch, which I've just committed; I'll
prepare the other one in a few minutes.
David Carlton
carlton@math.stanford.edu
2003-03-03 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_MATCHES_REGEXP): Delete.
* symtab.c (search_symbols): Replace uses of SYMBOL_MATCHES_REGEXP
by regexp matching against SYMBOL_NATURAL_NAME.
Index: symtab.h
===================================================================
RCS file: /cvs/src/src/gdb/symtab.h,v
retrieving revision 1.63
diff -u -p -r1.63 symtab.h
--- symtab.h 25 Feb 2003 21:36:20 -0000 1.63
+++ symtab.h 3 Mar 2003 18:00:28 -0000
@@ -222,16 +222,6 @@ extern char *symbol_demangled_name (stru
|| (SYMBOL_DEMANGLED_NAME (symbol) != NULL \
&& strcmp_iw (SYMBOL_DEMANGLED_NAME (symbol), (name)) == 0))
-/* Macro that tests a symbol for an re-match against the last compiled regular
- expression. First test the unencoded name, then look for and test a C++
- encoded name if it exists.
- Evaluates to zero if the match fails, or nonzero if it succeeds. */
-
-#define SYMBOL_MATCHES_REGEXP(symbol) \
- (re_exec (DEPRECATED_SYMBOL_NAME (symbol)) != 0 \
- || (SYMBOL_DEMANGLED_NAME (symbol) != NULL \
- && re_exec (SYMBOL_DEMANGLED_NAME (symbol)) != 0))
-
/* Define a simple structure used to hold some very basic information about
all defined global symbols (text, data, bss, abs, etc). The only required
information is the general_symbol_info.
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.96
diff -u -p -r1.96 symtab.c
--- symtab.c 27 Feb 2003 20:48:03 -0000 1.96
+++ symtab.c 3 Mar 2003 18:00:24 -0000
@@ -2931,7 +2931,8 @@ search_symbols (char *regexp, namespace_
/* If it would match (logic taken from loop below)
load the file and go on to the next one */
if (file_matches (ps->filename, files, nfiles)
- && ((regexp == NULL || SYMBOL_MATCHES_REGEXP (*psym))
+ && ((regexp == NULL
+ || re_exec (SYMBOL_NATURAL_NAME (*psym)) != 0)
&& ((kind == VARIABLES_NAMESPACE && SYMBOL_CLASS (*psym) != LOC_TYPEDEF
&& SYMBOL_CLASS (*psym) != LOC_BLOCK)
|| (kind == FUNCTIONS_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_BLOCK)
@@ -2968,7 +2969,8 @@ search_symbols (char *regexp, namespace_
MSYMBOL_TYPE (msymbol) == ourtype3 ||
MSYMBOL_TYPE (msymbol) == ourtype4)
{
- if (regexp == NULL || SYMBOL_MATCHES_REGEXP (msymbol))
+ if (regexp == NULL
+ || re_exec (SYMBOL_NATURAL_NAME (msymbol)) != 0)
{
if (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol)))
{
@@ -3008,7 +3010,8 @@ search_symbols (char *regexp, namespace_
{
QUIT;
if (file_matches (s->filename, files, nfiles)
- && ((regexp == NULL || SYMBOL_MATCHES_REGEXP (sym))
+ && ((regexp == NULL
+ || re_exec (SYMBOL_NATURAL_NAME (sym)) != 0)
&& ((kind == VARIABLES_NAMESPACE && SYMBOL_CLASS (sym) != LOC_TYPEDEF
&& SYMBOL_CLASS (sym) != LOC_BLOCK
&& SYMBOL_CLASS (sym) != LOC_CONST)
@@ -3062,7 +3065,8 @@ search_symbols (char *regexp, namespace_
MSYMBOL_TYPE (msymbol) == ourtype3 ||
MSYMBOL_TYPE (msymbol) == ourtype4)
{
- if (regexp == NULL || SYMBOL_MATCHES_REGEXP (msymbol))
+ if (regexp == NULL
+ || re_exec (SYMBOL_NATURAL_NAME (msymbol)) != 0)
{
/* Functions: Look up by address. */
if (kind != FUNCTIONS_NAMESPACE ||
next prev parent reply other threads:[~2003-03-03 18:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-27 23:01 David Carlton
2003-03-02 23:48 ` Elena Zannoni
2003-03-03 18:04 ` David Carlton [this message]
2003-03-03 18:36 ` David Carlton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ro13cm4iaxp.fsf@jackfruit.Stanford.EDU \
--to=carlton@math.stanford.edu \
--cc=ezannoni@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jimb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox