From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32721 invoked by alias); 31 Aug 2009 08:49:03 -0000 Received: (qmail 32709 invoked by uid 22791); 31 Aug 2009 08:49:02 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-yw0-f176.google.com (HELO mail-yw0-f176.google.com) (209.85.211.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 31 Aug 2009 08:48:55 +0000 Received: by ywh6 with SMTP id 6so5822285ywh.0 for ; Mon, 31 Aug 2009 01:48:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.7.6 with SMTP id 6mr8671656ybg.261.1251708533362; Mon, 31 Aug 2009 01:48:53 -0700 (PDT) In-Reply-To: <7d77a27d0908310145w2bcafc4bq2ed9bbd2ccff3d03@mail.gmail.com> References: <200908301356.n7UDuO4a006136@brahms.sibelius.xs4all.nl> <7d77a27d0908310145w2bcafc4bq2ed9bbd2ccff3d03@mail.gmail.com> From: Hui Zhu Date: Mon, 31 Aug 2009 12:05:00 -0000 Message-ID: Subject: Re: [PATCH] Fix cygwin build error with i386-linux-tdep.c To: Jiang Jilin Cc: Mark Kettenis , gdb-patches@sourceware.org, msnyder@vmware.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-08/txt/msg00577.txt.bz2 On Mon, Aug 31, 2009 at 16:45, Jiang Jilin wrote: > On Mon, Aug 31, 2009 at 4:22 PM, Hui Zhu wrote: > >> Hi guys, >> >> I make a new patch that change regcache_raw_read to regcache_raw_read_un= signed. >> Please help me review it. >> >> Thanks, >> Hui >> >> 2009-08-31 =A0Hui Zhu =A0 >> >> =A0 =A0 =A0 =A0* i386-linux-tdep.c (i386_linux_intx80_sysenter_record): = Change >> =A0 =A0 =A0 =A0regcache_raw_read to regcache_raw_read_unsigned. >> >> --- >> =A0i386-linux-tdep.c | =A0 10 +++++----- >> =A01 file changed, 5 insertions(+), 5 deletions(-) >> >> --- a/i386-linux-tdep.c >> +++ b/i386-linux-tdep.c >> @@ -367,18 +367,18 @@ static int >> =A0i386_linux_intx80_sysenter_record (struct regcache *regcache) >> =A0{ >> =A0 int ret; >> - =A0uint32_t tmpu32; >> + =A0ULONGEST num; >> >> - =A0regcache_raw_read (regcache, I386_EAX_REGNUM, (gdb_byte *) &tmpu32); >> + =A0regcache_raw_read_unsigned (regcache, I386_EAX_REGNUM, &num); >> >> - =A0if (tmpu32 > 499) >> + =A0if (num > 499) >> =A0 =A0 { >> =A0 =A0 =A0 printf_unfiltered (_("Process record and replay target doesn= 't " >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "support syscall n= umber %u\n"), tmpu32); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "support syscall n= umber %d\n"), (int) num); > > if you want an integer read, why not use regcache_raw_read_signed() inste= ad? > >> =A0 =A0 =A0 return -1; >> =A0 =A0 } >> >> - =A0ret =3D record_linux_system_call (tmpu32, regcache, >> + =A0ret =3D record_linux_system_call ((int) num, regcache, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&i386= _linux_record_tdep); >> =A0 if (ret) >> =A0 =A0 return ret; >> > > I think it's not very sensible to cast unsigned to signed, think about > if the unsigned value is _very_ big. > This is syscall id, it will not _very_ big. Hui