Bug 22003 - Incompatibility with -gdwarf-5 - DW_FORM_implicit_const
Summary: Incompatibility with -gdwarf-5 - DW_FORM_implicit_const
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: symtab (show other bugs)
Version: 8.0
: P2 normal
Target Milestone: 8.0.1
Assignee: Jan Kratochvil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-24 14:38 UTC by Jan Kratochvil
Modified: 2017-08-24 14:43 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2017-08-24 14:38:39 UTC
DWARF-5 implemented in 8.0 has a bug:

-gdwarf-4:
ptype logical
type = const char [2]
(gdb) PASS: gdb.base/constvars.exp: ptype logical

-gdwarf-5:
ptype logical
type = const char []
(gdb) FAIL: gdb.base/constvars.exp: ptype logical

 <2><2fc>: Abbrev Number: 1 (DW_TAG_variable)
    <2fd>   DW_AT_name        : (indirect string, offset: 0x2eb): logical
    <301>   DW_AT_decl_file   : 1

   1      DW_TAG_variable    [no children]
    DW_AT_name         DW_FORM_strp
    DW_AT_decl_file    DW_FORM_implicit_const: 1

During symbol reading, invalid attribute class or form for 'DW_FORM_implicit_const' in '(null)'.
Comment 1 Sourceware Commits 2017-08-24 14:40:55 UTC
The master branch has been updated by Jan Kratochvil <jkratoch@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=663c44ac4d4336e99c282705b1d289b365b273d3

commit 663c44ac4d4336e99c282705b1d289b365b273d3
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 24 16:39:11 2017 +0200

    DWARF-5 Fix DW_FORM_implicit_const
    
    -gdwarf-4:
    ptype logical
    type = const char [2]
    (gdb) PASS: gdb.base/constvars.exp: ptype logical
    
    -gdwarf-5:
    ptype logical
    type = const char []
    (gdb) FAIL: gdb.base/constvars.exp: ptype logical
    
     <2><2fc>: Abbrev Number: 1 (DW_TAG_variable)
        <2fd>   DW_AT_name        : (indirect string, offset: 0x2eb): logical
        <301>   DW_AT_decl_file   : 1
    
       1      DW_TAG_variable    [no children]
        DW_AT_name         DW_FORM_strp
        DW_AT_decl_file    DW_FORM_implicit_const: 1
    
    During symbol reading, invalid attribute class or form for
    'DW_FORM_implicit_const' in '(null)'.
    
    gdb/ChangeLog
    2017-08-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	PR symtab/22003
    	* dwarf2read.c (dwarf2_const_value_attr, dump_die_shallow)
    	(dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes)
    	(skip_form_bytes, attr_form_is_constant): Handle DW_FORM_implicit_const.
Comment 2 Sourceware Commits 2017-08-24 14:42:30 UTC
The gdb-8.0-branch branch has been updated by Jan Kratochvil <jkratoch@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f74f69f45570ced87b9f778983a63157b551a129

commit f74f69f45570ced87b9f778983a63157b551a129
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 24 16:39:11 2017 +0200

    DWARF-5 Fix DW_FORM_implicit_const
    
    -gdwarf-4:
    ptype logical
    type = const char [2]
    (gdb) PASS: gdb.base/constvars.exp: ptype logical
    
    -gdwarf-5:
    ptype logical
    type = const char []
    (gdb) FAIL: gdb.base/constvars.exp: ptype logical
    
     <2><2fc>: Abbrev Number: 1 (DW_TAG_variable)
        <2fd>   DW_AT_name        : (indirect string, offset: 0x2eb): logical
        <301>   DW_AT_decl_file   : 1
    
       1      DW_TAG_variable    [no children]
        DW_AT_name         DW_FORM_strp
        DW_AT_decl_file    DW_FORM_implicit_const: 1
    
    During symbol reading, invalid attribute class or form for
    'DW_FORM_implicit_const' in '(null)'.
    
    gdb/ChangeLog
    2017-08-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	PR symtab/22003
    	* dwarf2read.c (dwarf2_const_value_attr, dump_die_shallow)
    	(dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes)
    	(skip_form_bytes, attr_form_is_constant): Handle DW_FORM_implicit_const.
Comment 3 Jan Kratochvil 2017-08-24 14:43:40 UTC
Checked in.