This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
memory window: bug wrt endianness
- From: Ruppert <ru at swb dot siemens dot de>
- To: insight at sources dot redhat dot com
- Cc: ru at swb dot siemens dot de
- Date: Mon, 4 Nov 2002 17:41:15 +0100 (MET)
- Subject: memory window: bug wrt endianness
- Reply-to: Ruppert <ru at swb dot siemens dot de>
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 ?
-------------------
Regards
Dieter Ruppert
RTS GmbH
ru@swb.siemens.de