Author Topic: Debugging a library produced with Makefile  (Read 2677 times)

Offline gmiranda

  • Single posting newcomer
  • *
  • Posts: 6
Debugging a library produced with Makefile
« on: December 07, 2011, 09:36:23 am »
Hi,

I work on a big library which is built using Makefiles. We have a script that will compile and run some tests, and I'd like to debug a function in the library.

As I haven't managed to debug setting the script command as the host application, I've tried to recreate what the script does:
· Manually compile the test program.
· Set the test program as the host application in Code::Blocks.
· As the program requires some paths to be added to LD_LIBRARY_PATH, I tried adding those to additional debugger search dirs (project options>debugger). The debugger would then try to run the program, but it wouldn't work because the additional libraries couldn't be loaded.

Then I tried to change the host application line by adding LD_LIBRARY_PATH="..." before the application path.
None of the breakpoints (2 in the library code, 1 in the application code) causes the debugger to pause program execution, and when I click on next instruction, continue, whatever button, I get this in the debugger log:
Code
Debugger name and version: GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
The program is not being run.
Debugger finished with status 0

What can I do to debug my program?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging a library produced with Makefile
« Reply #1 on: December 07, 2011, 12:50:03 pm »
Try a nightly build of the debugger's branch. See the nightly build sub-forum.

Also for the env variables you can use the environment variables plugin.
(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 gmiranda

  • Single posting newcomer
  • *
  • Posts: 6
Re: Debugging a library produced with Makefile
« Reply #2 on: December 07, 2011, 04:21:45 pm »
Thanks. I ended up creating a project inside the workspace for a test program, and at least this works. The debugger branch seems better than the trunk :)