This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Extending GDB: Python: Wrong handling of 64-bit pointers


Hi all,

As the following CLI interactions show, GDB's python support code seems to be
mishandling 64-bit pointers (GNU/Linux on x86-64):

NOTE: "p" is a pointer of type "struct task_struct *"

(gdb) python print gdb.parse_and_eval("p")
0xffff88001f5f7600
(gdb) python print long(gdb.parse_and_eval("p"))
-131940868983296
(gdb) show version
show version
GNU gdb (GDB) 7.5
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.

Is it GDB or am I messing up something here?

--
Chandan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]