Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: ordak on January 03, 2021, 08:49:15 am

Title: Debugging custom Makefile project
Post by: ordak on January 03, 2021, 08:49:15 am
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 ?
Title: Re: Debugging custom Makefile project
Post by: oBFusCATed on January 03, 2021, 12:12:50 pm
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...

Title: Re: Debugging custom Makefile project
Post by: ordak on January 03, 2021, 12:38:48 pm
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 ?
Title: Re: Debugging custom Makefile project
Post by: oBFusCATed on January 03, 2021, 02:32:36 pm
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.
Title: Re: Debugging custom Makefile project
Post by: ordak on January 05, 2021, 01:05:33 pm
I can send --debug among program's main arguments. That may help me later on.