aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-value.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/py-value.c')
-rw-r--r--gdb/python/py-value.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 1ae26d7..dada8bf 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -1153,7 +1153,11 @@ valpy_getitem (PyObject *self, PyObject *key)
type. */
struct value *idx = convert_value_from_python (key);
- if (idx != NULL)
+ if (idx != NULL
+ && binop_user_defined_p (BINOP_SUBSCRIPT, tmp, idx))
+ res_val = value_x_binop (tmp, idx, BINOP_SUBSCRIPT,
+ OP_NULL, EVAL_NORMAL);
+ else if (idx != NULL)
{
/* Check the value's type is something that can be accessed via
a subscript. */