Assert on lval_register
authorYao Qi <yao.qi@linaro.org>
Tue, 6 Dec 2016 14:25:51 +0000 (14:25 +0000)
committerYao Qi <yao.qi@linaro.org>
Tue, 6 Dec 2016 14:25:51 +0000 (14:25 +0000)
commit7c2ba67e6ab10879968c938aefd4d0d0b4ce79bc
treef654ea7bb52fc5b536c17d212c6065ba2704932c
parent5e359a63b7a39e0ff0f750ca8fc97d27b14c0ef7
Assert on lval_register

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.
gdb/ChangeLog
gdb/frame.c
gdb/value.c