This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 3/3] Restrict value_has_address
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 22 Nov 2016 15:48:41 +0000
- Subject: [PATCH 3/3] Restrict value_has_address
- Authentication-results: sourceware.org; auth=none
- References: <1479829721-22162-1-git-send-email-yao.qi@linaro.org>
gdb:
2016-11-21 Yao Qi <yao.qi@linaro.org>
* value.c (value_has_address): Return true if lval is
either lval_memory or lval_register.
---
gdb/value.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gdb/value.c b/gdb/value.c
index a093a9a..5ac9123 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1540,14 +1540,14 @@ value_lval_const (const struct value *value)
return value->lval;
}
-/* Return true if VALUE has address, otherwise return false. */
+/* Return true if VALUE->location.address is valid, otherwise return
+ false. */
static int
value_has_address (const struct value *value)
{
- return (value->lval != lval_internalvar
- && value->lval != lval_internalvar_component
- && value->lval != lval_xcallable);
+ return (value->lval == lval_memory
+ || value->lval == lval_register);
}
CORE_ADDR
--
1.9.1