[prev in list] [next in list] [prev in thread] [next in thread]
List: gdb-bugs
Subject: gdb bug
From: Gustav H?llberg <gustav () virtutech ! se>
Date: 2001-07-26 13:19:38
Message-ID: 200107261319.f6QDJcH20987 () virtutech ! se
[Download RAW message or body]
This bug was found on gdb 5.0, compiled with --host=i686-pc-linux-gnu
and --target=ia64-unknown-linux-gnu
"info regs" produces erroneous (byteswapped) output when running
cross-platform with the debug target having larger registers than host
long:s, and being little endian because of the following completely
broken code in infcmd.c:
/* FIXME! val_print probably can handle all of these cases now... */
/* Else if virtual format is too long for printf,
print in hex a byte at a time. */
else if (REGISTER_VIRTUAL_SIZE (i) > (int) sizeof (long))
{
register int j;
printf_filtered ("0x");
for (j = 0; j < REGISTER_VIRTUAL_SIZE (i); j++)
printf_filtered ("%02x", (unsigned char) virtual_buffer[j]);
}
This piece of code will, of course, only work if the virtual buffer
happens to contain bigendian data.
As the comment indicates(), val_print does handle this case correctly
(at least in my i686 - ia64 case), and this whole if-branch can just
be removed.
- Gustav
PS. This must be one of the snotties remarks I've ever read in a
how-to-report-bugs text (quote from info gdb/gdb bugs):
> Here are some things that are not necessary:
:
:
> * A guess about what the bug is or what it depends on.
>
> Such guesses are usually wrong. Even we cannot guess right about
> such things without first using the debugger to find the facts.
Reading such things really makes one want to help out correcting your
crappy code (NOT).
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic