Bug 18153 - Java minsyms get demangled as c++
Summary: Java minsyms get demangled as c++
Status: RESOLVED OBSOLETE
Alias: None
Product: gdb
Classification: Unclassified
Component: java (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 8.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-23 04:59 UTC by Doug Evans
Modified: 2016-10-06 16:16 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Doug Evans 2015-03-23 04:59:42 UTC
make check RUNTESTFLAGS=jmain.exp
gdb testsuite/gdb.java/jmain
(gdb) b jmain.jmain
(gdb) b jmain::main

The "b jmain::jmain" works because the corresponding minsym got demangled as c++.

This also means that LOC_UNRESOLVED is (I think, still have to verify it) broken for Java.  LOC_UNRESOLVED does minsym lookup based on the demangled name derived from DWARF, but in DWARF we know we have Java.  So I'm guessing a LOC_UNRESOLVED minsym lookup for "foo.bar" will fail because the minsym got demangled as "foo::bar".

Note: The code to process LOC_UNRESOLVED is in findvar.c:

        memset (&lookup_data, 0, sizeof (lookup_data));
        lookup_data.name = SYMBOL_LINKAGE_NAME (var);

Heads up when you read this: SYMBOL_LINKAGE_NAME here is actually the demangled name.

I have a significant rework of minsym support in progress.
Hopefully I can address this with this patch.

To fix LOC_UNRESOLVED I think what we really need to do is do the minsym lookup using the mangled name. That's the topic of another patch in progress.
Comment 1 Tom Tromey 2016-10-06 16:16:49 UTC
gcj support has been removed, so I'm closing the remaining java bugs.