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++/8218] ptype claims destructors have arg


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

David Blaikie <dblaikie at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dblaikie at gmail dot com

--- Comment #2 from David Blaikie <dblaikie at gmail dot com> 2013-01-22 17:34:20 UTC ---
This looks like a GCC bug, not a GDB bug.

Using llvm-dwarfdump, GCC's dwarf for the dtor looks like this:

0x00000051:     DW_TAG_subprogram [5] *
0x00000052:       DW_AT_external [DW_FORM_flag] (0x01)
0x00000053:       DW_AT_name [DW_FORM_string]   ("~C")
0x00000056:       DW_AT_decl_file [DW_FORM_data1]       (0x01)
0x00000057:       DW_AT_decl_line [DW_FORM_data1]       (0x03)
0x00000058:       DW_AT_declaration [DW_FORM_flag]      (0x01)
0x00000059:       DW_AT_object_pointer [DW_FORM_ref4]   (cu + 0x005d =>
{0x0000005d})

0x0000005d:       DW_TAG_formal_parameter [4]
0x0000005e:         DW_AT_type [DW_FORM_ref4]   (cu + 0x006b => {0x0000006b})
0x00000062:         DW_AT_artificial [DW_FORM_flag]     (0x01)

0x00000063:       DW_TAG_formal_parameter [4] 
0x00000064:         DW_AT_type [DW_FORM_ref4]   (cu + 0x0071 => {0x00000071})
0x00000068:         DW_AT_artificial [DW_FORM_flag]     (0x01)

0x00000069:       NULL  

0x0000006a:     NULL    

whereas Clang's dwarf looks like this:

0x00000086:     DW_TAG_subprogram [10] *
0x00000087:       DW_AT_accessibility [DW_FORM_data1]   (0x01)
0x00000088:       DW_AT_name [DW_FORM_strp]     ( .debug_str[0x00000049] =
"~C")
0x0000008c:       DW_AT_decl_file [DW_FORM_data1]       (0x01)
0x0000008d:       DW_AT_decl_line [DW_FORM_data1]       (0x03)
0x0000008e:       DW_AT_declaration [DW_FORM_flag_present]      (true)
0x0000008e:       DW_AT_external [DW_FORM_flag_present] (true)

0x0000008e:       DW_TAG_formal_parameter [9]
0x0000008f:         DW_AT_type [DW_FORM_ref4]   (cu + 0x006b => {0x0000006b})
0x00000093:         DW_AT_artificial [DW_FORM_flag_present]     (true)

0x00000093:       NULL  

0x00000094:     NULL

And GDB's output when given your example and compiled with Clang is:

(well I modified the example a bit: struct C { C() {} ~C() {} }; int main() { C
c; } (mostly I was curious whether "(void)" was the way GDB was printing things
generally or whether it would print the ctor as "()" instead)):

ptype C
type = struct C {
  public:
    C(void);
    ~C(void);
}

Shall we close this & open a GCC bug instead? (& change the kfail to an xfail
referencing the GCC bug - and add the correct pattern so Clang can pass this
test)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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