You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, December 5th 2006, 2:45pm

debug on KDevelop 3.2

hi !
i'm a newbie of KDevelop, i have a KDE/C++ project. i want to debug it.
i can start to debug (Debug --> Start), but i can't get any information i want such as variable values (number, string...)

anybody, help me !

regard !
nhatkhang

2

Wednesday, December 6th 2006, 4:14am

RE: debug on KDevelop 3.2

hi.
i set breakpoints, start debugger. the debugger dose its mission very well.
but i can't get any normal information from it.

i can see which statement is currently carried on, the way the program executes.
but i don't know what the value of a particular variable is. nothing to show them.

i search in its IDE, there is a tab of debugger,GDB, it shows something like thread, used libraries,.... but those information dosen't help me to debug.

in VC++, i can get much more information i want.

i can't find any documents for kdevelop debugger.

can you show me how to debug or tell me where to find those docs ?

regard
nhatkhang

wachman

Beginner

Posts: 5

Location: Lublin, Poland

  • Send private message

3

Saturday, January 20th 2007, 4:39pm

RE: debug on KDevelop 3.2

I've got the same problem. Is there any tutorial or help file on how to debug Qt Applications using kdeveloper for newbies?

DrMega

Beginner

Posts: 3

Location: UK

Occupation: Developer

  • Send private message

4

Sunday, January 21st 2007, 9:06pm

RE: debug on KDevelop 3.2

I can't seem to get the de bugger to do anything. As I usually do when testing new stuff, I chose to keep it simple. Here is my C++ app in its entirety:

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <iostream>
#include <cstdlib>

using namespace std;

int main(int argc, char *argv[])
{
cout << "Hello, world!" << endl;
cout << "Hello again" << endl;

return EXIT_SUCCESS;
}

I set a breakpoint next to the second cout line, did a build and then said debug->Start. This gave me a message that 'Program exited normally'. What I hoped to see was the program start up, and then in the IDE execution would stop at the breakpoint and it would be clear what it was doing. It didn't happen.

I'm sure I'm missing something obvious. Any ideas?

5

Monday, January 22nd 2007, 3:03pm

RE: debug on KDevelop 3.2

What informatuion are you looking for ?

If it is the watch and the stack details, then there are tabs in the Dockwidget that is placed at the bottom for these purposes. You will be able to find that Frame stack and the GDB tabs. Also in the Dock window placed at hte Right side, you will be able to find the watch

What more are you looking for ? Also there is a forum specifically for KDEvelop. You will get more help there .

DrMega

Beginner

Posts: 3

Location: UK

Occupation: Developer

  • Send private message

6

Monday, January 22nd 2007, 7:15pm

RE: debug on KDevelop 3.2

Quoted

Originally posted by sunil.thaha
What informatuion are you looking for ?


Some clue as to what I'm doing wrong, why the debugger doesn't step at the breakpoint I set.

7

Monday, January 22nd 2007, 8:41pm

RE: debug on KDevelop 3.2

Probably because that break point is never met. Or maybe because you have not installed gdb. Why don't you try debugging a simple C++ program and see if the debugging really happens. Another thing that came to my mind was that you might be setting bookmarks ( F2 shortcut ) instead of Break point ( red in color ).

DrMega

Beginner

Posts: 3

Location: UK

Occupation: Developer

  • Send private message

8

Friday, January 26th 2007, 9:23pm

RE: debug on KDevelop 3.2

Quoted

Originally posted by sunil.thaha
Probably because that break point is never met. Or maybe because you have not installed gdb. Why don't you try debugging a simple C++ program and see if the debugging really happens. Another thing that came to my mind was that you might be setting bookmarks ( F2 shortcut ) instead of Break point ( red in color ).


The breakpoint would always be met. My test program couldn't get any simpler really (look at the code I posted in my original note). I'm not sure what gdb is (presumably its the linux standard debugger??) but I have since learned that there is a debugger installed on my machine because I've stopped using KDevelop in favour of Anjuta, which does most of what I need and the debugger worked exactly as I would have expected.

9

Tuesday, March 27th 2007, 5:58pm

The problem is probably that the program was not compiled with debug information. In my qmake *.pro file, I added a CONFIG += debug, and kdevelop now works with breakpoints. It is a little deceiving that you use the debug menu to execute the program, but it may or may not actually have compiled the program with debug info.

marquedios

