From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8986 invoked by alias); 10 Jan 2002 11:28:02 -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 8918 invoked from network); 10 Jan 2002 11:27:56 -0000 Received: from unknown (HELO dell-pe2450-3.cambridge.redhat.com) (195.224.55.225) by sources.redhat.com with SMTP; 10 Jan 2002 11:27:56 -0000 Received: from north-pole.nickc.cambridge.redhat.com (host217-35-40-66.in-addr.btopenworld.com [217.35.40.66]) by dell-pe2450-3.cambridge.redhat.com (Postfix) with ESMTP id 2E90584FF4; Thu, 10 Jan 2002 11:27:55 +0000 (GMT) Received: from north-pole.nickc.cambridge.redhat.com.nickc.cambridge.redhat.com (localhost [127.0.0.1]) by north-pole.nickc.cambridge.redhat.com (Postfix) with ESMTP id 3C3D91118E7; Thu, 10 Jan 2002 11:22:18 +0000 (GMT) To: fnf@redhat.com Cc: gdb-patches@sources.redhat.com Subject: Re: RFC: ARM simulator coredump References: <200201092258.g09MwlU26601@fred.ninemoons.com> <3C3CD2BA.30209@cygnus.com> From: Nick Clifton Date: Thu, 10 Jan 2002 03:28:00 -0000 In-Reply-To: <3C3CD2BA.30209@cygnus.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-01/txt/msg00219.txt.bz2 Hi Fred, > The ARM simulator is dumping core during gdb testing for arm-elf: Which gdb test(s) in particular ? > This patch seems to work, but I've not really checked it too > carefully for correctness. Can whomever is responsible for the ARM > simulator look it over please? Thanks. Sure - that would be me. The patch has the right idea, but also a few mistakes. Mind you seeing it prompted me to dig up an old patch that I had for this and apply it. Please try updating your sources and let me know if this had fixed things. In case you are interested here are a few comments on the patch. > - if (cp14r0 && ARMul_CP14_R0_ENABLE) > + if (ok && ARMul_CP14_R0_ENABLE) This was a bug in the original code. The intention was to test the ARMul_CP14_R0_ENABLE bit in the r0 register of co-processor 14, so '&' should have been used instead of '&&'. Hence the correct version of this line would be: if (ok && (cp14r0 & ARMul_CP14_R0_ENABLE)) > - if (cp14r0 && ARMul_CP14_R0_CCD) > + if (ok && ARMul_CP14_R0_CCD) A similar comment applied here, plus there is no need to retest 'ok'. > - if (state->CPRead[13] (state, 8, 0) > + ARMword temp; > + if (state->CPRead[13] (state, 8, &temp) > && ARMul_CP13_R8_PMUS) And here. > + { > + ARMword temp; There is no need to declare a 'temp' variable here. There is a variable of the same type and name declared at the top of the function, and it is no longer being used by this point. Cheers Nick