Folks, I'm trying to debug a simple program using gdb on SuSE 9.2 64bit stock (up to date on all patches), and I get an error when trying to debug the code in gdb: +++++++++++++ $ gdb myprog GNU gdb 6.2.1 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-suse-linux"...Using host libthread_db library "/lib64/tls/libthread_db.so.1". (gdb) list 1 ../sysdeps/x86_64/elf/start.S: No such file or directory. in ../sysdeps/x86_64/elf/start.S ++++++++++++++++ I'm writing a simple Qt application, which compiles fine and exits cleanly. I don't want to publish the code just yet, so can't include it here unfortunately. But the code itself doesn't seem to be the problem anyway. This are sample compilation commands (generated by qmake): # same for all objects: g++ -c -pipe -O2 -fmessage-length=0 -Wall -Wall -W -g -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I/usr/include -I/usr/lib/qt3/include -I.ui/ -I. -I.moc/ -o .obj/mycode.o mycode.cpp # the linking step: g++ -o myprog .obj/mycode.o .obj/main.o .obj/mydialog.o .obj/moc_mydialog.o -L/usr/lib64/ -L/usr/lib/qt3/lib64/ -L/usr/X11R6/lib64/ -lqt-mt -lXext -lX11 -lm Anyone knows what the problem is here? TIA, Adalberto
Adalberto Castelo wrote:
Folks,
I'm trying to debug a simple program using gdb on SuSE 9.2 64bit stock (up to date on all patches), and I get an error when trying to debug the code in gdb:
+++++++++++++
$ gdb myprog
GNU gdb 6.2.1 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-suse-linux"...Using host libthread_db library "/lib64/tls/libthread_db.so.1".
(gdb) list 1 ../sysdeps/x86_64/elf/start.S: No such file or directory. in ../sysdeps/x86_64/elf/start.S
++++++++++++++++
I'm writing a simple Qt application, which compiles fine and exits cleanly. I don't want to publish the code just yet, so can't include it here unfortunately. But the code itself doesn't seem to be the problem anyway.
This are sample compilation commands (generated by qmake): # same for all objects: g++ -c -pipe -O2 -fmessage-length=0 -Wall -Wall -W -g -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I/usr/include -I/usr/lib/qt3/include -I.ui/ -I. -I.moc/ -o .obj/mycode.o mycode.cpp
# the linking step: g++ -o myprog .obj/mycode.o .obj/main.o .obj/mydialog.o .obj/moc_mydialog.o -L/usr/lib64/ -L/usr/lib/qt3/lib64/ -L/usr/X11R6/lib64/ -lqt-mt -lXext -lX11 -lm
Anyone knows what the problem is here?
TIA, Adalberto
Stupid questions: What happens if you do "list main" ? How about "list myfunc" where myfunc is something you know you wrote? What does -DQT_NO_DEBUG do to the -g flag?
On Tuesday 19 April 2005 00:26, Pierre Patino wrote:
Stupid questions: What happens if you do "list main" ? How about "list myfunc" where myfunc is something you know you wrote? What does -DQT_NO_DEBUG do to the -g flag?
You're definitely onto something here. I can list main or myfunc. I can put breaks on it to. Thing is, when it stops at a break (say at myfunc), and I do 'next', it seems to be stepping into what looks like Qt event handling procedures instead. And it won't let me get back to it with frame (it says can't access that bit of memory). I haven't debugged Qt in gdb before (at work I have been spoiled by totalview), so I don't know if that's to be expected. I think I'll have to post my code here, or a simple example. I probably should test the debugging on a 32 bit box, just to check if this is Qt related instead of gdb having problems with the amd64. So it seems I can (partially) use gdb. On the other hand, that error (can't find ../sysdep/yadayada) is sufficient to stop DDD on its tracks. It would be nice to understand why it's happening. Anyway, thanks for your help! Adalberto
Folks,
I'm trying to debug a simple program using gdb on SuSE 9.2 64bit stock (up to date on all patches), and I get an error when trying to debug the code in gdb: Just to add to the other two postings on this, if I recall, when programming with QT, you pass your code through a preprocessor that adds some stuff (It's been a few years since I played with it). It's very possible that
On Monday 18 April 2005 10:20 pm, Adalberto Castelo wrote:
this is what is confusing gdb.
You might try to use ddd. Eventhough ddd uses gdb, it might give you a
better picture.
--
Jerry Feldman
Adalberto Castelo
(gdb) list 1 ../sysdeps/x86_64/elf/start.S: No such file or directory. in ../sysdeps/x86_64/elf/start.S
That file is part of the glibc sources which you normally don't have installed. You normally don't need that to debug an application. Philipp
participants (4)
-
Adalberto Castelo
-
Jerry Feldman
-
Philipp Thomas
-
Pierre Patino