This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfa] fix pr java/1039
- From: David Carlton <carlton at math dot stanford dot edu>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: gdb-patches at sources dot redhat dot com, Jim Blandy <jimb at redhat dot com>, Elena Zannoni <ezannoni at redhat dot com>
- Date: 14 Mar 2003 09:26:28 -0800
- Subject: Re: [rfa] fix pr java/1039
- References: <ro1ptouo72g.fsf@jackfruit.Stanford.EDU><20030314144703.GA9539@nevyn.them.org>
On Fri, 14 Mar 2003 09:47:03 -0500, Daniel Jacobowitz <drow at mvista dot com> said:
> On Thu, Mar 13, 2003 at 09:23:03PM -0800, David Carlton wrote:
>> ! /* FIXME: carlton/2003-03-13: This is an unfortunate situation. I
>> ! don't mind the Java prefix so much: different languages have
>> ! different demangling requirements, so it's only natural that we
>> ! need to keep language data around in our demangling cache. But
>> ! it's not good that the minimal symbol has the wrong demangled name.
>> ! Unfortunately, I can't think of any easy solution to that
>> ! problem. */
> Hey hey... it occurs to me... it would still not be ideal (memory
> waste) but could we look up the minimal symbol and change its demangled
> name? It would require:
> - changing the interface for setting symbol names
> - rehashing the minsyms incrementally
> [And do we want to? That's kind of dubious, to have a symbol's name
> change.]
Hmm. I guess it's true that renaming and rehashing the minsyms would
be doable. On the other hand, as you point out, having a symbol's
name change is potentially dubious; my guess is that it wouldn't hurt
us too much here, but who knows?
I think that, for now, we should just leave the situation as-is.
(After adding my patch, of course.) After all, for most (all?)
situations where minimal symbols are accessed via demangled names,
that's only a fallback in case we don't have debug information. And
we only have the info to get the demangled name right if we do have
debug information, in which case the fallback on minsyms never
happens! So, in practice, I don't expect it to hurt Java users too
much if Java minsyms have the wrong demangled names. But if either we
decide later that it's really important for cleanliness reasons for
minsyms to have the right demangled names or if a Java maintainer
comes along with evidence that this is important for Java debugging,
we could rethink the issue.
Incidentally, I think that, with this fix, Java debugging will
actually be a little better in 5.4 than in 5.3. (Even setting aside
another Java fix that I got in a month or two ago.) Because, now that
I think about it, I don't think that 'break Class.method(args)' could
have worked before unless the symtab containing Class was loaded:
minimal symbols had the wrong demangled name, and partial symbols
didn't have any demangled name at all. But now that partial symbols
have the right demangled name, that should work much more reliably.
I bet this is why jmisc2.exp does a 'ptype jmisc' before doing the
break. And, if I'm reading Michael's tables right, this is in fact
true: jmisc1.exp does the break before the ptype, and the break there
seems to have failed on 5.3, but I'm 99% sure that it passed for me
last night when I tried it.
David Carlton
carlton at math dot stanford dot edu