This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: memory window: bug wrt endianness
- From: "Martin M. Hunt" <hunt at redhat dot com>
- To: Ruppert <ru at swb dot siemens dot de>
- Cc: insight at sources dot redhat dot com
- Date: 04 Nov 2002 10:44:54 -0800
- Subject: Re: memory window: bug wrt endianness
- References: <200211041641.gA4GfFD07597@fiji.swb.siemens.de>
On Mon, 2002-11-04 at 08:41, Ruppert wrote:
>
> Hi,
>
> I think I found a bug with the implementation of the memory
> window in insight-5.1: values written to memory from the memory
> window are written with the wrong endianness (at least in the "word"
> representation of the window).
>
> This was observed on a Suse Linux system with insight-5.1 installed.
>
>
> Consider the following trivial program:
>
> #include <stdio.h>
>
> int i = 1;
>
> int main() {
> printf("Hello World: %d\n",i);
> return 0;
> }
>
> At a breakpoint at the printf statement, I get in a console window:
>
> (gdb) p i
> $1 = 1
>
> (gdb) p &i
> $2 = (int *) 0x8049518
>
> When I open the memory window, it displays 0x00000001 in the field
> which corresponds to address 0x8049518. Then I click into this field,
> change this to 0x00000002 and press Enter. The field continues to
> display 0x00000002. When I scroll up or down in the memory window
> the contents of this field suddenly changes to 0x02000000. This value
> appears also in the console window:
>
> (gdb) p /x i
> $3 = 0x2000000
>
> From this I conclude that the "memory write" from the memory window
> in insight-5.1 has written the value of i with the wrong endianness.
> This can also be seen when I change the "size" preference to "Byte":
> the value "2" was written to 0x804951b and not to 0x8049518.
>
> I could myself do some debugging, so: Could anybody give me a hint where
> to look for the reason for this ?
This sounds like a bug I fixed a year ago. You could try the following
patch, or just update to a newer release than 5.1.
http://sources.redhat.com/ml/insight/2001-q4/msg00298.html
Martin