aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-type.c5
-rw-r--r--gdb/python/py-value.c6
2 files changed, 5 insertions, 6 deletions
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index c063d2c..f071006 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -460,8 +460,7 @@ typy_get_composite (struct type *type)
}
END_CATCH
- if (TYPE_CODE (type) != TYPE_CODE_PTR
- && TYPE_CODE (type) != TYPE_CODE_REF)
+ if (TYPE_CODE (type) != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type))
break;
type = TYPE_TARGET_TYPE (type);
}
@@ -921,7 +920,7 @@ typy_template_argument (PyObject *self, PyObject *args)
TRY
{
type = check_typedef (type);
- if (TYPE_CODE (type) == TYPE_CODE_REF)
+ if (TYPE_IS_REFERENCE (type))
type = check_typedef (TYPE_TARGET_TYPE (type));
}
CATCH (except, RETURN_MASK_ALL)
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index fc42197..bb42e8b 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -217,6 +217,7 @@ valpy_referenced_value (PyObject *self, PyObject *args)
res_val = value_ind (self_val);
break;
case TYPE_CODE_REF:
+ case TYPE_CODE_RVALUE_REF:
res_val = coerce_ref (self_val);
break;
default:
@@ -363,8 +364,7 @@ valpy_get_dynamic_type (PyObject *self, void *closure)
type = value_type (val);
type = check_typedef (type);
- if (((TYPE_CODE (type) == TYPE_CODE_PTR)
- || (TYPE_CODE (type) == TYPE_CODE_REF))
+ if (((TYPE_CODE (type) == TYPE_CODE_PTR) || TYPE_IS_REFERENCE (type))
&& (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT))
{
struct value *target;
@@ -1054,7 +1054,7 @@ enum valpy_opcode
/* If TYPE is a reference, return the target; otherwise return TYPE. */
#define STRIP_REFERENCE(TYPE) \
- ((TYPE_CODE (TYPE) == TYPE_CODE_REF) ? (TYPE_TARGET_TYPE (TYPE)) : (TYPE))
+ (TYPE_IS_REFERENCE (TYPE) ? (TYPE_TARGET_TYPE (TYPE)) : (TYPE))
/* Helper for valpy_binop. Returns a value object which is the result
of applying the operation specified by OPCODE to the given