public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* ppc64 gdbserver NPTL problem
@ 2005-10-16 15:00 Dmitry S. Vasilchenko
  2005-10-16 16:58 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry S. Vasilchenko @ 2005-10-16 15:00 UTC (permalink / raw)
  To: gdb

Hello!

I have met some problems with gdbserver and multithread debugging.
The problem is that on ppc64 td_ta_event_addr from glibc returns the
pointer to function descriptor, not the address of the function. As a
result, gdbserver installs breakpoint at the memory address in .opd
section, not at the function glibs expects. So gdbserver will never
receive information about new threads creation on ppc64.

It is easy to fix, but I am not sure, maybe this should be fixed in
glibc. Your thoughts?

from gdb/gdbserver/thread-tb.c:
/* ************************************ */
static int
thread_db_enable_reporting ()
{
...
  /* Get address for thread creation breakpoint.  */
  err = td_ta_event_addr (thread_agent, TD_CREATE, &notify);
...
  set_breakpoint_at ((CORE_ADDR) (unsigned long) notify.u.bptaddr,
                     thread_db_create_event);


From glibc, nptl_db/td_ta_event_addr.c:
/* ************************************ */
td_err_e
td_ta_event_addr (const td_thragent_t *ta_arg,
                  td_event_e event, td_notify_t *addr)
{
...
      err = DB_GET_SYMBOL (taddr, ta, __nptl_create_event);
...
      addr->u.bptaddr = taddr;

--
Best regards,
Dmitry Vasilchenko

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

* Re: ppc64 gdbserver NPTL problem
  2005-10-16 15:00 ppc64 gdbserver NPTL problem Dmitry S. Vasilchenko
@ 2005-10-16 16:58 ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2005-10-16 16:58 UTC (permalink / raw)
  To: Dmitry S. Vasilchenko; +Cc: gdb

"Dmitry S. Vasilchenko" <newdimm@gmail.com> writes:

> I have met some problems with gdbserver and multithread debugging.
> The problem is that on ppc64 td_ta_event_addr from glibc returns the
> pointer to function descriptor, not the address of the function. As a
> result, gdbserver installs breakpoint at the memory address in .opd
> section, not at the function glibs expects. So gdbserver will never
> receive information about new threads creation on ppc64.
>
> It is easy to fix, but I am not sure, maybe this should be fixed in
> glibc. Your thoughts?

I think gdbserver needs to do the equivalent of
gdbarch_convert_from_func_ptr_addr, as it is done in
linux-thread-db.c:enable_thread_event.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

end of thread, other threads:[~2005-10-16 16:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-16 15:00 ppc64 gdbserver NPTL problem Dmitry S. Vasilchenko
2005-10-16 16:58 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).