[llvm-bugs] [Bug 34713] New: source file directory in -g DWARF incorrect for .s vs .c

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Sep 23 19:37:18 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=34713

            Bug ID: 34713
           Summary: source file directory in -g DWARF incorrect for .s vs
                    .c
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: roland at hack.frob.com
                CC: llvm-bugs at lists.llvm.org, phosek at chromium.org

The DWARF .debug_line file entry for a .s file is `basename $file`
while for a .c file it's $file as it should be.

frobland 691 % head ../../foo.s ../../bar.c
==> ../../foo.s <==
nop

==> ../../bar.c <==
void bar(void) {}
frobland 692 % ../../buildtools/linux-x64/clang/bin/clang
-no-canonical-prefixes --target=x86_64-fuchsia -g -c ../../foo.s ../../bar.c
frobland 693 % readelf --debug-dump=line foo.o bar.o

File: foo.o
Raw dump of debug contents of section .debug_line:

  Offset:                      0x0
  Length:                      51
  DWARF Version:               2
  Prologue Length:             28
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  1
  Line Base:                   -5
  Line Range:                  14
  Opcode Base:                 13

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 args
  Opcode 3 has 1 args
  Opcode 4 has 1 args
  Opcode 5 has 1 args
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 args
  Opcode 10 has 0 args
  Opcode 11 has 0 args
  Opcode 12 has 1 args

 The Directory Table is empty.

 The File Name Table (offset 0x1c):
  Entry Dir     Time    Size    Name
  1     0       0       0       foo.s

 Line Number Statements:
  [0x00000026]  Extended opcode 2: set Address to 0x0
  [0x00000031]  Copy
  [0x00000032]  Advance PC by 1 to 0x1
  [0x00000034]  Extended opcode 1: End of Sequence



File: bar.o
Raw dump of debug contents of section .debug_line:

  Offset:                      0x0
  Length:                      61
  DWARF Version:               2
  Prologue Length:             34
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  1
  Line Base:                   -5
  Line Range:                  14
  Opcode Base:                 13

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 args
  Opcode 3 has 1 args
  Opcode 4 has 1 args
  Opcode 5 has 1 args
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 args
  Opcode 10 has 0 args
  Opcode 11 has 0 args
  Opcode 12 has 1 args

 The Directory Table (offset 0x1b):
  1     ../..

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

 Line Number Statements:
  [0x0000002c]  Extended opcode 2: set Address to 0x0
  [0x00000037]  Copy
  [0x00000038]  Set column to 17
  [0x0000003a]  Set prologue_end to true
  [0x0000003b]  Special opcode 61: advance Address by 4 to 0x4 and Line by 0 to
1
  [0x0000003c]  Advance PC by 2 to 0x6
  [0x0000003e]  Extended opcode 1: End of Sequence


frobland 694 %

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170924/89a5e5da/attachment.html>


More information about the llvm-bugs mailing list