Hi,
In i386_retal.c we have:
/* %eax, or pair %eax, %edx. */
static const Dwarf_Op loc_intreg[] =
{
{ .atom = DW_OP_reg0 }, { .atom = DW_OP_piece, .number = 4 },
{ .atom = DW_OP_reg1 }, { .atom = DW_OP_piece, .number = 4 },
};
In i386_regs.c we have:
switch (regno)
{
static const char baseregs[][2] =
{
"ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "ip"
};
It seems to comment doesn't match the code. As far as I can see
the order of the registers in i386_regs.c is correct, and
different then x86_64. Looking at the gdb source, edx is used
for the return value. So I believe the attached patch should fix
things. It still passes the regression tests after the change.
The issue was pointed out by Thorsten Glaser <tg(a)mirbsd.de>
Kurt