This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: gdb-6.6, faking a shared library
- From: Daniel Jacobowitz <drow at false dot org>
- To: jbbachky at aim dot com
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 29 Nov 2006 10:46:50 -0500
- Subject: Re: gdb-6.6, faking a shared library
- References: <8C8E1E45640370E-D40-84C5@MBLK-D29.sysops.aol.com>
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