This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC] Proposed changes in symbol-handling for Ada
- From: Paul Hilfinger <hilfingr at gnat dot com>
- To: drow at mvista dot com
- Cc: carlton at kealia dot com, gdb-patches at sources dot redhat dot com
- Date: Wed, 21 Jan 2004 05:55:10 -0500 (EST)
- Subject: Re: [RFC] Proposed changes in symbol-handling for Ada
- References: <200311082255.hA8MtJK08216@otisco.McKusick.COM> <yf2he1c6tjm.fsf@hawaii.kealia.com> <20040120101613.F2871F2945@nile.gnat.com> <20040120150101.GB10459@nevyn.them.org>
> Rather than demangling at startup, we ask each mangled name for a base
> identifier. This can be done reasonably efficiently - I hope - I
> haven't performed measurements yet. Then, when we search for a symbol,
> we wildcard for the basename. We demangle everything with that
> basename. If you do a search that doesn't know the basename you
> have to un-lazy all symbols, of course, but I don't think that's much
> of a change.
Daniel,
At first blush, this sounds like a great idea (at least until someone
introduces a mangling scheme in which the basename is not a
substring). The basename situation for Ada is essentially the same as you
describe for C++.
As you may know, the current Ada lookup machinery is separate from (and
partially duplicative of) the usual lookup machinery. There are two
reasons for this:
1. We actually WANT to be able to match on base name alone if the user
supplies just a base name.
2. We don't include parameter types in mangled names: instead, our
basic lookup routine returns a list of all matches, from which we select
by parameter type or, if that doesn't work, by giving the user a choice.
3. Three; there are three reasons: we don't store demangled names.
So, your proposal takes care of 3. If we could persuade you to
A. Provide a mode in which you search for the base name (i.e, return
the results of your preliminary sift for base names, skipping the
comparison against full demangled name), and
B. Provide a mode in which you return ALL matches for a name.
... why we could clean up all that nasty duplication in the ada-* files and
join the civilized world.
> - Reasonably unique (i.e. user-choosable) basenames. If every package
> (or whatever they are in ada) has a method with the same basename,
> then this scheme obviously won't work.
"Package" is right. No, this should not be a particular problem.
Paul