PDA

View Full Version : Can't get qdevelop to debug



JeanC
1st January 2008, 17:27
I am *almost* sure I meet all requirements.

Qt on linux is with debug info.
dbg is installed.
The project is in debugmode.

If I put a breakpoint in main, as shown here http://qdevelop.free.fr/doc-en.php#mozTocId388196
and start debugging, nothing happens, no blue line, the program just runs.

The outputwindow displays a few times (dbg) so that's probably running,

Any help appreciated.

I'm new to linux and qt, things are going slowly enough by itself, not being able to debug wont help :)

Thanks.

Alnitak
3rd January 2008, 18:28
Hi,

I got the same problem since a week or so.
The project in QDevelop compile right in debug mode, the problem begins when trying to debug. It doesn't break on breakpoints.
I create a new default project and marked 2 breakpoints in the main function, the debugger output is:

Debug...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) (gdb) (gdb) (gdb) (gdb) (gdb) (gdb) Starting program: /home/alnitak/prova/bin/prova
[Thread debugging using libthread_db enabled]
[New Thread 0xb6eabb90 (LWP 4472)]
[Thread 0xb6eabb90 (LWP 4472) exited]
Program exited normally.
(gdb)
Argument required (expression to compute).
Argument required (expression to compute).
Qt: gdb: -nograb added to command-line options.
Use the -dograb option to enforce grabbing.
---------------------- Debug exited ----------------------

this output is displayed when I close the application.
I use debian testing and gdb version is 6.6.90.20070912-debian.
QDevelop is 0.25 also tried svn 0.26
I tried also with gdb 6.7.1 and recompiled version of 6.3, but nothing better with QDevelop. Within the shell gdb stops and exit.
I'm thinking its a problem related to libthread but don't know what else to try.
Any help appreciated.

jlbrd
5th January 2008, 08:10
Argument required (expression to compute).
Argument required (expression to compute).

These two lines seems to say a problem to accept both breakpoints by gdb. I read somewhere that the 6.7.0 and 6.7.1 was bugged (http://www.kdevelop.org/index.html?filename=main.html&set_lang=en). I don't know if it's the cause of problem, but perhaps.

jlbrd
5th January 2008, 08:57
On my Ubuntu 7.10, I built gdb 6.7.1 and the programs are correctly stopped with it. This version of gdb works fine, finaly. So, what is the problem?
Please try to launch your program in gdb in a terminal then enter:

break main.cpp:8then run it.
8 is the line number in the main function, change it if the line 8 doesn't exists. You have added the breakpoint in the same way that is made in qdevelop. Say me the results, please.

elcuco
5th January 2008, 14:08
This is not working (from QDevelop) on my system, using gdb 6.6.dfsg-1ubuntu7.

jlbrd
5th January 2008, 14:11
Curious because I have exactly the same system (Ubuntu 7.10) and the same version of gdb and that works for me. The programs stops fine on the breakpoints.

jlbrd
5th January 2008, 14:33
Please in debug.cpp:117 try to replace toLatin1() by toLocal8Bit() or toUtf8()

elcuco
5th January 2008, 14:56
Both are not working and I get:


Argument required (expression to compute).

jlbrd
5th January 2008, 15:15
Now add below "qDebug() << msg" and say me the result. Thanks

Alnitak
5th January 2008, 15:51
this is what happens for me with toUtf8()

./bin/qdevelop
"watch
"
"set pagination off
"
"set width 0
"
"set height 0
"
"set complaints 0
"

the same with toLatin1()

jlbrd
5th January 2008, 16:34
ok thanks. I modified the code for the breakpoints. Please download the lasted svn version by "svn checkout http://qdevelop.googlecode.com/svn/trunk/ qdevelop-read-only" and try with it. Perhaps a solution...

Alnitak
5th January 2008, 17:46
I downloaded the svn version, but unluck with the result.
I think is some kind of problem related to latest packages in the debian repositories ( last week, before some updates, all working ), maybe some locales or even something related to libc6 ( I m not a geek).
I tried to do debug slotBreakpoint() (at debug.cpp:405) adding these line at the end of the function:

qDebug() << "point:"+point;
qDebug() << "Line:"+QString::number(line);
qDebug() << "Filename:"+filename;
qDebug() << "blockUserData->breakpointCondition:"+blockUserData->breakpointCondition;
qDebug() << "blockUserData->breakpoint:"+QString::number(blockUserData->breakpoint);
qDebug() << "blockUserData->isTrue:"+QString::number(blockUserData->isTrue);

the output is:

"point:watch
"
"Line:8"
"Filename:main.cpp"
"blockUserData->breakpointCondition:"
"blockUserData->breakpoint:1"
"blockUserData->isTrue:0"

so if I change the line 410 with:
if( !blockUserData->isTrue )
it breaks.

I'll looking for that 'isTrue' condition later and I'll let u know.

p.s.: great work and great project

Alnitak
5th January 2008, 18:20
maybe some good news.
I monitored the function

LineNumbers::slotToggleBreakpoint()

and it does't toggle isTrue variable when pressing F9 but it does when select the mode in context menu.
I'll go ahead triing to discover some strange behaviours like version 0.25 working right before the updates or when debgging a qt application gdb stopped and when close the shell the application start.

thanks

jlbrd
5th January 2008, 20:06
Ok it's found and fixed. Two way was possible to toggle a breakpoint, with the mouse which works well, and with the menubar which not works properly. Now it's normaly fixed. Please try the last svn and confirm.

Alnitak
5th January 2008, 20:10
works smoothly

thanks

elcuco
5th January 2008, 20:14
BTW, middle clicking a line number will trigger a breakpoint.

Homework:
Middle click is used in QDevelop quite a lot. Please mention 2 more pleaces in which it's used.

JeanC
30th January 2008, 09:14
I was surprised checking here again that this thread is still alive, I thought it was dead after I posted my first post here.
I downloaded the svn and it stops on the breakpoint and lets me step!
I'm very pleased. Learning Qt and using QDevelop is what I have been doing for weeks now and porting all my stuff from windows is alot of fun.

I thought i mentioned that I get these:

Scope for 186:
Symbol this is a variable with complex or multiple locations (DWARF2), length 4.
Symbol moviename is a variable with complex or multiple locations (DWARF2), length 4.
Symbol jpgmap is a variable with complex or multiple locations (DWARF2), length 4.
Symbol map is a variable with complex or multiple locations (DWARF2), length 4.
Symbol names is a variable with complex or multiple locations (DWARF2), length 4.
Symbol n is a variable with complex or multiple locations (DWARF2), length 4.
(gdb)

Thanks jlbrd, keep up the good work, very nice ide.
Jean.

sanjeev
1st April 2008, 21:04
Thanks a lot for this fix. I got the latest from svn and it worked perfectly.
Thanks again.
:)