From: Daniel Jacobowitz <drow@mvista.com>
To: Elena Zannoni <ezannoni@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Select a particular mangling of a demangled symbol in lookup_block_symbol
Date: Fri, 22 Mar 2002 14:53:00 -0000 [thread overview]
Message-ID: <20020322172322.A1684@nevyn.them.org> (raw)
In-Reply-To: <15515.36821.518905.440825@localhost.redhat.com>
On Fri, Mar 22, 2002 at 03:11:01PM -0500, Elena Zannoni wrote:
> Daniel Jacobowitz writes:
> > On Tue, Mar 19, 2002 at 05:46:58PM -0500, Elena Zannoni wrote:
> > > Replying to myself. I was testing with dwarf2, but using stabs I can
> > > see it. I can also see that we call cplus_demangle (__3foor3foo, ...)
> > > instead of cplus_demangle (__3fooR3foo, ...), if 'set case off'. But
> > > it returns foo::foo(long double, foo) anyway. So it works?
> >
> > Absolutely not:
> >
> > drow@nevyn:~% c++filt
> > __3fooR3foo
> > foo::foo(foo &)
> > __3foor3foo
> > foo::foo(long double, foo)
> >
>
> Ah, I didn't think twice when I saw it not core dumping!
>
> > Those aren't the same function at all :)
> >
>
> Indeed. Then I think we definitely should use the uppercase parameter.
Is this what you had in mind?
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
2002-03-22 Daniel Jacobowitz <drow@mvista.com>
* symtab.c (lookup_symbol): Demangled before lowercasing.
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.58
diff -u -p -r1.58 symtab.c
--- symtab.c 2002/03/22 18:57:08 1.58
+++ symtab.c 2002/03/22 22:22:23
@@ -569,12 +569,27 @@ lookup_symbol (const char *name, const s
const namespace_enum namespace, int *is_a_field_of_this,
struct symtab **symtab)
{
- char *modified_name = NULL;
- char *modified_name2 = NULL;
+ char *demangled_name = NULL;
+ const char *modified_name = NULL;
const char *mangled_name = NULL;
int needtofreename = 0;
struct symbol *returnval;
+ modified_name = name;
+
+ /* If we are using C++ language, demangle the name before doing a lookup, so
+ we can always binary search. */
+ if (current_language->la_language == language_cplus)
+ {
+ demangled_name = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS);
+ if (demangled_name)
+ {
+ mangled_name = name;
+ modified_name = demangled_name;
+ needtofreename = 1;
+ }
+ }
+
if (case_sensitivity == case_sensitive_off)
{
char *copy;
@@ -587,26 +602,11 @@ lookup_symbol (const char *name, const s
copy[len] = 0;
modified_name = copy;
}
- else
- modified_name = (char *) name;
-
- /* If we are using C++ language, demangle the name before doing a lookup, so
- we can always binary search. */
- if (current_language->la_language == language_cplus)
- {
- modified_name2 = cplus_demangle (modified_name, DMGL_ANSI | DMGL_PARAMS);
- if (modified_name2)
- {
- mangled_name = name;
- modified_name = modified_name2;
- needtofreename = 1;
- }
- }
returnval = lookup_symbol_aux (modified_name, mangled_name, block,
namespace, is_a_field_of_this, symtab);
if (needtofreename)
- xfree (modified_name2);
+ xfree (demangled_name);
return returnval;
}
next prev parent reply other threads:[~2002-03-22 22:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-14 15:55 Daniel Jacobowitz
2002-03-19 11:53 ` Daniel Jacobowitz
2002-03-19 14:25 ` Elena Zannoni
2002-03-19 14:20 ` Elena Zannoni
2002-03-19 14:47 ` Elena Zannoni
2002-03-22 10:55 ` Daniel Jacobowitz
2002-03-22 12:11 ` Elena Zannoni
2002-03-22 14:53 ` Daniel Jacobowitz [this message]
2002-03-22 10:52 ` Daniel Jacobowitz
2002-03-22 12:10 ` Elena Zannoni
2002-02-15 16:38 Michael Elizabeth Chastain
2002-02-15 16:46 ` Daniel Jacobowitz
2002-02-15 18:15 Michael Elizabeth Chastain
2002-02-16 10:59 Michael Elizabeth Chastain
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=20020322172322.A1684@nevyn.them.org \
--to=drow@mvista.com \
--cc=ezannoni@redhat.com \
--cc=gdb-patches@sources.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