Some java questions

Tom Tromey
Tue Sep 9 21:18:00 GMT 2008

>>>>> "Keith" == Keith Seitz <> writes:

Keith> But that's not my real concern. What puzzles me is this second
Keith> function "jmisc.main(java.lang.String[])void". What the heck is that,
Keith> cause it isn't java. It looks to me like some partially demangled java
Keith> method signature (which is still not valid input to a java compiler).

To support Java 1.5, we had to add return types to name mangling.
These are needed due to covariant return types.

What you are seeing here is just how the demangler chooses to print
this information.  E.g., when I 'nm --demangle=java' a simple java
program, I see:

0804891e T h.main(java.lang.String[])void
         U java.lang.Object.toString()java.lang.String

Keith> At long last, my question is: Is gdb supposed to be able to do
Keith> something with "jmisc.main(java.lang.String[])void", i.e. is it
Keith> considered valid "input" to break, print, and other commands?

FYI -- nobody really maintains the gcj support in gdb.

It would be nice to be able to break on a method that can only be
differentiated by its return type.  Normally, though, I think only one
of the methods like this really matters -- the rest are just bridge
methods and probably not interesting.  It might be tricky for gdb to
sort this out though.


More information about the Gdb mailing list