This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/11482] Side effect of set print address on python API
- From: "tromey at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 30 Jun 2010 17:37:54 -0000
- Subject: [Bug python/11482] Side effect of set print address on python API
- References: <20100409172931.11482.michel.metzger@st.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From tromey at redhat dot com 2010-06-30 17:37 -------
(In reply to comment #24)
> Regarding the hashable facade, could you give me a hint? I would have done that
> from the start but I don't see how I can write a hash function if I cannot
> access the underlying value from Python. E.g., get the value of a pointer as an
> integer in python. That's why I ended up using the string representation of the
> pointer.
Oops, sorry about this. I forgot to reply earlier :-(
If you know that you care only about pointers, you can get them as Python
values using 'long':
(gdb) p (void*)0
$1 = (void *) 0x0
(gdb) python x = gdb.history(1)
(gdb) python print x
0x0
(gdb) python print long(x)
0
I do think we need some way to convert a Value to its underlying bits,
either by letting Python treat Value as a buffer, or by having a method
to return a buffer.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Last reconfirmed|0000-00-00 00:00:00 |2010-06-30 17:37:54
date| |
http://sourceware.org/bugzilla/show_bug.cgi?id=11482
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.