This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/80263] New: gcc's internal type "sizetype" leaks out as base type name in the DWARF info
- From: "palves at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 30 Mar 2017 13:40:34 +0000
- Subject: [Bug debug/80263] New: gcc's internal type "sizetype" leaks out as base type name in the DWARF info
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80263
Bug ID: 80263
Summary: gcc's internal type "sizetype" leaks out as base type
name in the DWARF info
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
Assignee: unassigned at gcc dot gnu.org
Reporter: palves at redhat dot com
Target Milestone: ---
In the full example below, note:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<1><2d>: Abbrev Number: 4 (DW_TAG_base_type)
<2e> DW_AT_byte_size : 8
<2f> DW_AT_encoding : 7 (unsigned)
<30> DW_AT_name : (indirect string, offset: 0x6): sizetype
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AFAICT, this "sizetype" is one of the internal types (sizetype, ssizetype,
bitsizetype and sbitsizetype) that GCC uses for expressions dealing with size.
Full log:
$ cat sizetype.c
char array[1];
$ /opt/gcc/bin/gcc sizetype.c -o sizetype -g -c && readelf --debug-dump=info
sizetype
Contents of the .debug_info section:
Compilation Unit @ offset 0x0:
Length: 0x4d (32-bit)
Version: 4
Abbrev Offset: 0x0
Pointer Size: 8
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
<c> DW_AT_producer : (indirect string, offset: 0x2a): GNU C11 7.0.1
20170321 (experimental) -mtune=generic -march=x86-64 -g
<10> DW_AT_language : 12 (ANSI C99)
<11> DW_AT_name : (indirect string, offset: 0xf): sizetype.c
<15> DW_AT_comp_dir : (indirect string, offset: 0x1a): /home/pedro/tmp
<19> DW_AT_stmt_list : 0x0
<1><1d>: Abbrev Number: 2 (DW_TAG_array_type)
<1e> DW_AT_type : <0x34>
<22> DW_AT_sibling : <0x2d>
<2><26>: Abbrev Number: 3 (DW_TAG_subrange_type)
<27> DW_AT_type : <0x2d>
<2b> DW_AT_upper_bound : 0
<2><2c>: Abbrev Number: 0
<1><2d>: Abbrev Number: 4 (DW_TAG_base_type)
<2e> DW_AT_byte_size : 8
<2f> DW_AT_encoding : 7 (unsigned)
<30> DW_AT_name : (indirect string, offset: 0x6): sizetype
<1><34>: Abbrev Number: 4 (DW_TAG_base_type)
<35> DW_AT_byte_size : 1
<36> DW_AT_encoding : 6 (signed char)
<37> DW_AT_name : (indirect string, offset: 0x70): char
<1><3b>: Abbrev Number: 5 (DW_TAG_variable)
<3c> DW_AT_name : (indirect string, offset: 0x0): array
<40> DW_AT_decl_file : 1
<41> DW_AT_decl_line : 1
<42> DW_AT_type : <0x1d>
<46> DW_AT_external : 1
<46> DW_AT_location : 9 byte block: 3 1 0 0 0 0 0 0 0 (DW_OP_addr: 1)
<1><50>: Abbrev Number: 0
$ /opt/gcc/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/opt/gcc/bin/gcc
COLLECT_LTO_WRAPPER=/opt/gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/pedro/src/gcc/src/configure --disable-bootstrap
--prefix=/opt/gcc CFLAGS='-g3 -O0' CXXFLAGS='-g3 -O0' --enable-checking=release
--enable-languages=c,c++,lto
Thread model: posix
gcc version 7.0.1 20170321 (experimental) (GCC)