Function "llvm::PassManager::run" not defined.

Hi,

I am trying to use GDB for debugging my llvm pass. I am following the documentation http://llvm.org/docs/WritingAnLLVMPass.html. When i am doing this the following error and warning messages I am getting. I tried to remove the warning by apt-get install libc6-dbg:i386 command for updating the libc6 but still getting the same.

Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “x86_64-linux-gnu”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type “help”.
Type “apropos word” to search for commands related to “word”…
Reading symbols from opt…done.
(gdb) break llvm::PassManager::run
Function “llvm::PassManager::run” not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (llvm::PassManager::run) pending.
(gdb) run /home/manideepa/Desktop/research/compiler/testing/matmul.bc -load …/lib/loop_graph_analysis.so -loop-graph-analysis
Starting program: /home/manideepa/Desktop/research/compiler/llvm-3.4/Debug+Asserts/bin/opt /home/manideepa/Desktop/research/compiler/testing/matmul.bc -load …/lib/loop_graph_analysis.so -loop-graph-analysis
warning: the debug information found in “/lib64/ld-2.19.so” does not match “/lib64/ld-linux-x86-64.so.2” (CRC mismatch).

[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.
Traceback (most recent call last):
File “/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py”, line 63, in
from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named ‘libstdcxx’
WARNING: You’re attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f’ option.

opt: loop_graph_new.cpp:245: void ::LoopGraphAnalysisPass::AddDataEdges(llvm::Loop *, unsigned int): Assertion `loopGraph != graphs.end()’ failed.

Program received signal SIGABRT, Aborted.
0x00007ffff69c7cc9 in __GI_raise (sig=sig@entry=6) at …/nptl/sysdeps/unix/sysv/linux/raise.c:56
56 …/nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.

Please help.

Are you able to run your pass successfully? Are you getting this error only while debugging?

Regards,
Suyog Sarda

Hi,

I am trying to use GDB for debugging my llvm pass. I am following the documentation http://llvm.org/docs/WritingAnLLVMPass.html. When i am doing this the following error and warning messages I am getting. I tried to remove the warning by apt-get install libc6-dbg:i386 command for updating the libc6 but still getting the same.

Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “x86_64-linux-gnu”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type “help”.
Type “apropos word” to search for commands related to “word”…
Reading symbols from opt…done.
(gdb) break llvm::PassManager::run
Function “llvm::PassManager::run” not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (llvm::PassManager::run) pending.
(gdb) run /home/manideepa/Desktop/research/compiler/testing/matmul.bc -load …/lib/loop_graph_analysis.so -loop-graph-analysis
Starting program: /home/manideepa/Desktop/research/compiler/llvm-3.4/Debug+Asserts/bin/opt /home/manideepa/Desktop/research/compiler/testing/matmul.bc -load …/lib/loop_graph_analysis.so -loop-graph-analysis
warning: the debug information found in “/lib64/ld-2.19.so” does not match “/lib64/ld-linux-x86-64.so.2” (CRC mismatch).

[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.
Traceback (most recent call last):
File “/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py”, line 63, in
from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named ‘libstdcxx’
WARNING: You’re attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f’ option.

opt: loop_graph_new.cpp:245: void ::LoopGraphAnalysisPass::AddDataEdges(llvm::Loop *, unsigned int): Assertion `loopGraph != graphs.end()’ failed.

Program received signal SIGABRT, Aborted.
0x00007ffff69c7cc9 in __GI_raise (sig=sig@entry=6) at …/nptl/sysdeps/unix/sysv/linux/raise.c:56
56 …/nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.

Please help.

I wonder if it is not linked to the work on the new PassManager.

Can you try: break llvm::legacy::PassManager::run

Hi,

The break command I gave you solve your problem. But now you are not running the right “run” command, it seems to me that you missed the -load option.

Hi,

At this point your debugger is running and you were able to break into LLVM at the place you wanted. I’m not sure what you are trying to accomplish now, can you clarify?
if you need help with gdb itself I think you are not on the right mailing list.