This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] mips 32/64 register/stack fix
Andrew Cagney wrote:
#0 register_size (gdbarch=0x84093e8, regnum=120)
120 looks large enough to be cooked (but to confirm this can you look at "maint print raw-registers". This will also tell us the register's type, and hence confirm the size.
Yes, raw is from 0 to 89, and cooked is from 90 to 179.
regcache->descr->sizeof_register is as follows:
8 for all raw
8 for the first 70 cooked
4 for the last 20 cooked
register_type looks like:
raw:
38 @ int64
32 @ double64
20 @ int64
cooked:
38 @ int64
32 @ double64
20 @ int32
good.
Given that you see 8, this suggests that the register's type is wrong (see mips_register_type).
It looks to me as if mips_register_type relies on mips_regsize.
Which returns 8. Yep, and mips_register_type (120) returns int64_t.
But mips_saved_regsize (tdep) returns 4 (as it should, I guess).
Also, what information is available in the object file header?
Can you be more specific?
[...]
Here's your tdep info:
{elf_flags = 1610625025, mips_abi = MIPS_ABI_EABI32,
I was looking to see if anything like that was present -> it is clearly
identified as a 32-bit ABI binary.
I think the bug is in mips_register_type, the tail end should probably
be changed to read something like:
else if (regnum >= NUM_REGS
&& gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p)
/* The target, while using a 64-bit raw register buffer, is only
transfering 32-bits of each integer register. Reflect this in
the cooked/pseudo register value. */
return builtin_type_int32;
else if (regnum > NUM_REGS
&& mips_saved_regsize (gdbarch) == 4)
/* A 32-bit ABI such as o32 possibly running on a 64-bit ISA. */
return builtin_type_int32;
else if (mips_regsize (gdbarch) == 8)
/* 64-bit ISA. */
return builtin_type_int64;
else
/* 32-bit ISA. */
return builtin_type_int32;
Andrew