News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Debugging custom Makefile project

Started by ordak, January 03, 2021, 08:49:15 AM

Previous topic - Next topic

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 ?
Code::Blocks SVN
OS : Ubuntu LTS

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...

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

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 ?
Code::Blocks SVN
OS : Ubuntu LTS

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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

ordak

I can send --debug among program's main arguments. That may help me later on.
Code::Blocks SVN
OS : Ubuntu LTS