[PATCH] D29765: Handle link of NoDebug CU with a CU that has debug emission enabled

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 13 17:19:26 PST 2017


tejohnson added a comment.

In https://reviews.llvm.org/D29765#673762, @dblaikie wrote:

> In https://reviews.llvm.org/D29765#672333, @tejohnson wrote:
>
> > In https://reviews.llvm.org/D29765#672324, @dblaikie wrote:
> >
> > > Are the locations properly respected/ignored in this case? (what does the line table end up looking like for the instructions in the nodebug inlined code?)
> >
> >
> > Here is the result of objdump -WL (let me know if there is something else you wanted to see):
> >
> > $ objdump -WL a.out
> >
> > a.out:     file format elf64-x86-64
> >
> > Decoded dump of debug contents of section .debug_line:
> >
> > CU: debug.c:
> >  File name                            Line number    Starting address
> >  debug.c                                        2                   0
> >
> > ./nodebug.c:[++]
> >  nodebug.c                                      3                 0x4
> >
> > ./debug.c:[++]
> >  debug.c                                        2                0x10
>
>
> Ah, I meant more the content of the line table (llvm-dwarfdump -debug-dump=line should show you this).


Here is the output of running the above on the new a.out generated from the included test case (with the new version of the patch I will upload momentarily):

a.out:	file format ELF64-x86-64

.debug_line contents:
Line table prologue:

  total_length: 0x0000004d
       version: 2

prologue_length: 0x0000002b
 min_inst_length: 1
 default_is_stmt: 1

    line_base: -5
   line_range: 14
  opcode_base: 13

standard_opcode_lengths[DW_LNS_copy] = 0
standard_opcode_lengths[DW_LNS_advance_pc] = 1
standard_opcode_lengths[DW_LNS_advance_line] = 1
standard_opcode_lengths[DW_LNS_set_file] = 1
standard_opcode_lengths[DW_LNS_set_column] = 1
standard_opcode_lengths[DW_LNS_negate_stmt] = 0
standard_opcode_lengths[DW_LNS_set_basic_block] = 0
standard_opcode_lengths[DW_LNS_const_add_pc] = 0
standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1
standard_opcode_lengths[DW_LNS_set_prologue_end] = 0
standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0
standard_opcode_lengths[DW_LNS_set_isa] = 1

  Dir  Mod Time   File Len   File Name
  ---- ---------- ---------- ---------------------------

file_names[  1]    0 0x00000000 0x00000000 debug.c
file_names[  2]    0 0x00000000 0x00000000 nodebug.c

Address            Line   Column File   ISA Discriminator Flags

------------------ ------ ------ ------ --- ------------- -------------

0x0000000000000000      2      0      1   0             0  is_stmt
0x0000000000000004      3      1      2   0             0  is_stmt prologue_end
0x0000000000000010      2     21      1   0             0  is_stmt
0x0000000000000014      2     21      1   0             0  is_stmt end_sequence

> 
> 
>> 
>> 
>>> Would it be worth/possible omitting these scopes from the LexicalScope tree in the first place, rather than filtering out here after-the-fact?
>> 
>> That I am not sure about, as I'm not really familiar with this code. I am hoping you will tell me. =)
> 
> I think the right place is /probably/ LexicalScopes::extractLexicalScopes (lib/CodeGen/LexicalScopes.cpp) - if it'

Uploading new patch that does that instead.


https://reviews.llvm.org/D29765





More information about the llvm-commits mailing list