Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-16-2014, 04:37 AM
|
#1
|
Senior Member
Registered: Feb 2009
Posts: 1,727
|
gdb, debug with separate debug file and different source dir problem
Hi,
I have to use a special version for qt,
this comes with libQtWhatever.so.VERSION and libQtWhatever.so.VERSION.debug
I downloaded the Qt VERSION sources
now I need to debug and step through some Qt methods
but it does not work
I have used
set debug-file-directory /where/the/lib/are
(lib and lib.debug are in the same dir)
and
directory /where/I/expect/the/source
(in fact, for directory I used several versions, like ..src/widgets and src/widgets/graphicsview)
but it does not work, I can not step into the qt code and inspect the location where I have the crash
what am I doing wrong?
|
|
|
10-16-2014, 06:19 AM
|
#2
|
Member
Registered: Mar 2006
Location: Ekaterinburg, Russia
Distribution: Debian, Ubuntu
Posts: 709
|
Hi.
Just guessing: are you sure that the executable file you are debugging actually uses your compiled library? Maybe you need to set LD_PRELOAD environment variable?
|
|
|
10-16-2014, 07:07 AM
|
#3
|
Senior Member
Registered: Feb 2009
Posts: 1,727
Original Poster
|
using ldd I can see it points exactly to those libraries
there is also no alternative (since there are no other qt5 libs on this system)
so I assume that I am either doing something wrong, or files miss something
I am also not sure if I have a problem with the debug libs,
I get good info where the crash happens, backtrace an method call that causes the problem
but I can not step (nor does is stop at the location where the crash happens)
if this
Quote:
readelf -a libQt5Widgets.so.5.1.1 | grep debug
[25] .gnu_debuglink PROGBITS 00000000 5c857c 000024 00 0 0 1
|
a valid debuglink ?
|
|
|
10-16-2014, 11:03 AM
|
#4
|
Member
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792
|
Just guessing here, too:
Quote:
lib and lib.debug are in the same dir
|
Are there symlinks in the directory also? e.g.: If so, try changing them to point to the respective debug libraries
Last edited by norobro; 10-16-2014 at 11:04 AM.
Reason: typo
|
|
|
10-16-2014, 11:32 AM
|
#5
|
Member
Registered: Mar 2006
Location: Ekaterinburg, Russia
Distribution: Debian, Ubuntu
Posts: 709
|
Hi.
Try
Code:
(gdb) sharedlibrary libQtWhatever
(gdb) info sources
to check that debug symbols are loaded and to find out where gdb expect to find source files for your library. What exactly happens when you try to step into some qt5 function?
Last edited by firstfire; 10-16-2014 at 11:34 AM.
|
|
1 members found this post helpful.
|
10-17-2014, 01:55 AM
|
#6
|
Senior Member
Registered: Feb 2009
Posts: 1,727
Original Poster
|
sharedlibrary ....
Symbols already loaded for ....(full path)
info sources,
a long list, and the qt sources are loaded, so everything is here
it seems that my lookup path is messed up or I need to to a path substitution, need to find out what
when I step into qt function, nothing happens, (list shows nothing), tui is showing me my code where the call is done.
parts of sources look like this
Quote:
../../include/QtGui/5.1.1/QtGui/private/../../../../../src/gui/text/qtextdocumentlayout_p.h, .moc/debug-shared/moc_qgraphicsitem.cpp,
../../include/QtGui/5.1.1/QtGui/private/../../../../../src/gui/text/qtextengine_p.h, graphicsview/qgraphicsitem.cpp, ../../include/QtGui/../../src/gui/text/qtextobject.h,
../../include/QtGui/../../src/gui/text/qtextlayout.h, ../../include/QtGui/../../src/gui/text/qtextformat.h, ../../include/QtGui/../../src/gui/math3d/qmatrix4x4.h,
graphicsview/qgraphicsgridlayout.cpp, graphicsview/qgraphicsgridlayout.h, ../../include/QtWidgets/../../src/widgets/widgets/qplaintextedit.h,
../../include/QtWidgets/../../src/widgets/widgets/qtextedit.h, ../../include/QtWidgets/../../src/widgets/itemviews/qtableview.h,
../../include/QtWidgets/5.1.1/QtWidgets/private/../../../../../src/widgets/itemviews/qitemeditorfactory_p.h, ../../include/QtWidgets/../../src/widgets/widgets/qlineedit
|
or
Quote:
/home/somePerson/some/where/qt/qt-5.1.1/qt-everywhere-opensource-src-5.1.1/qtbase/include/QtCore/../../src/corelib/xml/qxmlstream.h,
|
so it seems I have to fiddle and play around with setting the right source dirs and path substitution
|
|
|
All times are GMT -5. The time now is 05:14 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|