From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16409 invoked by alias); 3 Dec 2002 23:14:53 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 16398 invoked from network); 3 Dec 2002 23:14:48 -0000 Received: from unknown (HELO mailserv.rz.fh-muenchen.de) (129.187.244.239) by sources.redhat.com with SMTP; 3 Dec 2002 23:14:48 -0000 Received: (qmail 5408 invoked by uid 4306); 3 Dec 2002 23:17:03 -0000 Date: Tue, 03 Dec 2002 15:14:00 -0000 From: Roland Egger To: Denis Milhet Cc: gdb@sources.redhat.com Subject: Re: breakpoint in lib.so loaded by a multi-threaded application on PC-Intely Message-ID: <20021204001703.A5168@tarantel.rz.fh-muenchen.de> References: <20021203145341.A27506@tarantel.rz.fh-muenchen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: X-SW-Source: 2002-12/txt/msg00056.txt.bz2 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 >