From: Pedro Alves Date: Mon, 14 Feb 2011 11:27:36 +0000 (+0000) Subject: references. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a3d34bf49acc2aa68810ac66fb1047e99a8bdd26;p=binutils-gdb.git references. gdb/ * valops.c (get_value_at): Use value_from_contents_and_address, avoiding read_memory. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 34ebe9b0aaa..b77cdf22b04 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2011-02-14 Pedro Alves + + references. + + * valops.c (get_value_at): Use value_from_contents_and_address, + avoiding read_memory. + 2011-02-14 Pedro Alves * c-valprint.c (c_val_print): Print a string with unavailable 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; }