ddae946278
This patch fixes PR python/17386. The bug is that gdb.Value does not implement the Python __index__ method. This method is needed to convert a Python object to an index and is used by various operations in Python, such as indexing an array. The fix is to implement the nb_index method for gdb.Value. nb_index was added in Python 2.5. I don't have a good way to test Python 2.4, but I made an attempt to accomodate it. I chose to use valpy_long in all cases because this simplifies porting to Python 3, and because there didn't seem to be any harm. Built and regtested on x86-64 Fedora 23. 2016-05-24 Tom Tromey <tom@tromey.com> PR python/17386: * python/py-value.c (value_object_as_number): Add nb_inplace_floor_divide, nb_inplace_true_divide, nb_index. 2016-05-24 Tom Tromey <tom@tromey.com> PR python/17386: * gdb.python/py-value.exp (test_value_numeric_ops): Add tests that use value as an index. |
||
---|---|---|
.. | ||
lib/gdb | ||
py-arch.c | ||
py-auto-load.c | ||
py-block.c | ||
py-bpevent.c | ||
py-breakpoint.c | ||
py-cmd.c | ||
py-continueevent.c | ||
py-event.c | ||
py-event.h | ||
py-events.h | ||
py-evtregistry.c | ||
py-evts.c | ||
py-exitedevent.c | ||
py-finishbreakpoint.c | ||
py-frame.c | ||
py-framefilter.c | ||
py-function.c | ||
py-gdb-readline.c | ||
py-inferior.c | ||
py-infevents.c | ||
py-infthread.c | ||
py-lazy-string.c | ||
py-linetable.c | ||
py-newobjfileevent.c | ||
py-objfile.c | ||
py-param.c | ||
py-prettyprint.c | ||
py-progspace.c | ||
py-signalevent.c | ||
py-stopevent.c | ||
py-stopevent.h | ||
py-symbol.c | ||
py-symtab.c | ||
py-threadevent.c | ||
py-type.c | ||
py-unwind.c | ||
py-utils.c | ||
py-value.c | ||
py-varobj.c | ||
py-xmethods.c | ||
python-config.py | ||
python-internal.h | ||
python.c | ||
python.h |