You are not logged in.

1

Monday, May 23rd 2005, 10:19pm

debugging Qt app in Kdevelop

I'm new to Qt and Kdevelop so please bear with me.


I started with Qt designer and I built my UI and DB access, and
all the underlying code for that. Now I'd like to be able to
debug it, but I'm having trouble bringing it into Kdevelop.

I used the import qmake feature of kdevelop, which created a
.kdevelop file from the .pro file. My source code is shown,
the source files are there in both the file tree and qmake manager,
and I can run the program, but when I try to set a breakpoint I get:


No source file named main.cpp.


If I try to look at a variable I get:


No symbol "xxxx" in current context.


I went to Qmake manager build mode config screen, and the
Build Mode was set to "Release". I changed it to "Debug" and
rebuilt. There was no difference - I was still not able to debug.


Then I went and looked at the Makefile. CFLAGS had -O2 and it did
not have -g. So I changed it, taking the -O2 out and adding -g.
Rebuilt again - still no change.


Just for fun I tried it with gdb. With that I was able to set
a working breakpoint at a function entry point, but if I tried
to single step from the breakpoint it ran (like a continue):


(gdb) n
Single stepping until exit from function _ZN14TestForm7mainEv,
which has no line number information.


I still couldn't look at variables, and if I tried to look
at source it said:


(gdb) list
1 in ../sysdeps/i386/elf/start.S


I know Qt and Kdevelop work together - it shouldn't be this hard.
Where am I going wrong?


Thanks!
-larry

mishakop

Beginner

Posts: 2

Location: Finland

Occupation: Software engineer

  • Send private message

2

Tuesday, March 13th 2007, 12:02pm

KDevelop QT debug

Yes, I have the same problem. How to debug a QT project in KDevelop?

sylvaticus

Beginner

Posts: 2

Location: Ancona, Italy

  • Send private message

3

Friday, March 16th 2007, 9:42am

Same problem here.. on Debian etch importing a previous project or even creating the default qmake based project with kdevelop cause gdb to not see correctly the source files.

I don't know if it is a probelm of kdevelop or of qmake ????

The problem is surelly on the ending dot..

I have:
No source file named /data/Projects/tests/test9/src/main.cpp.
Hovewer I have the file /data/Projects/tests/test9/src/main.cpp

sylvaticus

Beginner

Posts: 2

Location: Ancona, Italy

  • Send private message

4

Friday, March 16th 2007, 10:01am

I solved following here: http://lists.kde.org/?l=kdevelop&m=111673777924574&w=2

> QMake manager -> top window -> select src (or the subproject) -> Right mouse
> click -> settings->second tab:configuration->build mode.

Really it was already in debug mode.. I had to place it on release and then again on debug to have it working...

This post has been edited 1 times, last edit by "sylvaticus" (Mar 16th 2007, 10:02am)


mishakop

Beginner

Posts: 2

Location: Finland

Occupation: Software engineer

  • Send private message

5

Friday, March 16th 2007, 10:06am

I moved a little off from the initial point. I was able to put a breakpoint, at which the program really stopped, and even could be stepped through.

The central idea here is to set the qmake project to the debug mode. In KDevelop, find the QMake Manager popup pane at the right side of the editor. Right click the current subproject and choose Subproject settings -> Configuration ->Build Mode. Change it to "debug". Rebuild the project.

Also, if you compile KDevelop from source, the configure option --with-debug must be enabled.

However, the debug stepping refuses to move on once the end of the current function is reached. ?(