From: Florian Hackenberger <f.hackenberger@chello.at>
To: gdb@sourceware.org
Subject: breakpoints in shared libraries
Date: Tue, 14 Feb 2006 16:29:00 -0000 [thread overview]
Message-ID: <200602141729.09355.f.hackenberger@chello.at> (raw)
Dear fellows,
This question pops up from time to time, but while skimming through the
archives I was not able to find any suggestions. The problem I have is that I
am not able to stop at breakpoints within some shared libraries. The layout
of the program I'm trying to debug is as following (arrows indicate dynamic
linkage against some library)
testHoap2Collision ->libhoap2.so -> libroboop.so, libnewmat.so,
libController.so, libCGAL.so
The project is built using libtool and the autotools and the following flags:
configure: --enable-debug=full
g++: -O0 -g3
All libraries apart from libController.so and libCGAL.so are built using the
same autotools environment (one ./configure for all).
What I'm trying to do is to set a breakpoint within libroboop.so within the
following method:
Quaternion::Quaternion(const Real angle, const ColumnVector & axis)
//! @brief Constructor.
{
if(axis.Nrows() != 3)
{
cerr << "Quaternion::Quaternion, size of axis != 3" << endl;
exit(1);
}
// make sure axis is a unit vector
Real norm_axis = sqrt(DotProduct(axis, axis));
if(norm_axis != 1)
{
cerr << "Quaternion::Quaternion(angle, axis), axis is not unit." <<
endl;
cerr << "Make the axis unit." << endl;
v_ = sin(angle/2) * axis/norm_axis;
}
else
v_ = sin(angle/2) * axis;
s_ = cos(angle/2);
}
It does not matter where the breakpoint is set within this method, but I would
like to set it on the line:
cerr << "Make the axis unit." << endl;
Here is the declaration of the method:
Quaternion(const Real angle_in_rad, const ColumnVector & axis);
So, it's not inline or anything fancy, just a plain constructor.
The following happens:
After starting gdb (libtool --mode=execute gdb testHoap2Collision) I try the
following:
(gdb) break quaternion.cpp:100
No source file named quaternion.cpp.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (quaternion.cpp:100) pending.
Ok, that's fine, now let's see if the breakpoint is set:
(gdb) run
Starting program:
msl/debug/libhoap2/examples/testCollision/.libs/lt-testHoap2Collision
[Thread debugging using libthread_db enabled]
[New Thread -1216158016 (LWP 16481)]
Breakpoint 3 at 0xb7e73147: file msl/libroboop/source/quaternion.cpp, line
100.
Pending breakpoint "quaternion.cpp:100" resolved
Quaternion::Quaternion(angle, axis), axis is not unit.
Make the axis unit.
That tells me:
1. The breakpoint was set.
2. The breakpoint did not work, as I can see the output "Make the axis unit."
and that's the line where my breakpoint was supposed to interrupt the
execution.
So that's the problem. Can anyone help me?
Here's some info about my environment:
GNU gdb 6.3
g++ (GCC) 3.4.3-20050110
A "typical call to g++":
g++ -DHAVE_CONFIG_H -I.
-I/home/hacki/Documents/sandbox/master_project/msl-2.0_automake/msl/libhoap2/examples/testCollision
-I../../..
-I/home/hacki/Documents/sandbox/master_project/msl-2.0_automake/msl/libhoap2
-I/home/hacki/Documents/sandbox/master_project/msl-2.0_automake/msl/libnewmat
-I/home/hacki/Documents/sandbox/master_project/msl-2.0_automake/msl/libroboop/source
-I/usr/qt/3/include -I/usr/local/webots/include
-I/home/hacki/Documents/sandbox/master_project/msl-2.0_automake/msl/external_include
-I/home/hacki/Documents/sandbox/master_project/msl-2.0_automake/msl/../CGAL-3.1/include/CGAL/config/i686_Linux-2.6.15-suspend2-r3_g++-3.4.3
-I/home/hacki/Documents/sandbox/master_project/msl-2.0_automake/msl/../CGAL-3.1/include
-O0 -g3 -MT testHoap2Collision.o -MD -MP -MF ".deps/testHoap2Collision.Tpo"
-c -o
testHoap2Collision.o /home/hacki/Documents/sandbox/master_project/msl-2.0_automake/msl/libhoap2/examples/testCollision/testHoap2Collision.cpp
The call to link the executable:
g++ -O0 -g3 -o .libs/testHoap2Collision
testHoap2Collision.o ../../../libhoap2/.libs/libhoap2.so
-L/home/hacki/Documents/sandbox/master_project/msl-2.0_automake/msl/../CGAL-3.1/lib/i686_Linux-2.6.15-suspend2-r3_g++-3.4.3
-L/usr/local/webots/lib -L/usr/i686-pc-linux-gnu/bin
-L/usr/i686-pc-linux-gnu/lib /home/hacki/Documents/sandbox/master_project/msl-2.0_automake/msl/debug/libroboop/source/.libs/libroboop.so /home/hacki/Documents/sandbox/master_project/msl-2.0_automake/msl/debug/libnewmat/.libs/libnewmat.so
-lController
-lCGAL //usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/libstdc++.so
-Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath
-Wl,//usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110
Sincerely Yours,
Florian
--
Florian Hackenberger
student @
University of Technology
Graz, Austria
florian@hackenberger.at
www.hackenberger.at
next reply other threads:[~2006-02-14 16:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-14 16:29 Florian Hackenberger [this message]
2006-02-14 17:00 ` Daniel Jacobowitz
2006-02-14 17:10 ` Florian Hackenberger
2006-02-14 17:13 ` Daniel Jacobowitz
2006-02-14 17:52 ` Paul Koning
2006-02-14 18:00 ` Florian Hackenberger
2006-02-14 17:21 ` Mark Kettenis
2006-02-14 17:23 ` Bob Rossi
2006-02-14 17:31 ` Daniel Jacobowitz
2006-02-14 17:47 ` Mark Kettenis
2006-02-14 17:08 ` Mark Kettenis
2006-02-14 17:20 ` Florian Hackenberger
-- strict thread matches above, loose matches on Subject: below --
2001-11-13 9:05 Tom Tromey
2001-11-13 9:41 ` Daniel Jacobowitz
2001-11-13 10:11 ` Tom Tromey
2001-11-13 10:20 ` Per Bothner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200602141729.09355.f.hackenberger@chello.at \
--to=f.hackenberger@chello.at \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox