Hi, I am trying to debug my llvm pass called -aa-eval-garg11 using gdb. However I am not able to establish a breakpoint in any function of my pass. I have compiled my pass with a debug build and I have also compiled the input file (using llvm-gcc) with the -g flag. Given below is the exact output. (gdb) break llvm::PassManager::run Breakpoint 1 at 0x86be87c: file /home/engr/cs426/llvm/llvm-2.6/lib/VMCore/PassManager.cpp, line 1558. (gdb) run pointer.bc -load ../Debug/lib/libMP1.so -basicaa -aa-eval-garg11 Starting program: /home/engr/cs426/llvm/llvm-2.6-x86/Debug/bin/opt pointer.bc -load ../Debug/lib/libMP1.so -basicaa -aa-eval-garg11 [Thread debugging using libthread_db enabled] Breakpoint 1, llvm::PassManager::run (this=0xbfffe6f0, M=...) at /home/engr/cs426/llvm/llvm-2.6/lib/VMCore/PassManager.cpp:1558 1558 return PM->run(M); (gdb) break llvm::AAEvalTemp::PointsToFunc Can't find member of namespace, class, struct, or union named "llvm::AAEvalTemp::PointsToFunc" Hint: try 'llvm::AAEvalTemp::PointsToFunc<TAB> or 'llvm::AAEvalTemp::PointsToFunc<ESC-?> (Note leading single quote.) Make breakpoint pending on future shared library load? (y or [n]) n Is there some clear mistake in my way of using the gdb ? Thanks. Pranav -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100418/2e8e3c1c/attachment.html>
Pranav Garg wrote:> Hi, > > I am trying to debug my llvm pass called -aa-eval-garg11 using gdb. > However I am not able to establish a breakpoint in any function of my > pass. I have compiled my > pass with a debug build and I have also compiled the input file (using > llvm-gcc) with the -g flag. Given below is the exact output. > > > (gdb) break llvm::PassManager::run > Breakpoint 1 at 0x86be87c: file > /home/engr/cs426/llvm/llvm-2.6/lib/VMCore/PassManager.cpp, line 1558. > (gdb) run pointer.bc -load ../Debug/lib/libMP1.so -basicaa -aa-eval-garg11 > Starting program: /home/engr/cs426/llvm/llvm-2.6-x86/Debug/bin/opt > pointer.bc -load ../Debug/lib/libMP1.so -basicaa -aa-eval-garg11 > [Thread debugging using libthread_db enabled] > > Breakpoint 1, llvm::PassManager::run (this=0xbfffe6f0, M=...) at > /home/engr/cs426/llvm/llvm-2.6/lib/VMCore/PassManager.cpp:1558 > 1558 return PM->run(M); > (gdb) break llvm::AAEvalTemp::PointsToFunc > Can't find member of namespace, class, struct, or union named > "llvm::AAEvalTemp::PointsToFunc" > Hint: try 'llvm::AAEvalTemp::PointsToFunc<TAB> or > 'llvm::AAEvalTemp::PointsToFunc<ESC-?> > (Note leading single quote.) > Make breakpoint pending on future shared library load? (y or [n]) n > > > Is there some clear mistake in my way of using the gdb ?Are you sure that your pass is declared within the llvm namespace? Use the nm program on libMP1.so to see if AAEvalTemp::PointsToFunc is declared in the llvm namespace or not. Note: you may need to pipe the output of nm through c++filt to get readable results. -- John T.> > Thanks. > Pranav
Hi John, Yes, it was the problem of the namespace. Sorry for bugging for such a silly mistake. Thanks Pranav On Mon, Apr 19, 2010 at 9:33 AM, John Criswell <criswell at uiuc.edu> wrote:> Pranav Garg wrote: > >> Hi, >> >> I am trying to debug my llvm pass called -aa-eval-garg11 using gdb. >> However I am not able to establish a breakpoint in any function of my pass. >> I have compiled my >> pass with a debug build and I have also compiled the input file (using >> llvm-gcc) with the -g flag. Given below is the exact output. >> >> >> (gdb) break llvm::PassManager::run >> Breakpoint 1 at 0x86be87c: file >> /home/engr/cs426/llvm/llvm-2.6/lib/VMCore/PassManager.cpp, line 1558. >> (gdb) run pointer.bc -load ../Debug/lib/libMP1.so -basicaa -aa-eval-garg11 >> Starting program: /home/engr/cs426/llvm/llvm-2.6-x86/Debug/bin/opt >> pointer.bc -load ../Debug/lib/libMP1.so -basicaa -aa-eval-garg11 >> [Thread debugging using libthread_db enabled] >> >> Breakpoint 1, llvm::PassManager::run (this=0xbfffe6f0, M=...) at >> /home/engr/cs426/llvm/llvm-2.6/lib/VMCore/PassManager.cpp:1558 >> 1558 return PM->run(M); >> (gdb) break llvm::AAEvalTemp::PointsToFunc >> Can't find member of namespace, class, struct, or union named >> "llvm::AAEvalTemp::PointsToFunc" >> Hint: try 'llvm::AAEvalTemp::PointsToFunc<TAB> or >> 'llvm::AAEvalTemp::PointsToFunc<ESC-?> >> (Note leading single quote.) >> Make breakpoint pending on future shared library load? (y or [n]) n >> >> >> Is there some clear mistake in my way of using the gdb ? >> > > Are you sure that your pass is declared within the llvm namespace? Use the > nm program on libMP1.so to see if AAEvalTemp::PointsToFunc is declared in > the llvm namespace or not. Note: you may need to pipe the output of nm > through c++filt to get readable results. > > -- John T. > > >> Thanks. >> Pranav >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100420/9f03ebcd/attachment.html>