This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 2/2] consolidate gdbserver global data
- From: Pedro Alves <palves at redhat dot com>
- To: Stan Cox <scox at redhat dot com>, gdb-patches at sourceware dot org
- Date: Mon, 21 Dec 2015 13:30:53 +0000
- Subject: Re: [PATCH v2 2/2] consolidate gdbserver global data
- Authentication-results: sourceware.org; auth=none
- References: <5648B89D dot 3050305 at redhat dot com> <n34r5m$nis$1 at ger dot gmane dot org> <n4v8lf$dpr$1 at ger dot gmane dot org>
Hi Stan,
On 12/17/2015 09:15 PM, Stan Cox wrote:
> This patch consolidates global data into two structures. Data that is
> related to the client is defined in the client_state structure,
> analogous to the remote_state structure in gdb/remote.c. Data that is
> related to the inferior running under gdbserver is defined in the
> server_status structure. This delineation is to allow, as a future
> expansion, the ability to have multiple clients, for example gdb and
> strace, connected to the same inferior. To maintain source
> compatibility, macros are defined so that global variable references do
> not have to be changed to be structure member references. New access
> functions are: new_client_state, which sets up a single client state
> and get_client_state which returns it They are analogous to
> new_remote_state and get_remote_state in gdb/remote.c. Going forward
> this infrastructure can be expanded so that multiple clients can be
> supported.
Sorry, I tried looking at this several times, but I always end up
very much confused on the client/server split. :-/
Most things in server_state seem specific to the currently
connected _GDB/client_ to me. E.g, the thread set with Hg.
Likewise readchar_buf. Etc.
Can you give an example on how this will work out in the end
when you have multiple instances of these objects?
- When will we have multiple server_state objects?
- When will we have multiple client_state objects?
- What are the relations between those objects?
We should also end up with a concise comment at the top
of these structs definitions explaining what they are for.
struct client_state has no intro comment, afaics.
Thanks,
Pedro Alves