From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1871 invoked by alias); 8 Feb 2006 21:13:33 -0000 Received: (qmail 1862 invoked by uid 22791); 8 Feb 2006 21:13:33 -0000 X-Spam-Check-By: sourceware.org Received: from rwcrmhc11.comcast.net (HELO rwcrmhc11.comcast.net) (204.127.192.81) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 08 Feb 2006 21:13:32 +0000 Received: from hippogriff.homeunix.org ([67.166.31.25]) by comcast.net (rwcrmhc11) with ESMTP id <20060208211330m1100c1jfge>; Wed, 8 Feb 2006 21:13:30 +0000 Received: by hippogriff.homeunix.org (Postfix, from userid 1000) id 66F6543750; Wed, 8 Feb 2006 14:13:32 -0700 (MST) Date: Wed, 08 Feb 2006 21:13:00 -0000 From: Patrick Alken To: gdb@sourceware.org Subject: gdb and shared libraries Message-ID: <20060208211332.GA8676@hippogriff.physics.drexel.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00054.txt.bz2 Hello, I am the developer of ald (http://ald.sourceforge.net), which is a GNU licensed debugger designed specifically for assembly level debugging. Right now I am trying to solve the problem of loading in the symbol tables of shared libraries for a target program so that breakpoints can be set at addresses in these libraries. Unfortunately it has not been easy to find information on how to best do this, and after studying the gdb source code for a while I decided it was best to ask this list for help. I am looking for a big picture with perhaps some useful details for the more complicated steps. As an example, 1. fork + ptrace(TRACE_ME) + exec (child) 2. catch SIGTRAP (parent) 3. user types "run" 4. (start singlestepping/continuing/whatever until shared libraries have been loaded and ?somehow? get names of all libraries loaded by dynamic linker) 5. mmap() that list of libraries and then load their symbol tables into memory so breakpoints can be set there So it is step #4 that I am hoping someone on the list can give me details for. How do you know when all the libraries have been loaded so that you can stop execution of the program while you load the libs symbol tables? How do you get the pathnames of the libraries after they have been loaded so you can mmap them? Thank you in advance, Patrick Alken