lvc / abi-dumper

Dump ABI of an ELF object containing DWARF debug info
GNU Lesser General Public License v2.1
177 stars 33 forks source link

About __restrict type #7

Closed JamesQAQ closed 8 years ago

JamesQAQ commented 8 years ago

When I tried to use abi-dumper to dump some shared library (.so). The abi-dumper will show missed type ERROR about __restrict type which was compiled by clang-3.6, but it works fine on compiling by gcc.

I've taken a look at the debug info of it, and It looks fine. There is my testing example compiled by clang-3.6:

 <2><4d>: Abbrev Number: 3 (DW_TAG_formal_parameter)
    <4e> DW_AT_location : 2 byte block: 91 70 (DW_OP_fbreg: -16)
    <51> DW_AT_name : (indirect string, offset: 0xa9): QAQ
    <55> DW_AT_decl_file : 1
    <56> DW_AT_decl_line : 9
    <57> DW_AT_type : <0x83>

 <1><83>: Abbrev Number: 8 (DW_TAG_restrict_type)
    <84>   DW_AT_type        : <0x88>

 <1><88>: Abbrev Number: 9 (DW_TAG_pointer_type)
    <89>   DW_AT_type        : <0x7c>   

 <1><7c>: Abbrev Number: 7 (DW_TAG_base_type)
    <7d> DW_AT_name : (indirect string, offset: 0xa1): int
    <81> DW_AT_encoding : 5 (signed)
    <82> DW_AT_byte_size : 4 

And after I added "restrict_type"=>"Restrict" in my %TypeType(at line 352), then it looks work fine with __restrict keyword compiled by clang-3.6.

lvc commented 8 years ago

Hello,

Thank you for pointing to the problem and for the fix.

Fixed by the commit 0e9c78aa998d063f044ccb6dd794229458296a0b (added support for Clang). Aside from your fix this commit includes some other Clang-related fixes. It will be a part of the 0.99.18 release.

Thank you.