This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [OB] Rename some more variables called 'tmp' from i386_process_record
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: msnyder at vmware dot com, teawater at gmail dot com
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 8 Mar 2010 10:21:29 +0100 (CET)
- Subject: Re: [OB] Rename some more variables called 'tmp' from i386_process_record
- References: <4B944AD5.8090407@vmware.com>
> Date: Sun, 07 Mar 2010 16:54:45 -0800
> From: Michael Snyder <msnyder@vmware.com>
>
> Rename tmpu16, tmpu32 and tmpu64.
Whoa there! Looking at how these variables are used, I just noticed
that this code is broken:
> + uint32_t addr32;
> +
> + if (target_read_memory (ir.addr, (gdb_byte *) &addr32, 4))
You're reading from target memory (which is little endian) into a
32-bit variable in host memory (which is big endian). That's wrong!
And the process record stuff is full of it.
Please fix this by reading into a gdb_byte buffer and using
extract_{signed|unsigned}_integer(), or use
read_memeory_{unsigned_}integer().