From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28222 invoked by alias); 9 Sep 2009 03:31:12 -0000 Received: (qmail 28108 invoked by uid 22791); 9 Sep 2009 03:31:10 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_LWSHORTT X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Sep 2009 03:31:04 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id B0BB216009; Tue, 8 Sep 2009 20:31:00 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost3.vmware.com (Postfix) with ESMTP id A3E19CD96F; Tue, 8 Sep 2009 20:31:00 -0700 (PDT) Message-ID: <4AA72116.1000302@vmware.com> Date: Wed, 09 Sep 2009 03:31:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Hui Zhu CC: Joel Brobecker , "gdb-patches@sourceware.org" , "freephp@gmail.com" Subject: Re: [PATCH] Fix cygwin build error with i386-linux-tdep.c References: <200908301356.n7UDuO4a006136@brahms.sibelius.xs4all.nl> <4AA2CAFA.809@vmware.com> <20090905211541.GC30677@adacore.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00233.txt.bz2 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. If you look at CVS head, I think everything that this patch changes is already in. Didn't mean to "cut you out"... ;-) 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? Mark -- 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 Michael Snyder >> Joel Brobecker >> Hui Zhu >> >> * i386-linux-tdep.c (i386_linux_intx80_sysenter_record): Change >> regcache_raw_read to regcache_raw_read_signed. >> >> Index: i386-linux-tdep.c >> =================================================================== >> 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 10 Aug 2009 03:04:44 -0000 1.66 >> +++ i386-linux-tdep.c 6 Sep 2009 02:12:15 -0000 >> @@ -367,18 +367,19 @@ static int >> i386_linux_intx80_sysenter_record (struct regcache *regcache) >> { >> int ret; >> - uint32_t tmpu32; >> + LONGEST syscall; >> >> - regcache_raw_read (regcache, I386_EAX_REGNUM, (gdb_byte *) &tmpu32); >> + regcache_raw_read_signed (regcache, I386_EAX_REGNUM, &syscall); >> >> - if (tmpu32 > 499) >> + if (syscall < 0 || syscall > 499) >> { >> printf_unfiltered (_("Process record and replay target doesn't " >> - "support syscall number %u\n"), tmpu32); >> + "support syscall number %s\n"), >> + plongest (syscall)); >> return -1; >> } >> >> - ret = record_linux_system_call (tmpu32, regcache, >> + ret = record_linux_system_call (syscall, regcache, >> &i386_linux_record_tdep); >> if (ret) >> return ret; >>