This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ppc64 gdbserver NPTL problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]