From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10723 invoked by alias); 20 Aug 2008 18:56:48 -0000 Received: (qmail 10713 invoked by uid 22791); 20 Aug 2008 18:56:47 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.113.40.141) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 20 Aug 2008 18:56:15 +0000 Received: from mailhost5.vmware.com (unknown [10.16.68.131]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id B6E466ACA; Wed, 20 Aug 2008 11:56:13 -0700 (PDT) Received: from [10.20.92.47] (promb-2s-dhcp47.eng.vmware.com [10.20.92.47]) by mailhost5.vmware.com (Postfix) with ESMTP id 17518DC152; Wed, 20 Aug 2008 11:57:38 -0700 (PDT) Message-ID: <48AC686C.4030806@vmware.com> Date: Thu, 21 Aug 2008 11:29:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Guillaume Laferriere CC: "gdb@sourceware.org" Subject: Re: Question: How to load automatically all libraries of a back trace. References: <48A5E0EF.9090409@vmware.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00235.txt.bz2 OK, well there are only two choices for the sharedlibrary command. Either you name the libs you want, or you get them all. Perhaps you could do a backtrace, shunt the results to a file (see "help set logging"), then grep the shared lib names out of it and sed them into a set of "sharedlib" commands, which you would then "source" back into gdb? Guillaume Laferriere wrote: > Thanks for the answer but it does not work in my case. > > Calling sharedlibrary without args loads up too much symbols. > It loads all the symbols of the libraries in memory and for me it's too much. > > I'm looking for a way to load only libraries that are referenced in a > given call stack to avoid loading everything. > > Thanks > > Guillaume > > On Fri, Aug 15, 2008 at 4:02 PM, Michael Snyder wrote: >> Guillaume Laferriere wrote: >>> I'm debugging an application that has a lot of shared libraries so I >>> always have to run with auto-solib-add turned off. >>> >>> When I get back trace I always need to go through the process of >>> running manually "bt" then "shared-library libMyLib.so" until I get >>> the full valid back trace. >>> >>> Is there a way to automate that process? >>> Maybe using a user command that does it for me. >>> Is there someone that already did that? >>> >>> Thanks in advance for the help, >>> >> I think "shared-library" with no arguments. >> "Info shared" will confirm for you whether they >> have all been loaded. >> >>