This is the mail archive of the 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 v2 2/2] consolidate gdbserver global data

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.

Pedro Alves

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