User forums > Using Code::Blocks

Debugging custom Makefile project

(1/1)

ordak:
Hi,

I have a GTK+ project with a custom Makefile. How can I use a debugger in Code::Blocks for this project ?

I did:

Add -g flag to CFLAGS in Makefile. I duplicated "all" in build targets. Changed type to GUI application. What more should I do to get it work ?

oBFusCATed:
What happens when you try to debug?

If I remember correctly you have to set a host app path in the Project -> Set programs' arguments...

ordak:
I can debug from command line. But Code::Blocks debugging buttons are inactive. Can you give me instructions about what to do in host app ?

oBFusCATed:
Can you debug a simple console project which uses the C::B's build system?

I've not tried these, but I think you need to make sure that
1. You have a compiler selected for your project (it would not be used for building, but it will be used for other stuff)
2. This compiler must have a working debugger configuration selected
3. Set the host app path to be the path where your executable is generated by your makefile
4. Setup execution directory in the Project -> Properties -> your target

2 is important only if you have "Debug -> Active debuggers -> Target's default" selected.

ordak:
I can send --debug among program's main arguments. That may help me later on.

Navigation

[0] Message Index

Go to full version