我有一台a.c
#include <stdio.h>
int main() {
int a = 1;
int b = 2;
int c = a + b;
return 0;
}
当使用clang -g a.c
编译时,我无法获得调试符号。
joey@voyager-arch /t/a4> lldb a.out
(lldb) target create "a.out"
Current executable set to '/tmp/a4/a.out' (x86_64).
(lldb) l
(lldb)
但是如果我用的是gcc,我可以成功的得到调试符号,用gcc -g a.c
编译
joey@voyager-arch /t/a4> gdb a.out
GNU gdb (GDB) 11.1
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.out...
(gdb) l
1 #include <stdio.h>
2
3 int main() {
4 int a = 1;
5 int b = 2;
6 int c = a + b;
7 return 0;
8 }
(gdb)
我使用的是具有amd ryzen 7 cpu的archlinux。
clang: 12.0.1
lldb: 12.0.1
gcc: 11.1.0
gdb: 11.1
发布于 2021-09-28 11:28:12
可能是lldb 12不兼容的bug,降级到lldb 10解决了这个问题。
https://stackoverflow.com/questions/69355902
复制相似问题