Frame.pc () python function returns a 64-bit value on with a 32-bit mips target

Mike Frysinger vapier@gentoo.org
Wed Feb 15 03:08:00 GMT 2017


On 10 Feb 2017 09:32, Cedric Jehasse wrote:
> i have built gdb from git configured with ./configure --target=mipsisa32-elf.
> I use gdb to connect to openocd which is connected using JTAG to a
> 32-bit little endian mips.
> 
> When i to use the python api to print the pc, it prints a 64-bit
> address with the upper 32-bits set to 0xffffffff. Eg.
> (gdb) python print hex(gdb.newest_frame().pc())
> 0xffffffff803453fcL
> 
> The addresses printed in gdb's cli are all 32-bit.
> 
> Is there something wrong in my configuration?

supposedly on mips, the ABI says addresses are sign extended.  since the
high bit is set (0x8000 0000), it gets extended into 0xffff ffff 8000 0000.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/gdb/attachments/20170215/927b607f/attachment.sig>


More information about the Gdb mailing list