This is the mail archive of the gdb-patches@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]

Re: [PATCH 1/2] remote.c: Use the ptid.lwp field to store remote thread ids rather than ptid.tid.


On Wed, Feb 12, 2014 at 6:06 AM, Pedro Alves <palves@redhat.com> wrote:
> From GDB's perspective, independently of how the target really
> implements threads, gdb/remote sees all threads as if kernel/system
> threads.  A rationale along theses lines led to gdbserver storing
> thread ids in ptid.lwp in all ports.
>
> I believe that on the GDB side too, it's best that we standardize on
> process_stratum targets using the ptid.lwp field to store thread ids.
> The idea being leave the ptid.tid field free for any thread_stratum
> target that might want to sit on top.
>
> Because remote.c is currently using ptid.tid, we can't make gdbserver
> and gdb share bits of remote-specific code that manipulates ptids.
>
> This patch thus makes remote.c use ptid.lwp instead of ptid.tid.
>
> Tested on x86_64 Fedora 17, w/ local gdbserver.
>
> gdb/
> 2014-02-12  Pedro Alves  <palves@redhat.com>
>
>         * remote.c (remote_thread_alive, write_ptid, read_ptid)
>         (read_ptid, remote_newthread_step, remote_threads_extra_info)
>         (remote_get_ada_task_ptid, append_resumption, remote_stop_ns)
>         (threadalive_test, remote_pid_to_str, _initialize_remote): Use the
>         ptid.lwp field to store remote thread ids rather than ptid.tid.

Awesome.  Thanks.


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