Thread View: gnu.gdb.bug
1 messages
1 total messages
Started by Brad Davis
Fri, 29 Sep 1989 13:36
GDB 3.2 on BIG_ENDIAN machines...
Author: Brad Davis
Date: Fri, 29 Sep 1989 13:36
Date: Fri, 29 Sep 1989 13:36
34 lines
1316 bytes
1316 bytes
Compiler: gcc1.35/gas1.34
CPU: 68020
Machine: ISI Optimum V16
OS: BSD4.3 4.0E
The following program gives a bogus (shifted up by 16 bits) value for
'a' when 'a' is printed by GDB.
foo1(short a)
{
printf("%d\n", a);
}
main()
{
foo1(4);
}
I traced the problem to 'read_inferior_memory' (and
'write_inferior_memory') in the bopy() call. Since 'a' is a short
then the address passed to 'read_inferior..' is not the long word
address of 'a' but two bytes higher (the short word address). A bcopy
is performed on the short word address, into a long word address,
causing the two short words to be swapped.
Swapping words fixed this but breaks other things.
The problem also exists with 'char' parameters and on Sun's and under
GDB 3.1.
This doesn't happen on SMALL_ENDIAN machines since the long word
address and the short word address are the same.
Brad Davis
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads