<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/101039>101039</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`llvm-dwp` reports an error when given a simple program
</td>
</tr>
<tr>
<th>Labels</th>
<td>
tools:llvm-dwp
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
cjdb
</td>
</tr>
</table>
<pre>
# Problem
`llvm-dwp` reports an error when given a simple program, regardless of compiler.
# System info
* Current system: Debian
* Also observed on Ubuntu 24.04 with LLVM 19 from apt.llvm.org
* Also observed on Arch Linux
```
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/cjdb/opt/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --enable-lto --prefix=/home/cjdb/opt --disable-nls --enable-languages=c,c++ --enable-gold --disable-multilib --disable-werror : (reconfigured) ../gcc/configure --enable-lto --prefix=/home/cjdb/opt --disable-nls --enable-gold --disable-multilib --disable-werror CC=gcc CFLAGS='-g0 -O3 -DNDEBUG' LDFLAGS=-fuse-ld=gold CXX=g++ CXXFLAGS='-g0 -O3 -DNDEBUG' --enable-languages=c,c++,lto --no-create --no-recursion
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240621 (experimental) (GCC)
```
```
$ clang -v
clang version 20.0.0git (/home/cjdb/projects/llvm-project/clang 135a1e90a3066f61ca741e9ebebfec79c9595ea5)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cjdb/opt/bin
Found candidate GCC installation: /home/cjdb/opt/bin/../lib/gcc/x86_64-pc-linux-gnu/14.0.1
Found candidate GCC installation: /home/cjdb/opt/bin/../lib/gcc/x86_64-pc-linux-gnu/15.0.0
Selected GCC installation: /home/cjdb/opt/bin/../lib/gcc/x86_64-pc-linux-gnu/15.0.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
```
```
$ llvm-dwp --version
LLVM (http://llvm.org/):
LLVM version 20.0.0git
Optimized build.
```
# Examples
**GCC**
```
$ cat hello.cpp
#include <iostream>
int main()
{
int a;
std::cin >> a;
std::cout << (a + 1) << '\n';
}
$ g++ -c -o hello.o hello.cpp -g -gsplit-dwarf
$ g++ -c -o hello.o hello.cpp -g -gsplit-dwarf -fuse-ld=lld
$ g++ -o hello hello.o -fuse-ld=lld
$ ./hello
10
11
$ llvm-dwp -e hello
while processing dwarf streamer init:
error: : No such file or directory
```
**Clang**
```
$ ls
hello hello.cpp hello.dwo hello.o
$ rm hello hello.dwo hello.o
$ clang++ -c -o hello.o hello.cpp -g -gsplit-dwarf -fuse-ld=lld
clang++: warning: argument unused during compilation: '-fuse-ld=lld' [-Wunused-command-line-argument]
$ clang++ -o hello hello.o -fuse-ld=lld
$ ./hello
13
14
$ llvm-dwp -e hello
while processing dwarf streamer init:
error: : No such file or directory
```
# Related issues
https://sourceware.org/bugzilla/show_bug.cgi?id=32032
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMV0lv4zgW_jX05UGGRMpWfPDBkeNgAE-nUJWazi2gyGeZPRQpkFScql8_oCQ7zl7oxjQaCGIub1--J3LvVW0Ql2R2SWbrCe_C3rql-ENWk8rKH0tCGXxxttLYkHRN0tX4f55q_dAk8tCSeQoOW-uCB24AnbMODns0UKsHNMDBq6bVCK2zteMNoSU4rLmTGr0HuwNhm1ZpdNNnGiiDbz98wAaU2dnnVysoO-fQBPA9CWErWGOluHmiWGlvwVYe3QNKsAa-V50JHdB8muZwUGEP2-1__g3ZAnbONsDbMI0-Ta2rP5CycmIPW2W6R3gRkPFvZM2hFgKSh2H_3StTQ9UpHRJlwLco_OhuebPdXpW399dlSdi6FuL58fb25v73r6svX66-ErYmdLO3DRK6iSkidGPbQOhGqwofURC6ifx083gxv5_nSSsSHS1NatMRuslm03SaRvJgk4PjbYtuUHbLXY0hRvEt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