<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 - Debug information not processed if llvm-objdump reads input from standard input"
href="https://bugs.llvm.org/show_bug.cgi?id=32932">32932</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Debug information not processed if llvm-objdump reads input from standard input
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ys114321@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>When I tried to write a C based unit test for one of BPF changes, I encountered
a problem where llvm-objdump does not process debug information in the .o file
properly. The following procedure can demonstrate the problem.
[<a href="mailto:yhs@devbig474.prn1">yhs@devbig474.prn1</a> ~/work/debug_llvm/dwarf] cat test.c
int test(int *p) {
*p = 2;
return 1;
}
[<a href="mailto:yhs@devbig474.prn1">yhs@devbig474.prn1</a> ~/work/debug_llvm/dwarf] clang -g -target bpf -O2 -c test.c
[<a href="mailto:yhs@devbig474.prn1">yhs@devbig474.prn1</a> ~/work/debug_llvm/dwarf] llvm-objdump -S test.o
test.o: file format ELF64-BPF
Disassembly of section .text:
test:
; int test(int *p) {
0: b7 02 00 00 02 00 00 00 r2 = 2
; *p = 2;
1: 63 21 00 00 00 00 00 00 *(u32 *)(r1 + 0) = r2
; return 1;
2: b7 00 00 00 01 00 00 00 r0 = 1
3: 95 00 00 00 00 00 00 00 exit
[<a href="mailto:yhs@devbig474.prn1">yhs@devbig474.prn1</a> ~/work/debug_llvm/dwarf] llvm-objdump -S - < test.o
<stdin>: file format ELF64-BPF
Disassembly of section .text:
test:
0: b7 02 00 00 02 00 00 00 r2 = 2
1: 63 21 00 00 00 00 00 00 *(u32 *)(r1 + 0) = r2
2: b7 00 00 00 01 00 00 00 r0 = 1
3: 95 00 00 00 00 00 00 00 exit
[<a href="mailto:yhs@devbig474.prn1">yhs@devbig474.prn1</a> ~/work/debug_llvm/dwarf]</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>