This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] Fast tracepoint for powerpc64le
- From: Pedro Alves <palves at redhat dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: Wei-cheng Wang <cole945 at gmail dot com>, gdb-patches at sourceware dot org
- Date: Wed, 18 Mar 2015 16:07:07 +0000
- Subject: Re: [PATCH 1/2] Fast tracepoint for powerpc64le
- Authentication-results: sourceware.org; auth=none
- References: <201503181104 dot t2IB4bne004457 at d06av02 dot portsmouth dot uk dot ibm dot com>
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