This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3/3] Restrict value_has_address


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]