From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31801 invoked by alias); 31 Aug 2009 08:46:25 -0000 Received: (qmail 31792 invoked by uid 22791); 31 Aug 2009 08:46:24 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from qw-out-1920.google.com (HELO qw-out-1920.google.com) (74.125.92.149) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 31 Aug 2009 08:46:19 +0000 Received: by qw-out-1920.google.com with SMTP id 5so1287686qwf.24 for ; Mon, 31 Aug 2009 01:46:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.114.209 with SMTP id f17mr1447302qcq.21.1251708377138; Mon, 31 Aug 2009 01:46:17 -0700 (PDT) In-Reply-To: References: <200908301356.n7UDuO4a006136@brahms.sibelius.xs4all.nl> From: Jiang Jilin Date: Mon, 31 Aug 2009 08:49:00 -0000 Message-ID: <7d77a27d0908310145w2bcafc4bq2ed9bbd2ccff3d03@mail.gmail.com> Subject: Re: [PATCH] Fix cygwin build error with i386-linux-tdep.c To: Hui Zhu 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/msg00576.txt.bz2 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_uns= igned. > 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): C= hange > =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 nu= mber %u\n"), tmpu32); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "support syscall nu= mber %d\n"), (int) num); if you want an integer read, why not use regcache_raw_read_signed() instead? > =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. --=20 Thanks Jiang