Re: The gdb x86 function prologue parser

Jason Molenda
2005-06-09T06:26:02Z

Hi Andreas,

On Wed, Jun 08, 2005 at 09:58:12PM +0200, Andreas Schwab wrote:

> >> +#include <stdint.h>
>
> 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.

Thanks,

Jason