From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23524 invoked by alias); 4 Dec 2003 07:32:29 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23516 invoked from network); 4 Dec 2003 07:32:28 -0000 Received: from unknown (HELO jifvik.dyndns.org) (81.104.194.28) by sources.redhat.com with SMTP; 4 Dec 2003 07:32:28 -0000 Received: from eCosCentric.com (garibaldi.jifvik.org [172.31.1.2]) by jifvik.dyndns.org (Postfix) with ESMTP id A20B237485; Thu, 4 Dec 2003 07:32:23 +0000 (GMT) Message-ID: <3FCEE306.5050604@eCosCentric.com> Date: Thu, 04 Dec 2003 07:32:00 -0000 From: Jonathan Larmour User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.4) Gecko/20030703 X-Accept-Language: en-gb, en, en-us MIME-Version: 1.0 To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: powerpc remote target registers References: <3FC7FF5D.7060906@eCosCentric.com> <3FCB8DDC.30603@gnu.org> <3FCC21B2.30000@eCosCentric.com> <3FCD6527.9000506@gnu.org> In-Reply-To: <3FCD6527.9000506@gnu.org> Content-Type: multipart/mixed; boundary="------------000300030403030404050504" X-SW-Source: 2003-12/txt/msg00107.txt.bz2 This is a multi-part message in MIME format. --------------000300030403030404050504 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1021 Andrew Cagney wrote: > >> But then the registers aren't marked as cached at all, so they're now >> requested from the target each time you do "info all-registers", even >> though they come up with 0s. Should I pretend the registers not >> supplied by the target were 0, or should I mark them as unavailable >> (i.e. the same as what having an "x" does) so at least it's consistent? > > > Ah, they should be supplied but with a value of zero. The protocol (for > historic reasons) specifies that a short G packet should have the > missing entries treated as zero (like you intended). Good, in which case the attached patch (against 6.0) should do it. Mostly indent changes, boringly enough. 2003-12-04 Jonathan Larmour * remote.c (remote_fetch_registers): If target doesn't supply registers, set them to zero. Thanks, Jifl -- eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts --["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine --------------000300030403030404050504 Content-Type: text/plain; name="remoteregzero.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="remoteregzero.patch" Content-length: 975 --- remote.c.old 2003-12-02 03:05:46.000000000 +0000 +++ remote.c 2003-12-04 07:19:38.000000000 +0000 @@ -3498,19 +3498,31 @@ remote_fetch_registers (int regnum) warning ("Remote reply is too short: %s", buf); } supply_them: { - int i; + int i, end_targ_regs=0; for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++) { struct packet_reg *r = &rs->regs[i]; + + if (buf[r->offset * 2] == 0) + end_targ_regs = 1; /* end of registers supplied by target */ if (r->in_g_packet) { - supply_register (r->regnum, regs + r->offset); - if (buf[r->offset * 2] == 'x') - set_register_cached (i, -1); + if (end_targ_regs) + { + /* If the target hasn't sent enough registers, set + the remainder to 0. */ + supply_register (r->regnum, 0); + } + else + { + supply_register (r->regnum, regs + r->offset); + if (buf[r->offset * 2] == 'x') + set_register_cached (i, -1); + } } } } } --------------000300030403030404050504--