From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49001 invoked by alias); 21 Dec 2015 13:30:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 48986 invoked by uid 89); 21 Dec 2015 13:30:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Etc, concise, relations, clients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 21 Dec 2015 13:30:55 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 7DE67C803 for ; Mon, 21 Dec 2015 13:30:54 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBLDUre0023706; Mon, 21 Dec 2015 08:30:53 -0500 Message-ID: <5677FF0D.3090501@redhat.com> Date: Mon, 21 Dec 2015 13:30:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Stan Cox , gdb-patches@sourceware.org Subject: Re: [PATCH v2 2/2] consolidate gdbserver global data References: <5648B89D.3050305@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-12/txt/msg00429.txt.bz2 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