[PATCH 1/2] Fast tracepoint for powerpc64le

Pedro Alves palves@redhat.com
Wed Mar 18 16:07:00 GMT 2015


On 03/18/2015 11:04 AM, Ulrich Weigand wrote:
> Pedro Alves wrote:
>> On 03/17/2015 06:12 PM, Ulrich Weigand wrote:
>>> That's probably not necessary.  The reason the GDB implementation
>>> does it that way is that it needs to work under various different
>>> circumstances, like when debugging a core file, or before the
>>> dynamic linker has relocated an executable.  For the gdbserver
>>> implementation, we should never need to handle such conditions,
>>> so we are able to simply read the target address from memory.
>>>
>>
>> Maybe not cores today, but why doesn't gdbserver have to
>> handle the case of connecting before the executable has been
>> relocated?
>>
>> I also wonder about all the break-interp.exp corner cases.
> 
> gdbserver would access function descriptors only for the
> __nptl_create_event etc. routines.  These are looked up
> only after a libthread_db td_ta_new_p call succeeds, which
> should only be true if libpthread has been loaded (and
> relocated) in the inferior.  If it hasn't been yet at the
> time gdbserver attaches, the whole thread initialization
> sequence is defered until after the new_objfile event that
> happens after libpthread *was* loaded and relocated.
> Am I missing something here?

You're missing the case of statically linked threaded
programs.  AFAICS, on x86-64, libthread_db.so is loaded
successfully on initial connection, and if I hack gdbserver
to use __nptl_create_event events, I see it setting the
breakpoint already on initial connection.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list