Re: [RFA] solib-svr4.c fetch link map address

Elena Zannoni
2002-10-02T13:50:33Z

Daniel Jacobowitz writes:
> On Tue, Oct 01, 2002 at 10:28:01PM -0400, Elena Zannoni wrote:
> >
> > This function is used by thread_db.c. Gdb needs to pass the address of
> > the link map to glibc. Glibc will compute the address of a thread
> > local variable, given such address and the offset within the thread
> > local storage at which the variable is stored (gdb gets the offset out
> > of the debug info).
> >
> > The interface for the glibc function is like this:
> >
> > extern td_err_e td_thr_tls_get_addr (const td_thrhandle_t *__th,
> > void *__map_address, size_t __offset,
> > void **__address);
> >
> > The function loops through the link maps, and returns the address of
> > the one corresponding to the given objfile. Note that this function
> > takes into account that objfile can be the main executable, not just a
> > shared library. The main executable has always an empty name field in
> > the linkmap.
>
> How is the interface in thread_db going to look?
>
> Having finally gotten gdbserver thread support going, I don't want it
> to lose features; so I'm going to need to communicate the necessary
> information for these libthread_db queries to/from it somehow. I'm not
> clear how that should look yet.
>

I am preparing the rest of the patch. Hold on. I eventually fell
asleep last night...:-(

Elena

> --
> Daniel Jacobowitz
> MontaVista Software Debian GNU/Linux Developer