Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: gdb@sourceware.org
Subject: Some java questions
Date: Tue, 09 Sep 2008 19:44:00 -0000	[thread overview]
Message-ID: <48C6D1DF.3060705@redhat.com> (raw)

Hi,

I've been mucking with Daniel's DWARF2 "full names" patch, and a number 
issues with java and the gdb.java/jmisc.exp and gdb.java/jprint.exp 
tests have appeared.

Both of these test cases have the following comment:

     # Ref PR gdb:java/1565.  Don't use the simpler "break jmisc.main".
     # As of 2004-02-24 it wasn't working and is being tested separatly.
     # Before GCJ 4.1 (approximately) the demangled name did not include
     # a method signature; after that point it does include a trailing
     # signature.

In the case of jmisc,exp, the test suite attempts to set breakpoints on 
"'jmisc.main(java.lang.String[])'" and 
"'jmisc.main(java.lang.String[])void'", working around the gcc bug 
(similar in jprint.exp). IMO, this is a very dangerous precedent. Bugs 
in the toolchain should not be worked around like this. They should be 
xfailed or (in this case), breaks at the correct "jmisc.main" should 
have been left in as well.

IMO this bug should be closed/not-a-bug, and jmisc/jprint.exp should be 
"fixed". [There are several ways this could be done. The simplest is to 
simply break at "jmisc.main" as it should. Maybe add 
"jmisc.main(java.lang.String[])" as a back-up. If someone recommends a 
course of action, I would be happy to follow it up.]

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

I also note this in "info func":

(gdb) info func jmisc
All functions matching regular expression "jmisc":

File /tmp/ccozBSfv.jar:
void jmisc.jmisc();
void jmisc.main(java.lang.String[])void;

Now maybe my java is really rusty after two months, but I'm pretty sure 
"void jmisc.main(java.lang.String[])void;" is not a valid method 
declaration.

What's puzzling about all of this is that the gcc/gdb versions which 
java/1565 affect actually show something sane:

(old-gdb) info func jmisc
All functions matching regular expression "jmisc":

File jmisc.java:
void jmisc.jmisc();
void jmisc.main(java.lang.String[]);

While it is true that one cannot "break jmisc.main" on those "broken" 
versions, one can simply do "break jmisc.main(java.lang.String[])". Any 
attempt to tack on the "void" either results in a "junk at end of 
argument list" error (without surrounding ') or a "make pending 
breakpoint?" query (with surrounding ' -- breakpoint never gets hit).

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

Keith


             reply	other threads:[~2008-09-09 19:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09 19:44 Keith Seitz [this message]
2008-09-09 21:18 ` Tom Tromey
2008-09-09 21:31   ` Daniel Jacobowitz
2008-09-09 23:39     ` Keith Seitz
2008-09-09 23:36   ` Keith Seitz

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=48C6D1DF.3060705@redhat.com \
    --to=keiths@redhat.com \
    --cc=gdb@sourceware.org \
    /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