Author Topic: Debugging custom Makefile project  (Read 2028 times)

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 105
    • My Site
Debugging custom Makefile project
« 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 ?
Code::Blocks SVN
OS : Ubuntu LTS

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: Debugging custom Makefile project
« Reply #1 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...

(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!]

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 105
    • My Site
Re: Debugging custom Makefile project
« Reply #2 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 ?
Code::Blocks SVN
OS : Ubuntu LTS

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: Debugging custom Makefile project
« Reply #3 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.
(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!]

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 105
    • My Site
Re: Debugging custom Makefile project
« Reply #4 on: January 05, 2021, 01:05:33 pm »
I can send --debug among program's main arguments. That may help me later on.
Code::Blocks SVN
OS : Ubuntu LTS