From: Andrew Haley <aph@redhat.com>
To: Michael Haupt <michael.haupt@oracle.com>
Cc: "java@gcc.gnu.org" <java@gcc.gnu.org>
Subject: Re: gcj and debugging
Date: Mon, 11 Feb 2013 16:32:00 -0000 [thread overview]
Message-ID: <51191D25.20407@redhat.com> (raw)
In-Reply-To: <C4784CAC-C72D-4FA5-9FCD-C89B20F1C192@oracle.com>
On 02/11/2013 04:26 PM, Michael Haupt wrote:
> Tom,
>
> thank you very much for your reply.
>
> Am 07.02.2013 um 19:47 schrieb Tom Tromey <tromey@redhat.com>:
>> Michael> in a research project, I'm generating DWARF debugging info for machine
>> Michael> code generated from Java. I looked at some of the DWARF debug info
>> Michael> generated by gcj (including that contained in libgcj.so).
>>
>> I think the first thing to realize is that the gdb support for Java was
>> all written to target gcj specifically, and also written long ago and
>> then barely updated.
>>
>> It isn't very general or done the way it would be done now.
>> It was never updated for the gcj binary compatibility ABI.
>
> Would you suggest to generate DWARF info with the language set to C89 then, to avoid misleading gdb?
>
>> I thought things like "print array[0]" used to work, but even that seems
>> to fail for me now. There is definitely some code for this in gdb, see
>> jv-valprint.c:java_value_print. It seems to know a bit about array
>> layout and then goes from there (though the code looks somewhat bogus to
>> me...). See also jv-lang.c:evaluate_subexp_java for the code that tries
>> to do array subscripting.
>
> If gdb's Java language support is really tailored to gcj, it surely assumes internal layout details about arrays. I cannot guarantee that "my" arrays have the same internal representation. :-)
>
>> gdb has special code for this. It looks for a type named
>> "java.lang.String" and then knows what fields it has.
>>
>> Yucky.
>
> Indeed.
The Right Way to do it, as is done with the thread library, is to have
a target library that GDB opens which contains accessor methods for all
of the VM's structures.
Andrew.
next prev parent reply other threads:[~2013-02-11 16:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-01 15:10 Michael Haupt
2013-02-01 17:26 ` Andrew Haley
2013-02-07 18:47 ` Tom Tromey
2013-02-09 0:38 ` David Daney
2013-02-11 16:26 ` Michael Haupt
2013-02-11 16:32 ` Andrew Haley [this message]
2013-02-11 16:47 ` Michael Haupt
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=51191D25.20407@redhat.com \
--to=aph@redhat.com \
--cc=java@gcc.gnu.org \
--cc=michael.haupt@oracle.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).