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: 19 May 2010 23:01:04 -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-05-19 23:01 -------
(In reply to comment #22)
> Thanks for the patch. Unfortunately I'm afraid it does work in my case.
> Maybe we could use the pointer value as a hash code for Value object
> representing pointers?
Many values have mutable contents. So we can't really hash on the contents.
We could hash on the address, but not all values have addresses, and,
bizarrely, I think you can have values with the same address but different
contents (if they were read from inferior memory at different times).
This is why we ended up going with identity hashing.
I realize this is not ideal. In many cases the above considerations do not
apply. However, it seems to me that in a specialized case you could pretty
easily write a hashable facade that has whatever hash and equality methods
you like.
--
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.