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 python/11482] Side effect of set print address on python API


------- 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.


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