From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31343 invoked by alias); 29 Nov 2006 15:46:59 -0000 Received: (qmail 31329 invoked by uid 22791); 29 Nov 2006 15:46:58 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 29 Nov 2006 15:46:53 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1GpRe6-0000ad-TS; Wed, 29 Nov 2006 10:46:51 -0500 Date: Wed, 29 Nov 2006 15:46:00 -0000 From: Daniel Jacobowitz To: jbbachky@aim.com Cc: gdb@sources.redhat.com Subject: Re: gdb-6.6, faking a shared library Message-ID: <20061129154650.GA2198@nevyn.them.org> Mail-Followup-To: jbbachky@aim.com, gdb@sources.redhat.com References: <8C8E1E45640370E-D40-84C5@MBLK-D29.sysops.aol.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8C8E1E45640370E-D40-84C5@MBLK-D29.sysops.aol.com> User-Agent: Mutt/1.5.13 (2006-08-11) 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: 2006-11/txt/msg00228.txt.bz2 On Wed, Nov 29, 2006 at 10:44:06AM -0500, jbbachky@aim.com wrote: > What I'm calling a shared library is a subset of glibc which gets > linked/mapped to a specific address, and the programs which "link > against it" really link against fixed addresses, thus no dynamic > linking is involved. Special startup code is used to map the library's > addresses for each process which need it. However, since gdb knows > nothing about it being shared among other processes (not simply other > pthreads sharing the same memory map), bad things happen when a > breakpoint in that library is hit by another process. It won't help you to tell GDB that it's a shared library; GDB inserts breakpoints in shared libraries the same way it does anywhere else. The debug agent is usually responsible for handling places which need special breakpoint handling. I think you'd need the kernel to do breakpoint insertion/removal at context switches in the case you've described. -- Daniel Jacobowitz CodeSourcery