Is it possible to debug an llvm pass using gdb? I couldn't find any docs on the llvm site.
+2
A:
Yes. Build LLVM in non-release mode (the default). It takes a bit longer than a release build, but you can use gdb to debug the resulting object file.
One note of caution: I had to upgrade my Linux box to 3GB of memory to make LLVM debug mode link times reasonable.
Richard Pennington
2010-02-09 13:20:00
But can I debug an llvm pass? LLVM passes are usually run using opt so I don't know how to use gdb to run it. Can you tell me the command?
2010-02-10 07:35:06
You can run e.g. "gdb /usr/local/bin/opt" and type "run <your command line>".
Richard Pennington
2010-02-10 11:48:56
http://llvm.org/docs/WritingAnLLVMPass.html#debughints
name
2010-09-28 14:38:15