https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93865

            Bug ID: 93865
           Summary: .debug_line with LTO refers to bogus file-names
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

Consider

.../t.c
.../tmp/t.c
.../a/

within the respective directories containing t.c do

gcc -c t.c -g -flto

then inside a/ do

gcc ../t.o ../tmp/t.o -g -flto

when you inspect a.out you'll see

 <0><d2>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <d3>   DW_AT_producer    : (indirect string, offset: 0x1e4): GNU 
GIMPLE 9.2.0 -mtune=generic -march=x86-64 -g -fno-openmp -fno-openacc
-fno-pie -fltrans
    <d7>   DW_AT_language    : 12       (ANSI C99)
    <d8>   DW_AT_name        : (indirect string, offset: 0x1d0):
<artificial>
    <dc>   DW_AT_comp_dir    : (indirect string, offset: 0x1dd): /tmp/a
...
    <f0>   DW_AT_stmt_list   : 0xe9

  Offset:                      0xe9
...
 The Directory Table is empty.

 The File Name Table (offset 0x105):
  Entry Dir     Time    Size    Name
  1     0       0       0       t.c

so .debug_line lost the fact that we have two distinct t.c files and the
debugger has no way of actually finding it since we point it at /tmp/a

Reply via email to