summaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2011-02-14 11:27:34 +0000
committerPedro Alves <pedro@codesourcery.com>2011-02-14 11:27:34 +0000
commite275a10b1e3dc0a6048671ffd5f5e9a0d1d7fc67 (patch)
treea8b197ff36aebbced486dbae357a83e8f07ca217 /gdb/valops.c
parenta6e3210db7ee98f70ce97bf7fae59ee1ab011fb6 (diff)
downloadgdb-e275a10b1e3dc0a6048671ffd5f5e9a0d1d7fc67.tar.gz
<unavailable> references.
gdb/ * valops.c (get_value_at): Use value_from_contents_and_address, avoiding read_memory.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index 802242cf47e..ab31976041c 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -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;
}