From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19249 invoked by alias); 29 Jan 2003 22:44:11 -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 19232 invoked from network); 29 Jan 2003 22:44:11 -0000 Received: from unknown (HELO zenia.red-bean.com) (66.244.67.22) by 172.16.49.205 with SMTP; 29 Jan 2003 22:44:11 -0000 Received: from zenia.red-bean.com (localhost.localdomain [127.0.0.1]) by zenia.red-bean.com (8.12.5/8.12.5) with ESMTP id h0TMcf8A024460; Wed, 29 Jan 2003 17:38:41 -0500 Received: (from jimb@localhost) by zenia.red-bean.com (8.12.5/8.12.5/Submit) id h0TMceD3024456; Wed, 29 Jan 2003 17:38:41 -0500 To: William Trenker Cc: gdb@sources.redhat.com Subject: Re: Newbie asks about .so libraries References: <20030129085049.25d160b2.wdtrenker@yahoo.ca> From: Jim Blandy Date: Wed, 29 Jan 2003 22:44:00 -0000 In-Reply-To: <20030129085049.25d160b2.wdtrenker@yahoo.ca> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.92 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-01/txt/msg00506.txt.bz2 renee517@yahoo.com writes: > Here's a basic question. Can gdb/insight debug code from .so files? > > I have a library, compiled with debug information, and a main program, also with debug info. If I start gdb with the main program, does gdb automatically dig up the debug info from any .so libraries used by the main program? Can I set breakpoints on the source code in the .so file? > > Or do I have to link statically for debugging purposes? No, GDB doesn't know anything about the shared libraries until they're loaded. If you set a breakpoint on 'main', and run the program to it, then GDB will know about the shared libraries, and you'll be able to set breakpoints on them.