From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16438 invoked by alias); 28 Sep 2010 20:23:41 -0000 Received: (qmail 16430 invoked by uid 22791); 28 Sep 2010 20:23:40 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,TW_CP,TW_EG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Sep 2010 20:23:34 +0000 Received: (qmail 7550 invoked from network); 28 Sep 2010 20:23:32 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 28 Sep 2010 20:23:32 -0000 From: Pedro Alves To: gdb-patches@sourceware.org, "H.J. Lu" Subject: Re: PATCH: gdbserver: Clear regcache if buf is NULL Date: Wed, 29 Sep 2010 01:54:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.33-29-realtime; KDE/4.4.2; x86_64; ; ) References: <20100203174414.GA29948@lucon.org> In-Reply-To: <20100203174414.GA29948@lucon.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201009282123.29913.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2010-09/txt/msg00477.txt.bz2 On Wednesday 03 February 2010 17:44:14, H.J. Lu wrote: > If xstate_bv bits are zero, XSAVE extended state is in init state and > gdbserver should treat XMM/YMM registers as 0. This patch clears regcache > if buf is NULL. OK to install? > > Thanks. > > > H.J. > --- > 2010-02-03 H.J. Lu > > * regcache.c (supply_register): Clear regcache if buf is NULL. > > diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c > index 2082604..d6cdc46 100644 > --- a/gdb/gdbserver/regcache.c > +++ b/gdb/gdbserver/regcache.c > @@ -215,7 +215,10 @@ register_data (struct regcache *regcache, int n, int fetch) > void > supply_register (struct regcache *regcache, int n, const void *buf) > { > - memcpy (register_data (regcache, n, 0), buf, register_size (n)); > + if (buf) > + memcpy (register_data (regcache, n, 0), buf, register_size (n)); > + else > + memset (register_data (regcache, n, 0), 0, register_size (n)); > } Hi H.J.. I'm looking at where in the current sources this ended up being used, and not finding it. Am I right in thinking that the need for this was obsoleted when you later tought gdbserver x86-linux about xml descriptions? I'm teaching gdbserver to tell gdb about unavailable registers in the context of tracepoint frames, and wondering whether to put that info in the regcache for general use, or whether I can make it tracepoint specific. -- Pedro Alves