News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

How to debug application compiled from an external Makefile ?

Started by rix, November 18, 2005, 11:48:14 AM

Previous topic - Next topic

rix

Hi there,

I'm working on an application based on Qt opensrc edition.
I setup the following options in my project:

  Project - Properties - [X] This is a custom Makefile
  Build - Compiler options - Others - Build method: Work with Makefiles

to be able to properly compile by using the Makefile generated by qmake.
However, when I try to debug, I get the following:

  Selecting target: default
  Compiling: failed
  Aborting debugging session

So I tried to change the following:

  Project - Properties - Target - default - Type: Command only

But in this case, I get a message "Can't debug such a target..."
I'm using C::B 1.0-rc2 + MinGW 5.0 (so independant to C::B) + gdb 5.2.1

So how can I debug through C::B but at the same time compile from an external makefile?
(my objective is in fact to be able to use qmake generated Makefiles as much as possible, while being able to use C::B wonderfull editor and debug features at the same time)

rix

... no one having an idea ? :(

Compilation from C::B is working properly (by using my existing makefile), but I'm unable to debug (either with a 'Compiling: failed' message or a 'Can't debug such a target' message)!
I really would like to use C::B to edit and debug, so if someone has any idea on how to create such a project, it would be really helpful to me.

Michael

Hello,

Just a small suggestion. May be you can try to search the C::B forum for Qt topics. There are some and may be one of them could be useful. You can also try to write an email to Qt-interest forum. May be someone can help you.

Best wishes,
Michael
 
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

mandrav

Quote from: rix on November 21, 2005, 10:17:44 AM
... no one having an idea ? :(

Compilation from C::B is working properly (by using my existing makefile), but I'm unable to debug (either with a 'Compiling: failed' message or a 'Can't debug such a target' message)!
I really would like to use C::B to edit and debug, so if someone has any idea on how to create such a project, it would be really helpful to me.

The problem lies in the debugger trying to make sure everything is built before debugging so that you 're actually debugging an up-to-date version of your code.
When you get this:
  Selecting target: default
  Compiling: failed
  Aborting debugging session


what is printed in the Build Log?
Be patient!
This bug will be fixed soon...

rix

Thank you very much for the suggestions, guys!

Quote from: mandrav on November 21, 2005, 10:58:36 AM
what is printed in the Build Log?

Well, the debugger is starting now.
In fact, the Makefile autogenerated by qmake didn't contain a 'default' rule, but only 'debug' and 'release' rules. ;)
I renamed the 'default' rule to 'debug' in C::B, and the debugger started!
However, now, I'm having the following problem:


Starting debugger: done
Adding source dir: Z:\qt_applications\current\qt\
Adding file: Z:\qt_applications\current\qt\qt_app.exe
Changing directory to: Z:/QT_APP~1/current/qt
ðò: No such file or directory.
error
error


The debugger seems to be started anyway (Debug - Debug command is grayed, and Debug - Stop debugger is enabled), but I can't use any debug commands.
Any idea on where these 'No such file or directory' and 'error' messages come from?

rix

After having a look at http://cvs.sourceforge.net/viewcvs.py/codeblocks/codeblocks/src/plugins/debuggergdb/debuggergdb.cpp?view=markup ,
seeing how the 'Changing directory to:' was displayed in DebuggerGDB::Debug(), I tried to specify 'Execution working dir' to '.', to skip this directory change.
But I always get the following:


Selecting target: debug
Compiling: done
Starting debugger: done
Adding source dir: Z:\qt_applications\current\qt\
Adding file: Z:\qt_applications\current\qt\qt_app.exe
¤ó: No such file or directory.
error
error


So it seems the problem occurs later, and is in no way related to the working dir.

mandrav

This seems like a bug in the debugger...
My suggestion is to change "qt_applications" to something less than 8 chars to see if this fixes it for you.

The debugger has been greatly improved in CVS and doesn't have the bug you mentioned.
Be patient!
This bug will be fixed soon...

rix

Quote from: mandrav on November 21, 2005, 11:35:08 AM
My suggestion is to change "qt_applications" to something less than 8 chars to see if this fixes it for you.

I changed to a smaller directory name (z:\qt), but the problem still occur... :(

Quote from: mandrav on November 21, 2005, 11:35:08 AM
The debugger has been greatly improved in CVS and doesn't have the bug you mentioned.

Ok, I think I will try to compile the CVS version. ;)

Thank you very much!