<unavailable> references.
authorPedro Alves <palves@redhat.com>
Mon, 14 Feb 2011 11:27:36 +0000 (11:27 +0000)
committerPedro Alves <palves@redhat.com>
Mon, 14 Feb 2011 11:27:36 +0000 (11:27 +0000)
gdb/
* valops.c (get_value_at): Use value_from_contents_and_address,
avoiding read_memory.

gdb/ChangeLog
gdb/valops.c

index 34ebe9b0aaa92a4c63f892c1731fe56db9a765e1..b77cdf22b040a5e05c6cd1a7846d3c2b4a7290f3 100644 (file)
@@ -1,3 +1,10 @@
+2011-02-14  Pedro Alves  <pedro@codesourcery.com>
+
+       <unavailable> references.
+
+       * valops.c (get_value_at): Use value_from_contents_and_address,
+       avoiding read_memory.
+
 2011-02-14  Pedro Alves  <pedro@codesourcery.com>
 
        * c-valprint.c (c_val_print): Print a string with unavailable
index 802242cf47e84ba3ab4455d7adc7b938e3ca321c..ab31976041c6e54660cfb290da1c0197e39c266f 100644 (file)
@@ -917,18 +917,10 @@ get_value_at (struct type *type, CORE_ADDR addr, int lazy)
   if (TYPE_CODE (check_typedef (type)) == TYPE_CODE_VOID)
     error (_("Attempt to dereference a generic pointer."));
 
-  if (lazy)
-    {
-      val = allocate_value_lazy (type);
-    }
-  else
-    {
-      val = allocate_value (type);
-      read_memory (addr, value_contents_all_raw (val), TYPE_LENGTH (type));
-    }
+  val = value_from_contents_and_address (type, NULL, addr);
 
-  VALUE_LVAL (val) = lval_memory;
-  set_value_address (val, addr);
+  if (!lazy)
+    value_fetch_lazy (val);
 
   return val;
 }