Beginner

Posts: 2

Location: Dayton, Ohio

Occupation: Data Analyst

  • Send private message

10

Friday, June 22nd 2007, 2:47am

Editing the <project name>.pro and adding the CONFIG += debug made KDevelop 3.4.0 running on KDE 3.5.6 crash. However if I edit the already existing CONFIG line:

CONFIG += warn_on \
qt \
thread

to read:

CONFIG += warn_on \
qt \
thread \
debug

Then editing the src\src.pro file and adding the line:

CONFIG += debug

Debugging works. I found though that using the same technique for the src.pro file as I did the <project name>.pro file also made KDevelop crash...

Also I noticed something funky while debugging my sample testing project and that is that after stepping over an instruction just before a call to qDebug() my debugger to ran off without me :(. I'll have to find out why it did that but adding another break point on that line made it step properly into the loop after words and onto the end.

I love KDevelop and honestly I was surprised to NOT see a build configuration dialog for a qmake project :(. Guess I'll have to learn the syntax of a .pro file. Oh well, such is life and you can't complain seeing as KDevelop is as good as it is :D.

11

Friday, June 22nd 2007, 9:48am

There is a forum for KDevelop too. It would be helpful if you report bugs to them

vieraci

Beginner

Posts: 3

Location: Darwin, Australia

Occupation: Technician

  • Send private message

12

Wednesday, August 29th 2007, 6:36am

Quoted

Originally posted by marquedios
Editing the <project name>.pro and adding the CONFIG += debug made KDevelop 3.4.0 running on KDE 3.5.6 crash. However if I edit the already existing CONFIG line:

CONFIG += warn_on \
qt \
thread

to read:

CONFIG += warn_on \
qt \
thread \
debug

Then editing the src\src.pro file and adding the line:

CONFIG += debug

Debugging works. I found though that using the same technique for the src.pro file as I did the <project name>.pro file also made KDevelop crash...


What CONFIG file are yoiu talking about ?

I have put in my program a beep so I can hear if my program enters a certain function I'm trying to debug to see if it is in fact, being run, then if I run the app, I hear the beep. If I start the debugger, all I see is a console window flash for a split second and the program terminates. I don't hear a beep which tells me it didn't run to completion.

marquedios

Beginner

Posts: 2

Location: Dayton, Ohio

Occupation: Data Analyst

  • Send private message

13

Saturday, January 5th 2008, 2:03pm

There is a .pro file both in the root of your project and in the src folder. One should be called [Your Project Name].pro and the other should be (or at least for me) src.pro.

14

Thursday, March 26th 2009, 8:46am

RE: RE: debug on KDevelop 3.2

The posts below are two years old now, but the issue is important. It relates to the inability of a fairly experienced coder to get the debugger in kdevelop working.

It turns out that Dr Mega was almost certainly compiling his (really simple) C++ source code correctly. But to run the program he would have used the menu entry /Build/Execute program (or Shift+F9). It turns out that to get the debugger working, in kdevelop you must instead use the menu item, /Debug/Start (or F9).

That is actually serious. I was stymied by this for half an afternoon, before duplicating Dr Mega's source as a kdevelop project, registering here, and thinking rather hard about all the kdevelop menus. It was quite simply a show-stopper, and if two fairly experienced (but not in kdevelop) coders could be shut down in this manner, kdevelop will turn off a number of otherwise quite enthusiastic users.

Is it possible to incorporate some obvious warning, like instead of having "Execute Program" in the menu, something like "Run without debug"? The way kdevelop splits the debug function from an ordinary run function needs to be more widely disseminated.

Quoted

Originally posted by sunil.thaha
Probably because that break point is never met. Or maybe because you have not installed gdb. Why don't you try debugging a simple C++ program and see if the debugging really happens. Another thing that came to my mind was that you might be setting bookmarks ( F2 shortcut ) instead of Break point ( red in color ).


The breakpoint would always be met. My test program couldn't get any simpler really (look at the code I posted in my original note). I'm not sure what gdb is (presumably its the linux standard debugger??) but I have since learned that there is a debugger installed on my machine because I've stopped using KDevelop in favour of Anjuta, which does most of what I need and the debugger worked exactly as I would have expected.

15

Thursday, October 8th 2009, 8:34am

kill ad post
Fighting fire with fire.
Three can keep a secret if two of them are dead.

Rate this thread