public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Haley <aph@redhat.com>
To: Keith Seitz <keiths@redhat.com>
Cc: java@gcc.gnu.org
Subject: Re: Static class members & DWARF
Date: Wed, 03 Mar 2010 20:13:00 -0000	[thread overview]
Message-ID: <4B8EC2CF.4000302@redhat.com> (raw)
In-Reply-To: <4B8EBD25.6000901@redhat.com>

On 03/03/2010 07:48 PM, Keith Seitz wrote:
> Hi,
> 
> Consider the following simple class:
> 
> class jvstatic
> {
>   public static int STATIC = 1;
> }
> 
> Looking at the DWARF info for this class, I see:
> 
>  <1><107>: Abbrev Number: 2 (DW_TAG_class_type)
>     <108>   DW_AT_name        : (indirect string, offset: 0xdf): jvstatic
>     <10c>   DW_AT_byte_size   : 4
>     <10d>   DW_AT_decl_file   : 1
>     <10e>   DW_AT_decl_line   : 0
>     <10f>   DW_AT_containing_type: <0x17b>
>     <113>   DW_AT_sibling     : <0x17b>
>  <2><117>: Abbrev Number: 3 (DW_TAG_inheritance)
>     <118>   DW_AT_type        : <0x17b>
>     <11c>   DW_AT_data_member_location: 2 byte block: 23 0
> (DW_OP_plus_uconst: 0)
>     <11f>   DW_AT_accessibility: 1      (public)
>  <2><120>: Abbrev Number: 4 (DW_TAG_member)
>     <121>   DW_AT_name        : (indirect string, offset: 0x123): STATIC
>     <125>   DW_AT_decl_file   : 1
>     <126>   DW_AT_decl_line   : 0
>     <127>   DW_AT_MIPS_linkage_name: (indirect string, offset: 0xca):
> _ZN8jvstatic6STATICE
>     <12b>   DW_AT_type        : <0x181>
>     <12f>   DW_AT_external    : 1
>     <130>   DW_AT_declaration : 1
> 
> Pursuant to the DWARF3 specification (sec 4.1 #6), I would expect to
> subsequently see a DIE with DW_TAG_variable which refers to DIE <120>
> (via DW_AT_specification). Alas, this DIE does not appear in the debug
> info at all.
> 
> Does java operate differently from C++ (which follows the DWARF
> specification)?

Only by mistake.  gcj itself has no code to generate DWARF: we create the
data structures and hope that the back end will do The Right Thing with
them.

I suppose that the C++ compiler generates something different from gcj.
I don't know why.

Andrew.

      reply	other threads:[~2010-03-03 20:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03 19:49 Keith Seitz
2010-03-03 20:13 ` Andrew Haley [this message]

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=4B8EC2CF.4000302@redhat.com \
    --to=aph@redhat.com \
    --cc=java@gcc.gnu.org \
    --cc=keiths@redhat.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).