From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3117 invoked by alias); 9 Sep 2009 05:59:44 -0000 Received: (qmail 3039 invoked by uid 22791); 9 Sep 2009 05:59:43 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,SARE_LWSHORTT,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pz0-f193.google.com (HELO mail-pz0-f193.google.com) (209.85.222.193) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Sep 2009 05:59:35 +0000 Received: by pzk31 with SMTP id 31so2337159pzk.23 for ; Tue, 08 Sep 2009 22:59:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.129.7 with SMTP id g7mr687397wfn.43.1252475971155; Tue, 08 Sep 2009 22:59:31 -0700 (PDT) In-Reply-To: <4AA72116.1000302@vmware.com> References: <200908301356.n7UDuO4a006136@brahms.sibelius.xs4all.nl> <4AA2CAFA.809@vmware.com> <20090905211541.GC30677@adacore.com> <4AA72116.1000302@vmware.com> From: Hui Zhu Date: Wed, 09 Sep 2009 05:59:00 -0000 Message-ID: Subject: Re: [PATCH] Fix cygwin build error with i386-linux-tdep.c To: Michael Snyder Cc: Joel Brobecker , "gdb-patches@sourceware.org" , "freephp@gmail.com" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2009-09/txt/msg00236.txt.bz2 On Wed, Sep 9, 2009 at 11:29, Michael Snyder wrote: > Hui Zhu wrote: >> >> Hi guys, >> >> What do you think about this patch? > > Hey, Hui, > > Appologies -- this patch of yours sort of got subsumed into my > bigger syscall patch. =A0If you look at CVS head, I think everything > that this patch changes is already in. Great. Thanks a lot. Hui > > Didn't mean to "cut you out"... =A0 ;-) > > Michael > > >> On Sun, Sep 6, 2009 at 12:15, Hui Zhu wrote: >>> >>> On Sun, Sep 6, 2009 at 05:15, Joel Brobecker >>> wrote: >>>>> >>>>> I could suggest casting it to (unsigned int), but it wouldn't >>>>> really make any difference, would it? =A0Mark -- Jiang -- would >>>>> that make you guys more comfortable? >>>> >>>> Short term, I'd rather see us read the syscall number as a signed >>>> number since this is what record_linux_system_call expects. We can >>>> decide whether to rationalize as a signed or unsigned as a separate >>>> patch. I think Mark was OK with the patch I sent yesterday, except >>>> that he said we should add a check against negative values. >>>> >>>> There is also a cast that is unnecessary in the error message. >>>> Hui can use %s/paddress rather than %d/cast. >>>> >>>> -- >>>> Joel >>>> >>> Hi guys, >>> >>> I make a new patch according to your comment. >>> >>> Thanks, >>> Hui >>> >>> >>> 2009-09-06 =A0Michael Snyder =A0 >>> =A0 =A0 =A0 =A0 =A0 Joel Brobecker =A0 >>> =A0 =A0 =A0 =A0 =A0 Hui Zhu =A0 >>> >>> =A0 =A0 =A0 * i386-linux-tdep.c (i386_linux_intx80_sysenter_record): Ch= ange >>> =A0 =A0 =A0 regcache_raw_read to regcache_raw_read_signed. >>> >>> Index: i386-linux-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/i386-linux-tdep.c,v >>> retrieving revision 1.66 >>> diff -u -p -r1.66 i386-linux-tdep.c >>> --- i386-linux-tdep.c =A0 10 Aug 2009 03:04:44 -0000 =A0 =A0 =A01.66 >>> +++ i386-linux-tdep.c =A0 6 Sep 2009 02:12:15 -0000 >>> @@ -367,18 +367,19 @@ static int >>> =A0i386_linux_intx80_sysenter_record (struct regcache *regcache) >>> =A0{ >>> =A0int ret; >>> - =A0uint32_t tmpu32; >>> + =A0LONGEST syscall; >>> >>> - =A0regcache_raw_read (regcache, I386_EAX_REGNUM, (gdb_byte *) &tmpu32= ); >>> + =A0regcache_raw_read_signed (regcache, I386_EAX_REGNUM, &syscall); >>> >>> - =A0if (tmpu32 > 499) >>> + =A0if (syscall < 0 || syscall > 499) >>> =A0 =A0{ >>> =A0 =A0 =A0printf_unfiltered (_("Process record and replay target doesn= 't " >>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "support syscall = number %u\n"), tmpu32); >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "support syscall = number %s\n"), >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0plongest (syscall)); >>> =A0 =A0 =A0return -1; >>> =A0 =A0} >>> >>> - =A0ret =3D record_linux_system_call (tmpu32, regcache, >>> + =A0ret =3D record_linux_system_call (syscall, regcache, >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &i386_l= inux_record_tdep); >>> =A0if (ret) >>> =A0 =A0return ret; >>> > >