This patch adds asserts where the value's lval must be lval_register.
This triggers an error in frame_register_unwind because VALUE_REGNUM
is used but value's lval is not lval_register.
This also reveals a design issue in frame_register_unwind, that is
arguments addrp and realnump are mutually exclusive, we either use
addrp (for lval_memory), or use realnump (for lval_register). This
can be done in a separate patch.
gdb:
2016-12-06 Yao Qi <yao.qi@linaro.org>
* frame.c (frame_register_unwind): Set *realnump if *lvalp is
lval_register.
* value.c (deprecated_value_next_frame_id_hack): Assert
value->lval is lval_register.
(deprecated_value_regnum_hack): Likewise.
+2016-12-06 Yao Qi <yao.qi@linaro.org>
+
+ * frame.c (frame_register_unwind): Set *realnump if *lvalp is
+ lval_register.
+ * value.c (deprecated_value_next_frame_id_hack): Assert
+ value->lval is lval_register.
+ (deprecated_value_regnum_hack): Likewise.
+
2016-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* ui-out.h: Include "common/enum-flags.h".
*unavailablep = !value_entirely_available (value);
*lvalp = VALUE_LVAL (value);
*addrp = value_address (value);
- *realnump = VALUE_REGNUM (value);
+ if (*lvalp == lval_register)
+ *realnump = VALUE_REGNUM (value);
+ else
+ *realnump = -1;
if (bufferp)
{
struct frame_id *
deprecated_value_next_frame_id_hack (struct value *value)
{
+ gdb_assert (value->lval == lval_register);
return &value->location.reg.next_frame_id;
}
int *
deprecated_value_regnum_hack (struct value *value)
{
+ gdb_assert (value->lval == lval_register);
return &value->location.reg.regnum;
}