[PATCH] [gas] Emit v2 .debug_line for -gdwarf-2

Tom de Vries tdevries@suse.de
Tue Jan 31 12:26:20 GMT 2023


On 1/31/23 12:55, Andreas Schwab wrote:
> On Jan 31 2023, Tom de Vries via Binutils wrote:
> 
>> Fix this by emitting a v3 .debug_line contribution instead.
> 
> s/v3/v2/?
> 

Hi Andreas,

thanks for the review.

Fixed the typo.

>> diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
>> index c7d9e8ef72f..e6c411426af 100644
>> --- a/gas/dwarf2dbg.c
>> +++ b/gas/dwarf2dbg.c
>> @@ -88,7 +88,7 @@
>>   
>>   /* This implementation outputs version 3 .debug_line information.  */
>>   #ifndef DWARF2_LINE_VERSION
>> -#define DWARF2_LINE_VERSION (dwarf_level > 3 ? dwarf_level : 3)
>> +#define DWARF2_LINE_VERSION dwarf_level
> 
> Seems like the comment is no longer accurate.
> 

I've updated the comment, and I've also updated the macro definition to:
...
#define DWARF2_LINE_VERSION DWARF2_VERSION
...

In gas/config/tc-ia64.h we override DWARF2_VERSION, and using 
DWARF2_VERSION rather than dwarf_level for DWARF2_LINE_VERSION makes 
sure that we keep the same version in .debug_info and .debug_line (well, 
as long as DWARF2_LINE_VERSION isn't overridden).

Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gas-Emit-v2-.debug_line-for-gdwarf-2.patch
Type: text/x-patch
Size: 6674 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20230131/d4829393/attachment.bin>


More information about the Binutils mailing list