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

Re: [RFC - Python Scripting] Extend Value.dereference to dereference C++ reference values


>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:

Siva> Unless I am missing something, I couldn't find anything which can do
Siva> this in the Python API. Attached is a patch which extends the Python
Siva> API method Value.dereference to 'dereference' C++ reference values as
Siva> well. I am probably overloading the term 'dereference' as used in the
Siva> normal (pointer dereferencing) sense.

Tom> I think that is fine.
[...]
Tom> The code bits are ok with those changes.

Oops, sorry, I am mistaken about this.

Right now, value_ind calls coerce_array, which calls coerce_ref.
So, if you have a reference to a pointer, Value.dereference will end up
dereferencing the pointer.
So, if your patch went in, it would be an incompatible change.

I think you will have to have a new method for this instead.

Tom


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