Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* breakpoint in lib.so loaded by a multi-threaded application on PC-Intel
@ 2002-12-03  2:30 Denis Milhet
  2002-12-03  5:51 ` Roland Egger
  2002-12-03  7:26 ` breakpoint in lib.so loaded by a multi-threaded application on PC-Intel Daniel Jacobowitz
  0 siblings, 2 replies; 4+ messages in thread
From: Denis Milhet @ 2002-12-03  2:30 UTC (permalink / raw)
  To: gdb

I try to use gdb to debug a multi-threaded application loading shared
libraries by dependancy and by explicit 'dlopen' instructions.
It seems to be available only on HP.
Anyone knows how to do it on PC-Intel, or with an other debugger ?

Thank's for your help

Denis Milhet
Corys T.E.S.S.
www.corys.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: breakpoint in lib.so loaded by a multi-threaded application on PC-Intel
  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  7:26 ` breakpoint in lib.so loaded by a multi-threaded application on PC-Intel Daniel Jacobowitz
  1 sibling, 1 reply; 4+ messages in thread
From: Roland Egger @ 2002-12-03  5:51 UTC (permalink / raw)
  To: gdb

Hi,
I think it should work on PC-Intel (which OS do you use? BSD, Linux,
Solaris ...???) with gdb, too.
dlopen should work on Linux (intel,...)  and it also should work on Solaris.
For HP-UX we use shl_load instead. 
I think you are one of the few people who has less problems with 
hp-ux than with other OS ;)
(Do you have any experience with the hp stack??)

Bye
  Roland

On Tue, Dec 03, 2002 at 11:29:52AM +0100, Denis Milhet wrote:
> I try to use gdb to debug a multi-threaded application loading shared
> libraries by dependancy and by explicit 'dlopen' instructions.
> It seems to be available only on HP.
> Anyone knows how to do it on PC-Intel, or with an other debugger ?
> 
> Thank's for your help
> 
> Denis Milhet
> Corys T.E.S.S.
> www.corys.com
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: breakpoint in lib.so loaded by a multi-threaded application on PC-Intel
  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
@ 2002-12-03  7:26 ` Daniel Jacobowitz
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2002-12-03  7:26 UTC (permalink / raw)
  To: Denis Milhet; +Cc: gdb

On Tue, Dec 03, 2002 at 11:29:52AM +0100, Denis Milhet wrote:
> I try to use gdb to debug a multi-threaded application loading shared
> libraries by dependancy and by explicit 'dlopen' instructions.
> It seems to be available only on HP.

Be more specific - what "it"?  Some of the relevant "catch" commands
are not implemented on non-HP/UX, that's on my list to fix soon.
Everything else should be OK.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: breakpoint in lib.so loaded by a multi-threaded application on PC-Intely
       [not found]   ` <NFBBINKOGLBCCCCMMBOGIEMJCCAA.milhet@corys.fr>
@ 2002-12-03 15:14     ` Roland Egger
  0 siblings, 0 replies; 4+ messages in thread
From: Roland Egger @ 2002-12-03 15:14 UTC (permalink / raw)
  To: Denis Milhet; +Cc: gdb

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
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-12-03 23:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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     ` breakpoint in lib.so loaded by a multi-threaded application on PC-Intely Roland Egger
2002-12-03  7:26 ` breakpoint in lib.so loaded by a multi-threaded application on PC-Intel Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox