From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14119 invoked by alias); 5 Nov 2014 20:45:39 -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 14108 invoked by uid 89); 5 Nov 2014 20:45:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 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; Wed, 05 Nov 2014 20:45:37 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA5KjYFI005444 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Nov 2014 15:45:34 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA5KjWAc007317; Wed, 5 Nov 2014 15:45:33 -0500 Message-ID: <545A8C6C.2030108@redhat.com> Date: Wed, 05 Nov 2014 20:45:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Markus Metzger CC: gdb-patches@sourceware.org, Eli Zaretskii Subject: Re: [PATCH 04/12] record btrace: add configuration struct References: <1405346196-1804-1-git-send-email-markus.t.metzger@intel.com> <1405346196-1804-5-git-send-email-markus.t.metzger@intel.com> In-Reply-To: <1405346196-1804-5-git-send-email-markus.t.metzger@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-11/txt/msg00105.txt.bz2 On 07/14/2014 02:56 PM, Markus Metzger wrote: > index 146d95f..c601e8d 100644 > --- a/gdb/gdbserver/server.c > +++ b/gdb/gdbserver/server.c > @@ -131,6 +131,9 @@ struct vstop_notif > struct target_waitstatus status; > }; > > +/* The current btrace configuration. */ > +static struct btrace_config current_btrace_conf; Why do we need this global? Please expand the comment. > --- a/gdb/remote.c > +++ b/gdb/remote.c > +/* The target's btrace configuration. */ > + > +static struct btrace_config btrace_target_config; If this mirrors the state on the remote target, then it should be a field of struct remote_state, not global. > +/* Synchronize the configuration with the target. */ > + > +static void btrace_sync_conf (const struct btrace_config *conf) Line break after void. > +{ > + /* Nothing to do for now. */ > +} > + > +/* Read the current thread's btrace configuration from the target and > + store it into CONF. */ > + > +static void btrace_read_config (struct btrace_config *conf) > +{ Line break after void. > +static void btrace_read_config (struct btrace_config *conf) > +{ > + struct cleanup *cleanup; Move this within the if block below. > + char *xml; > + > + xml = target_read_stralloc (¤t_target, > + TARGET_OBJECT_BTRACE_CONF, ""); > + if (xml != NULL) > + { > + > + cleanup = make_cleanup (xfree, xml); > + parse_xml_btrace_conf (conf, xml); Spurious empty line. Thanks, Pedro Alves