aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/loc.h
diff options
context:
space:
mode:
authorZoran Zaric <zoran.zaric@amd.com>2020-09-14 17:02:29 +0100
committerZoran Zaric <zoran.zaric@amd.com>2021-08-05 16:39:36 +0100
commita580d9604bb71c19741465f2e3a46c5a07672be0 (patch)
tree90f1099bf62a413710f2e0f464fe96ece9da0666 /gdb/dwarf2/loc.h
parent6c7779b34b38ca71df9460c07bc4c03d01dfaa0b (diff)
downloadfsf-binutils-gdb-a580d9604bb71c19741465f2e3a46c5a07672be0.zip
fsf-binutils-gdb-a580d9604bb71c19741465f2e3a46c5a07672be0.tar.gz
fsf-binutils-gdb-a580d9604bb71c19741465f2e3a46c5a07672be0.tar.bz2
Move compilation unit info to dwarf_expr_context
This patch moves the compilation unit context information and support from dwarf_expr_executor and dwarf_evaluate_loc_desc to dwarf_expr_context evaluator. The idea is to report an error when a given operation requires a compilation unit information to be resolved, which is not available. With this change, it also makes sense to always acquire ref_addr_size information from the compilation unit context, considering that all DWARF operations that refer to that information require a compilation unit context to be present during their evaluation. gdb/ChangeLog: * dwarf2/expr.c (ensure_have_per_cu): New function. (dwarf_expr_context::dwarf_expr_context): Add compilation unit context information. (dwarf_expr_context::get_base_type): Move from dwarf_evaluate_loc_desc. (dwarf_expr_context::get_addr_index): Remove method. (dwarf_expr_context::dwarf_variable_value): Remove method. (dwarf_expr_context::execute_stack_op): Call compilation unit context info check. Inline get_addr_index and dwarf_variable_value methods. * dwarf2/expr.h (struct dwarf_expr_context): Add compilation context info. (dwarf_expr_context::get_addr_index): Remove method. (dwarf_expr_context::dwarf_variable_value): Remove method. (dwarf_expr_context::ref_addr_size): Remove member. * dwarf2/frame.c (dwarf_expr_executor::get_addr_index): Remove method. (dwarf_expr_executor::dwarf_variable_value): Remove method. * dwarf2/loc.c (sect_variable_value): Expose function. (dwarf_evaluate_loc_desc::get_addr_index): Remove method. (dwarf_evaluate_loc_desc::dwarf_variable_value): Remove method. (class dwarf_evaluate_loc_desc): Move compilation unit context information to dwarf_expr_context class. * dwarf2/loc.h (sect_variable_value): Expose function.
Diffstat (limited to 'gdb/dwarf2/loc.h')
-rw-r--r--gdb/dwarf2/loc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/dwarf2/loc.h b/gdb/dwarf2/loc.h
index ff05a7e..9929a4a 100644
--- a/gdb/dwarf2/loc.h
+++ b/gdb/dwarf2/loc.h
@@ -53,6 +53,14 @@ extern void func_get_frame_base_dwarf_block (struct symbol *framefunc,
const gdb_byte **start,
size_t *length);
+/* Given section offset SECT_OFF, and compilation unit data
+ PER_CU, execute the "variable value" operation on the DIE
+ found at SECT_OFF. */
+
+struct value *sect_variable_value (sect_offset sect_off,
+ dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile);
+
/* Evaluate a location description, starting at DATA and with length
SIZE, to find the current location of variable of TYPE in the context
of FRAME. */