This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] remote.c: Use the ptid.lwp field to store remote thread ids rather than ptid.tid.
- From: Doug Evans <dje at google dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Wed, 12 Feb 2014 10:09:20 -0800
- Subject: Re: [PATCH 1/2] remote.c: Use the ptid.lwp field to store remote thread ids rather than ptid.tid.
- Authentication-results: sourceware.org; auth=none
- References: <1392214020-21478-1-git-send-email-palves at redhat dot com> <1392214020-21478-2-git-send-email-palves at redhat dot com>
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.