From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8975 invoked by alias); 12 Jun 2005 07:57:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 8962 invoked by uid 22791); 12 Jun 2005 07:57:32 -0000 Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 12 Jun 2005 07:57:32 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id j5C7vThJ023710; Sun, 12 Jun 2005 09:57:29 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id j5C7vTXr014464; Sun, 12 Jun 2005 09:57:29 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id j5C7vQaP018328; Sun, 12 Jun 2005 09:57:26 +0200 (CEST) Date: Sun, 12 Jun 2005 07:57:00 -0000 Message-Id: <200506120757.j5C7vQaP018328@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: jason-swarelist@molenda.com CC: schwab@suse.de, gdb-patches@sources.redhat.com In-reply-to: <20050608232556.A53178@molenda.com> (message from Jason Molenda on Wed, 8 Jun 2005 23:25:56 -0700) Subject: Re: The gdb x86 function prologue parser References: <85C775AE-3B05-431E-96D2-49EA9D1413E6@apple.com> <20050608232556.A53178@molenda.com> X-SW-Source: 2005-06/txt/msg00119.txt.bz2 Date: Wed, 8 Jun 2005 23:25:56 -0700 From: Jason Molenda Hi Andreas, On Wed, Jun 08, 2005 at 09:58:12PM +0200, Andreas Schwab wrote: > >> +#include > > Since this is a target (not native) file it needs to use types portable to > all hosts. I'll drop stdint.h because it requires ISO C99, but I don't understand your comment. Is there some environment where uint32_t isn't 4 bytes? This is how I was using uint32_t and uint8_t: + /* 81 /5 id SUB r/m32, imm32 */ + if (op == 0x81 && next_op == 0xec) + { + uint32_t imm32 = read_memory_integer (pc + 2, 4); + esp_change -= imm32; + pc += 6; + continue; + } If code like this is wrong, I'd like to know. Oh yes, it's very wrong ;-). The function read_memory_integer returns a signed integer which you're assigning to an unsigned integer type. Conceptually, if we could assume int32_t was available on all systems, that would be fine. But since we cannot, using LONGEST is the safest thing to do. Mark