User forums > Using Code::Blocks
Running debugger on custom Makefile based project
Wyrm:
I would greatly appreciate anyone's help on this.
I have a large project (LLVM+Clang compiler) that I would like to debug in CB. LLVM/Clang is an open source compiler and you can find info online. I am COMPILING this compiler with g++ not running it from under CB. The source code of LLVM/Clang, like many other projects, relies on standard Linux configure+make utilities to build. I have loaded the files into CB, set the custom Makefile to be used for compilation. CB seems to have successfully compiled it and generated the Clang binaries.
However, I can not get the debugger to run the output executable. For the custom Makefile to work I had to set target to "all". Otherwise, makefile wouldn't recognize the target. However, CB seems to expect the target to be the output executable in order to launch the debugger (gdb).
I've looked through the user guide and browsed help online but I can't seem to find it how to configure the debugger to run the output executable (different from the target) with my command line options.
Thanks for your help.
Jenna:
Did you change "Project -> Properties -> Build targets -> [the debug target] -> Output filename" to the executables name and path ?
Also take care that the "Execution working dir:" is set correctly and the both "Auto-generate filename ..." checkboxes are unchecked.
Wyrm:
--- Quote from: jens on November 08, 2010, 07:40:38 am ---Did you change "Project -> Properties -> Build targets -> [the debug target] -> Output filename" to the executables name and path ?
Also take care that the "Execution working dir:" is set correctly and the both "Auto-generate filename ..." checkboxes are unchecked.
--- End quote ---
Yes I did set those. When I click Debug->Start CB does a successful rebuild and prints the following in the "Debugger" window:
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
all
Adding source dir: /home/project/codeblocks/llvm/
Adding source dir: /home/project/codeblocks/
After that nothing is happening. Debug->"Stop Debugger" is inactive while Debug->Start remains active.
I have put a printf() with a breakpoint right at the start of main(). However, the debugger seems to do nothing. It doesn't appear to be launching the binary with gdb. Gdb is installed - I can run the generated binary through gdb in the standalone console, but can not get CB to run it. It just ignores me.
Any other ideas of what could go wrong? Does it require the target to be named "Debug"?
Jenna:
Please check "Settings -> Compiler and debugger... -> Debugger settings -> Display debuggers's log" and post the content of the "Debugger (debug)" log.
And please put it in code-tags (to be created wth the hash-sign).
Wyrm:
--- Quote from: jens on November 08, 2010, 08:14:31 am ---Please check "Settings -> Compiler and debugger... -> Debugger settings -> Display debuggers's log" and post the content of the "Debugger (debug)" log.
And please put it in code-tags (to be created wth the hash-sign).
--- End quote ---
Unfortunately, "Debugger (debug)" log opens up but stays blank, so the log is not very helpful either.
Navigation
[0] Message Index
[#] Next page
Go to full version