This is the mail archive of the gdb-prs@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]

[Bug gdb/10583] New: Retrieve long long ints from Python


Hello,

Currently, long long ints can't be easily accessed from python:

GNU gdb (GDB) 6.8.50.20090825
...
(gdb) p (unsigned long long)0x0706050403020100
$1 = 506097522914230528
(gdb) python print hex(long(gdb.history(1)))
0x3020100L

A small patch (which I will try to attach in a minute) fixes that.
PyLong_FromLong should be replaced by PyLong_FromLongLong. After the patch, you
get this:

GNU gdb (GDB) 6.8.50.20090831-cvs
...
(gdb) p (unsigned long long)0x0706050403020100
$1 = 506097522914230528
(gdb) python print hex(long(gdb.history(1)))
0x706050403020100L

This is in a fresh cvs checkout (actually git). I'm sorry, I wasn't sure what to
fill in "version" (is it "archer"?) and "build triplet".

Thanks,
Noam

-- 
           Summary: Retrieve long long ints from Python
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: noamraph at gmail dot com
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=10583

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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