From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30338 invoked by alias); 13 Feb 2009 22:11:38 -0000 Received: (qmail 30328 invoked by uid 22791); 13 Feb 2009 22:11:37 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Feb 2009 22:11:25 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n1DMBMTm086465 ; Fri, 13 Feb 2009 23:11:22 +0100 (CET) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402:d::10]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n1DMBM0o053027 ; Fri, 13 Feb 2009 23:11:22 +0100 (CET) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n1DMBKOW052402 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Fri, 13 Feb 2009 23:11:21 +0100 (CET) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Maxim Grigoriev'" Cc: References: <005801c98dfc$2252da60$66f88f20$@u-strasbg.fr> <4995BEF7.3040906@hq.tensilica.com> In-Reply-To: <4995BEF7.3040906@hq.tensilica.com> Subject: RE: [RFA] xtensa-tdep.c ARI fix Date: Fri, 13 Feb 2009 22:49:00 -0000 Message-ID: <000001c98e28$02a45550$07ecfff0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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: 2009-02/txt/msg00311.txt.bz2 Thanks, I checked the patch in. Pierre Muller Pascal language support maintainer for GDB > -----Message d'origine----- > De=A0: Maxim Grigoriev [mailto:maxim@tensilica.com] > Envoy=E9=A0: Friday, February 13, 2009 7:42 PM > =C0=A0: Pierre Muller > Cc=A0: gdb-patches@sourceware.org; maxim2405@gmail.com > Objet=A0: Re: [RFA] xtensa-tdep.c ARI fix >=20 > Hello Pierre, >=20 > >> Maxim, is this OK? >=20 > Yes. Thank you very much for noticing this issue and making a clean-up. >=20 > -- Maxim >=20 >=20 > Pierre Muller wrote: > > Current ARI > > has one critical "hash" failure: > > > > hash 1 Do not use ` #...', instead use `#...' > > (some compilers only correctly parse a C preprocessor directive when > `#' is > > the first character on the line) > > > > coming from xtensa-tdep.c > > It appears that the offending line is > > #define BSZ 32 /* Instruction buffer size. */ > > I could have removed the starting spaces and commit the change as > obvious, > > but there is already a macro defining the instruction buffer size > > at line 1050: > > #define XTENSA_ISA_BSZ 32 /* Instruction buffer size. */ > > > > So I propose here a patch getting rid of the BSZ macro > > and using XTENSA_ISA_BSZ in place of BSZ > > in call0_analyse_prologue function. > > > > Maxim, is this OK? > > > > > > 2009-02-13 Pierre Muller > > > > * xtensa-tdep.c (call0_analyze_prologue): Delete BSZ macro. > > Replace BSZ macro uses by XTENSA_ISA_BSZ macro. > > > > > > > > Index: xtensa-tdep.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > RCS file: /cvs/src/src/gdb/xtensa-tdep.c,v > > retrieving revision 1.30 > > diff -u -p -r1.30 xtensa-tdep.c > > --- xtensa-tdep.c 3 Jan 2009 05:57:54 -0000 1.30 > > +++ xtensa-tdep.c 13 Feb 2009 16:44:55 -0000 > > @@ -2092,8 +2092,7 @@ call0_analyze_prologue (CORE_ADDR start, > > CORE_ADDR ia; /* Current insn address in > prologue. */ > > CORE_ADDR ba =3D 0; /* Current address at base of insn > buffer. */ > > CORE_ADDR bt; /* Current address at top+1 of > insn > > buffer. > > */ > > - #define BSZ 32 /* Instruction buffer size. */ > > - char ibuf[BSZ]; /* Instruction buffer for decoding > prologue. */ > > + char ibuf[XTENSA_ISA_BSZ];/* Instruction buffer for decoding > prologue. > > */ > > xtensa_isa isa; /* libisa ISA handle. */ > > xtensa_insnbuf ins, slot; /* libisa handle to decoded insn, slot. > */ > > xtensa_format ifmt; /* libisa instruction format. */ > > @@ -2153,7 +2152,7 @@ call0_analyze_prologue (CORE_ADDR start, > > if (!xtensa_default_isa) > > xtensa_default_isa =3D xtensa_isa_init (0, 0); > > isa =3D xtensa_default_isa; > > - gdb_assert (BSZ >=3D xtensa_isa_maxlength (isa)); > > + gdb_assert (XTENSA_ISA_BSZ >=3D xtensa_isa_maxlength (isa)); > > ins =3D xtensa_insnbuf_alloc (isa); > > slot =3D xtensa_insnbuf_alloc (isa); > > > > @@ -2166,7 +2165,7 @@ call0_analyze_prologue (CORE_ADDR start, > > if (ia + xtensa_isa_maxlength (isa) > bt) > > { > > ba =3D ia; > > - bt =3D (ba + BSZ) < body_pc ? ba + BSZ : body_pc; > > + bt =3D (ba + XTENSA_ISA_BSZ) < body_pc ? ba + XTENSA_ISA_BSZ > : > > body_pc; > > read_memory (ba, ibuf, bt - ba); > > } > > > >