aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2016-11-28 17:09:26 +0000
committerYao Qi <yao.qi@linaro.org>2016-11-28 17:09:26 +0000
commit1a0884415891b197972f8acf59131c3c9376807f (patch)
treea21ab7f391d1ac92611c0142f2fc35dd01a281a3 /gdb/elfread.c
parent7dc54575d91a2b41f6c3e838eec44a7017a24436 (diff)
downloadgdb-1a0884415891b197972f8acf59131c3c9376807f.zip
gdb-1a0884415891b197972f8acf59131c3c9376807f.tar.gz
gdb-1a0884415891b197972f8acf59131c3c9376807f.tar.bz2
Restrict checking value.lval on using address
With the previous change, value.location.address is only valid for lval_memory. This patch restrict some checking on value.lval on using address. Since we have a check on VALUE_VAL in set_value_address, we need to set VALUE_VAL properly before set_value_address too. gdb: 2016-11-25 Yao Qi <yao.qi@linaro.org> * ada-lang.c (ensure_lval): Call set_value_address after setting VALUE_LVAL. * elfread.c (elf_gnu_ifunc_resolve_addr): Set VALUE_LVAL to lval_memory. (elf_gnu_ifunc_resolver_return_stop): Likewise. * value.c (value_fn_field): Likewise. (value_from_contents_and_address_unresolved): Likewise. (value_from_contents_and_address): Likewise. (value_address): Check value->lval isn't lval_memory. (value_raw_address): Likewise. (set_value_address): Assert value->lval is lval_memory.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index e49af6d..c6d0fdb 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -879,6 +879,7 @@ elf_gnu_ifunc_resolve_addr (struct gdbarch *gdbarch, CORE_ADDR pc)
name_at_pc = NULL;
function = allocate_value (func_func_type);
+ VALUE_LVAL (function) = lval_memory;
set_value_address (function, pc);
/* STT_GNU_IFUNC resolver functions usually receive the HWCAP vector as
@@ -992,6 +993,7 @@ elf_gnu_ifunc_resolver_return_stop (struct breakpoint *b)
gdb_assert (b->loc->next == NULL);
func_func = allocate_value (func_func_type);
+ VALUE_LVAL (func_func) = lval_memory;
set_value_address (func_func, b->loc->related_address);
value = allocate_value (value_type);