From: Roland Egger <egger@tarantel.rz.fh-muenchen.de>
To: Denis Milhet <milhet@corys.fr>
Cc: gdb@sources.redhat.com
Subject: Re: breakpoint in lib.so loaded by a multi-threaded application on PC-Intely
Date: Tue, 03 Dec 2002 15:14:00 -0000 [thread overview]
Message-ID: <20021204001703.A5168@tarantel.rz.fh-muenchen.de> (raw)
In-Reply-To: <NFBBINKOGLBCCCCMMBOGIEMJCCAA.milhet@corys.fr>
Hi Denis,
at the moment I don't have an example on my machine here but I would try
something similar. If it's not possible to break at dlopen I would set
the breakpoint the lines before or afterwards but before using any
functions methods ... of the loaded libraries. After the lib(s) have been
loaded it's possible to use breakpoints in the shared library
We load the libMyDll.so with the Class OTest
// ... here's something before the dlopen and of course somewhere here we can
// set our breakpoint if it doesn't work on dlopen
void *handle = dlopen ("/lib/libMyDll.so", RTLD_LAZY);
// after we stept with next over dlopen we can set the breakpoint inside
// libMyDll.so
OTest oMyTest; // now we can go to the constructor with stepi or perhaps
// the breakpoint ???
Is that what you want to do??
Ciao
Roland
On Tue, Dec 03, 2002 at 03:51:34PM +0100, Denis Milhet wrote:
> Hi Roland !
>
> Thank's for your answer !
> I use Linux (Red-Hat 7.2) and I'm actually porting applications running on
> Sun Solaris and PC-WinNT to PC-Linux.
> In these applications, built with shared libraries and written in C++, I
> need to debug code initialised durind the libraries loading (eg constructor
> of variables). Of course it's impossible to put a breakpoint on the symbol
> of such function before its dynamic loading, and the feature "catch load" of
> gdb doesn't seem to be available on Linux according to the error message
> "catch of library loads/unloads not yet implemented on this plateform" and
> according to the gdb documentation.
> Do you know a solution ? Is it possible to force gdb to load and keep
> symbols on shared libraries in order to stop on them during execution ? For
> example with Sun Solaris dbx, the instruction "stop when dlopen" allows such
> feature. Is it easier to put a breakpoint on the "dlopen" symbol (I've
> tried, it doesn't work but perhaps didn't enter the right order of commands
> ...) ? It should be less convenient because gdb will stop in each loading.
>
> Thank's for your help,
>
> Denis
>
next prev parent reply other threads:[~2002-12-03 23:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-03 2:30 breakpoint in lib.so loaded by a multi-threaded application on PC-Intel Denis Milhet
2002-12-03 5:51 ` Roland Egger
[not found] ` <NFBBINKOGLBCCCCMMBOGIEMJCCAA.milhet@corys.fr>
2002-12-03 15:14 ` Roland Egger [this message]
2002-12-03 7:26 ` Daniel Jacobowitz
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=20021204001703.A5168@tarantel.rz.fh-muenchen.de \
--to=egger@tarantel.rz.fh-muenchen.de \
--cc=gdb@sources.redhat.com \
--cc=milhet@corys.fr \
/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