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

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)?

Keith

PS. This causes gdb to report jvstatic.STATIC as "optimized out" when, 
in fact, it is not. [This is because I am removing 
DW_AT_MIPS_linkage_name from gdb, and this works on CVS HEAD *only* 
because gdb finds the linkage name in the minimal symbol table. A 
convenient workaround for many of gdb's sins.]

             reply	other threads:[~2010-03-03 19:49 UTC|newest]

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

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=4B8EBD25.6000901@redhat.com \
    --to=keiths@redhat.com \
    --cc=java@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).