This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11702] New: static const member is not printed


class C { static const int i = 1; } c;

 <2><37>: Abbrev Number: 3 (DW_TAG_member)
    <38>   DW_AT_name        : i	
    <40>   DW_AT_type        : <0x49>	
    <44>   DW_AT_external    : 1	
    <45>   DW_AT_accessibility: 3	(private)
    <46>   DW_AT_declaration : 1	
    <47>   DW_AT_const_value : 1	

(gdb) ptype c
type = class C {
    static const int i;
}

(gdb) p c
$2 = {static i = <optimized out>}
(gdb) p c.i
field i is nonexistent or has been optimised out

But GDB should print the constant value 1.

enum field_loc_kind
  {
    FIELD_LOC_KIND_BITPOS,      /* bitpos */
    FIELD_LOC_KIND_PHYSADDR,    /* physaddr */
    FIELD_LOC_KIND_PHYSNAME,    /* physname */
    FIELD_LOC_KIND_DWARF_BLOCK  /* dwarf_block */
  };
Some FIELD_LOC_KIND_CONST or an assembled dwarf block is needed in
dwarf2_add_field().

-- 
           Summary: static const member is not printed
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: jan dot kratochvil at redhat dot com
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=11702

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]