llvm-tutor
llvm-tutor copied to clipboard
Please add more detail about how to use gdb to debug pass
I follow your guide about how to debug using gdb on ubuntu. But my gdb cannot see the source file. I using following command:
clang -emit-llvm -S -O1 input_for_mba.c -o input_for_mba.ll
gdb --args opt -S -load-pass-plugin ../build/lib/libMBAAdd.so -passes=mba-add input_for_mba.ll
b ../lib/MBAAdd.cpp:MBAAdd::run
gdb said: No source file named ../lib/MBAAdd.cpp.
(gdb) info source No current source file.
Please help me. thanks a lot
Hi @wuxiaoqiang12 , thank for creating this issue!
The instructions in REDME.md recommend this:
b MBAAdd.cpp:MBAAdd::run
Any particular reason to use this instead:
b ../lib/MBAAdd.cpp:MBAAdd::run
? Also, there is no MBAAdd.cpp in the lib sub directory. That's why gdb is failing.
It helps to type y (i.e., yes) as the answer to "Make breakpoint pending on future shared library load? (y or [n])" that follows "No source file named ...".