From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13748 invoked by alias); 4 Feb 2010 21:46:50 -0000 Received: (qmail 13737 invoked by uid 22791); 4 Feb 2010 21:46:49 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Feb 2010 21:46:45 +0000 Received: from kpbe17.cbf.corp.google.com (kpbe17.cbf.corp.google.com [172.25.105.81]) by smtp-out.google.com with ESMTP id o14LkhJf026012 for ; Thu, 4 Feb 2010 13:46:43 -0800 Received: from fxm9 (fxm9.prod.google.com [10.184.13.9]) by kpbe17.cbf.corp.google.com with ESMTP id o14Lk4fh000755 for ; Thu, 4 Feb 2010 13:46:42 -0800 Received: by fxm9 with SMTP id 9so589994fxm.10 for ; Thu, 04 Feb 2010 13:46:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.91.81 with SMTP id g59mr928309wef.128.1265320001184; Thu, 04 Feb 2010 13:46:41 -0800 (PST) In-Reply-To: <201002040205.23317.vapier@gentoo.org> References: <201002040205.23317.vapier@gentoo.org> Date: Thu, 04 Feb 2010 21:46:00 -0000 Message-ID: Subject: Re: [patch] fix typo in sim_state documentation From: Doug Evans To: Mike Frysinger Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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-02/txt/msg00140.txt.bz2 On Wed, Feb 3, 2010 at 11:05 PM, Mike Frysinger wrote: > the sim-base.h suggests you declare cpu storage in sim_state, but the pro= posed > code causes build failures in some files such as sim-core and sim-cpu.c (= since > STATE_CPU() is supposed to return an lvalue). > > it also doesnt make sense with the common sim_cpu_alloc_all() which > dynamically allocates the memory for each cpu. > > 2010-02-04 =A0Mike Frysinger =A0 > > =A0 =A0 =A0 =A0* sim-base.h: Declare sim_state.cpu as a pointer in the co= mment. =A0Drop > =A0 =A0 =A0 =A0& from the STATE_CPU() examples. > > RCS file: /cvs/src/src/sim/common/sim-base.h,v > retrieving revision 1.11 > diff -u -p -r1.11 sim-base.h > --- sim/common/sim-base.h =A0 =A0 =A0 1 Jan 2010 10:03:27 -0000 =A0 =A0 = =A0 1.11 > +++ sim/common/sim-base.h =A0 =A0 =A0 4 Feb 2010 07:02:42 -0000 > @@ -44,11 +44,11 @@ along with this program. =A0If not, see =A0 =A0 =A0}; > > =A0 =A0 =A0struct sim_state { > - =A0 =A0 =A0 sim_cpu cpu[MAX_NR_PROCESSORS]; > + =A0 =A0 =A0 sim_cpu *cpu[MAX_NR_PROCESSORS]; > =A0 =A0 =A0#if (WITH_SMP) > - =A0 =A0 #define STATE_CPU(sd,n) (&(sd)->cpu[n]) > + =A0 =A0 #define STATE_CPU(sd,n) ((sd)->cpu[n]) > =A0 =A0 =A0#else > - =A0 =A0 #define STATE_CPU(sd,n) (&(sd)->cpu[0]) > + =A0 =A0 #define STATE_CPU(sd,n) ((sd)->cpu[0]) > =A0 =A0 =A0#endif > =A0 =A0 =A0 =A0... simulator specific members ... > =A0 =A0 =A0 =A0sim_state_base base; > This patch is ok. Thanks.