aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-02-14 11:27:36 +0000
committerPedro Alves <palves@redhat.com>2011-02-14 11:27:36 +0000
commita3d34bf49acc2aa68810ac66fb1047e99a8bdd26 (patch)
treedc0e07dc725e1941f0038c157cdbabbaa16e0751 /gdb/valops.c
parent9fc6d940ae73525e1e3ef9332452926d18732b14 (diff)
downloadgdb-a3d34bf49acc2aa68810ac66fb1047e99a8bdd26.zip
gdb-a3d34bf49acc2aa68810ac66fb1047e99a8bdd26.tar.gz
gdb-a3d34bf49acc2aa68810ac66fb1047e99a8bdd26.tar.bz2
<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 802242c..ab31976 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;
}