This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
tdep/1277: Accessing ARM FP registers cause gdb-internal-error
- From: jifl at ecoscentric dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 9 Jul 2003 16:20:05 -0000
- Subject: tdep/1277: Accessing ARM FP registers cause gdb-internal-error
- Reply-to: jifl at ecoscentric dot com
>Number: 1277
>Category: tdep
>Synopsis: Accessing ARM FP registers cause gdb-internal-error
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jul 09 16:28:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Jonathan Larmour <jifl@ecoscentric.com>
>Release: GDB 5.3
>Organization:
>Environment:
ARM target, any host.
>Description:
If you load and run any arm program typing "p $f0" gives a gdb-internal-error, e.g.:
<blahblah>/gdb/findvar.c:334: gdb-internal-error:
Register \"f0\" (16) has conflicting raw (12) and virtual (8) size\n"
In arm-tdep.h these are indeed specified as 12 and 8. The raw==12 is because a future ARM FP unit could support IEEE extended doubles. But virtual==8 because that's all that's currently done.
It appears that the ARM target "just" needs something to define REGISTER_CONVERTIBLE and REGISTER_CONVERT_TO_VIRTUAL, but I don't know for sure if that's the correct approach. Perhaps findvar.c:value_of_register() should do the same as infcmd.c:default_print_registers_info() which does a:
if (REGISTER_CONVERTIBLE (i))
{
REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i),
raw_buffer, virtual_buffer);
}
else
{
memcpy (virtual_buffer, raw_buffer,
REGISTER_VIRTUAL_SIZE (i));
}
instead of the gdb-internal-error.
This hasn't cropped up in general because "info reg" doesn't display the FP regs, and virtually all ARM chips don't have hardware FP. However this has been shown up because GDB/MI clients can use -data-list-register-names command and may then decide to interrogate each register in turn.
>How-To-Repeat:
echo "int main() { return 0; }" > foo.c
arm-elf-gcc -g -o foo foo.c
arm-elf-gdb foo
tar sim
load
b main
run
p $f0
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: