Bug 57369 - type-less DW_TAG_const_type
Summary: type-less DW_TAG_const_type
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-debug
Depends on:
Blocks:
 
Reported: 2013-05-22 14:00 UTC by Tom Tromey
Modified: 2021-08-30 03:17 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
test case (1.03 KB, text/x-c++src)
2013-05-22 14:00 UTC, Tom Tromey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2013-05-22 14:00:47 UTC
Created attachment 30161 [details]
test case

I compiled the attached program with "g++ -g".
I used git g++ from yesterday (ed89150ab33bd05799b31d31424cb50c2dd0b481)
on x86-64 Fedora 18.

The resulting DWARF has a DW_TAG_const_type that does not
have a DW_AT_type attribute.  This seems wrong.

 <1><245>: Abbrev Number: 16 (DW_TAG_const_type)
 <1><246>: Abbrev Number: 17 (DW_TAG_subprogram)
    <247>   DW_AT_external    : 1       
[...]
Comment 1 Mark Wielaard 2014-02-25 11:25:52 UTC
Replicated with GNU C++ 4.9.0 20140219 (experimental)

 [   219]    typedef
             name                 (strp) "__compar_fn_t"
             decl_file            (data1) 5
             decl_line            (data2) 742
             type                 (ref4) [   225]
 [   225]    pointer_type
             byte_size            (data1) 8
             type                 (ref4) [   22b]
 [   22b]    subroutine_type
             type                 (ref4) [   12b]
             sibling              (ref4) [   23f]
 [   234]      formal_parameter
               type                 (ref4) [   23f]
 [   239]      formal_parameter
               type                 (ref4) [   23f]
 [   23f]    pointer_type
             byte_size            (data1) 8
             type                 (ref4) [   245]
 [   245]    const_type

The DW_TAG_const_type at 245 doesn't have any attributes.

The typedef is defined in /usr/include/stdlib.h as:
typedef int (*__compar_fn_t) (__const void *, __const void *);