[PATCH] Ignore DWARF debug information for -gsplit-dwarf with dwarf-5.

Potharla, Rupesh Rupesh.Potharla@amd.com
Thu Sep 29 15:54:51 GMT 2022
[Public]

Jan,


.debug_info contents:
0x00000000: Compile Unit: length = 0x00000031, format = DWARF32, version = 0x0005, unit_type = DW_UT_skeleton, abbr_offset = 0x0000, addr_size = 0x08, DWO_id = 0xcd97775ca070a83c (next unit at 0x00000035)

The issue is seen with both clang and gcc.  Above is the Debug_info header of a program compiled with gcc using -gsplit-dwarf and dwarf-5.
There are two other fields(abbr_offset and addr_Size) after unit_type in the header.  Skipping the dwo_id field in the previous check of unit_type will not fix the issue.

Regards,
Rupesh P

>-----Original Message-----
>From: Jan Beulich <jbeulich@suse.com>
>Sent: Thursday, September 29, 2022 8:31 PM
>To: Potharla, Rupesh <Rupesh.Potharla@amd.com>
>Cc: George, Jini Susan <JiniSusan.George@amd.com>; Parasuraman,
>Hariharan <Hariharan.Parasuraman@amd.com>; Kumar N, Bhuvanendra
><Bhuvanendra.KumarN@amd.com>; Potharla, Rupesh via Binutils
><binutils@sourceware.org>
>Subject: Re: [PATCH] Ignore DWARF debug information for -gsplit-dwarf with
>dwarf-5.
>
>Caution: This message originated from an External Source. Use proper caution
>when opening attachments, clicking links, or responding.
>
>
>On 29.09.2022 14:43, Potharla, Rupesh via Binutils wrote:
>> --- a/bfd/dwarf2.c
>> +++ b/bfd/dwarf2.c
>> @@ -4441,6 +4441,10 @@ parse_comp_unit (struct dwarf2_debug *stash,
>>        return NULL;
>>      }
>>
>> +  /* Skip DWO_id field.  */
>> +  if (unit_type == DW_UT_skeleton)
>> +    info_ptr += 8;
>> +
>>    /* Read the abbrevs for this compilation unit into a table.  */
>>    abbrevs = read_abbrevs (abfd, abbrev_offset, stash, file);
>>    if (! abbrevs)
>
>A few lines up from here there's already a check of unit_type against
>DW_UT_type. May I suggest to convert that to switch() and add your new
>code there in form of a separate case block?
>
>Jan



More information about the Binutils mailing list