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

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <20170215030800.GM28432@vapier>
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
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAlijxg8ACgkQQWM7n+g3
9YHK5A//QLQ8VhAqF2pYsYzHZKoxsk22/mAQ41tDGA0zKbmN7mdOYyDwm9GCjrCn
ppegQ8EGapxMMXLVVS1c3gFvs7ZQO1v0yojNQ2GLINO8EGyp+vnr+zEQ8E31XI+a
Y79NBqfCbaY7jNjfm7cFngzTBRB5DkviDLlBRnEmIjtj9MFiyvNt3RfZrVCEb8Cr
mFtsTTkhGkW167m9LbNhiXemXaZUOoJKWSzjLDsoYA4aco2o710XrCOV24nVmjLm
Z/uvV/swBbaxKyL6Hxnpm97l649Xkc6f0jas3SfsbPQlfs84XQCV8/ygxdFRgw2H
8iLd5v9k/CaJ9vNJ7qntM3SOrRprUHa2In+5+ROSAqxiLNeFzRjgHKQM0FNRUEmt
G3DWQ5jD/qQNrFp4VCwVpzEOduWaMBD4bQZPVyY7wzh+ojbCrE3BAOqJ8EWYSIB/
FMRfEQ4on4inuzBPA8NypBpkGfi7tPonxnbfoX/o0CFTl3d1BojdCaOTIwgk81yA
gBvB6vP4KMilxHbvfq8xWM9JXrrF6gyO66fUdpst74upZJ+uMsqbc4kPBHh5x0mE
C5HwCkHMzgJd6aG31FgN1eB5cKWR6x3HylrmXfZeLjVEnsosEeVyXZSXatj0QG6U
RaU/lL6/B7JARrz6IdduaXb7ipGOVu3jbPubt0FSRw5IhZWIV/I=
=oiG9
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.