<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - source file directory in -g DWARF incorrect for .s vs .c"
href="https://bugs.llvm.org/show_bug.cgi?id=34713">34713</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>source file directory in -g DWARF incorrect for .s vs .c
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>roland@hack.frob.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, phosek@chromium.org
</td>
</tr></table>
<p>
<div>
<pre>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 %</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>