Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gdb-6.6, faking a shared library
@ 2006-11-29 15:44 jbbachky
  2006-11-29 15:46 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: jbbachky @ 2006-11-29 15:44 UTC (permalink / raw)
  To: gdb

I've got an arm program which makes use of a non-standard shared 
library and I'm looking for ways to inform gdb that it really is a 
shared library.

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.

Any ideas for making gdb think that a certain address range is a shared 
library? My glibc (v2.2.3) is NOT built for pic/dynamic linking. Thus 
no libthread_db is built. Compiler is gcc v3.4.3, linux is 2.6.10 for 
ARM.

Thanks, John
________________________________________________________________________
Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gdb-6.6, faking a shared library
  2006-11-29 15:44 gdb-6.6, faking a shared library jbbachky
@ 2006-11-29 15:46 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2006-11-29 15:46 UTC (permalink / raw)
  To: jbbachky; +Cc: gdb

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-29 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-29 15:44 gdb-6.6, faking a shared library jbbachky
2006-11-29 15:46 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox