diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2022-01-27 22:16:41 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2022-02-06 16:03:47 -0500 |
commit | 5f9c5a63ce38b103f778f54394c6a3d43b7ade90 (patch) | |
tree | c356fc03c61b9e9234aa8e187fb6c2303b8e5d2c /gdb/dwarf2 | |
parent | f5abd8f234426bbe8ccd08c43e6ae7cbe635e042 (diff) | |
download | gdb-5f9c5a63ce38b103f778f54394c6a3d43b7ade90.zip gdb-5f9c5a63ce38b103f778f54394c6a3d43b7ade90.tar.gz gdb-5f9c5a63ce38b103f778f54394c6a3d43b7ade90.tar.bz2 |
gdb: remove SYMBOL_TYPE macro
Add a getter and a setter for a symbol's type. Remove the corresponding
macro and adjust all callers.
Change-Id: Ie1a137744c5bfe1df4d4f9ae5541c5299577c8de
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/loc.c | 18 | ||||
-rw-r--r-- | gdb/dwarf2/read.c | 18 |
2 files changed, 18 insertions, 18 deletions
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index bf3cadb..badc7f8 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -744,7 +744,7 @@ func_addr_to_tail_call_list (struct gdbarch *gdbarch, CORE_ADDR addr) "name for address %s"), paddress (gdbarch, addr)); - type = SYMBOL_TYPE (sym); + type = sym->type (); gdb_assert (type->code () == TYPE_CODE_FUNC); gdb_assert (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_FUNC); @@ -783,7 +783,7 @@ func_verify_no_selftailcall (struct gdbarch *gdbarch, CORE_ADDR verify_addr) func_sym = func_addr_to_tail_call_list (gdbarch, addr); - for (call_site = TYPE_TAIL_CALL_LIST (SYMBOL_TYPE (func_sym)); + for (call_site = TYPE_TAIL_CALL_LIST (func_sym->type ()); call_site; call_site = call_site->tail_call_next) { CORE_ADDR target_addr; @@ -985,7 +985,7 @@ call_site_find_chain_1 (struct gdbarch *gdbarch, CORE_ADDR caller_pc, struct symbol *target_func; target_func = func_addr_to_tail_call_list (gdbarch, target_func_addr); - target_call_site = TYPE_TAIL_CALL_LIST (SYMBOL_TYPE (target_func)); + target_call_site = TYPE_TAIL_CALL_LIST (target_func->type ()); } do @@ -3019,7 +3019,7 @@ locexpr_read_variable (struct symbol *symbol, struct frame_info *frame) = (struct dwarf2_locexpr_baton *) SYMBOL_LOCATION_BATON (symbol); struct value *val; - val = dwarf2_evaluate_loc_desc (SYMBOL_TYPE (symbol), frame, dlbaton->data, + val = dwarf2_evaluate_loc_desc (symbol->type (), frame, dlbaton->data, dlbaton->size, dlbaton->per_cu, dlbaton->per_objfile); @@ -3036,7 +3036,7 @@ locexpr_read_variable_at_entry (struct symbol *symbol, struct frame_info *frame) struct dwarf2_locexpr_baton *dlbaton = (struct dwarf2_locexpr_baton *) SYMBOL_LOCATION_BATON (symbol); - return value_of_dwarf_block_entry (SYMBOL_TYPE (symbol), frame, dlbaton->data, + return value_of_dwarf_block_entry (symbol->type (), frame, dlbaton->data, dlbaton->size); } @@ -3856,7 +3856,7 @@ loclist_read_variable (struct symbol *symbol, struct frame_info *frame) CORE_ADDR pc = frame ? get_frame_address_in_block (frame) : 0; data = dwarf2_find_location_expression (dlbaton, &size, pc); - val = dwarf2_evaluate_loc_desc (SYMBOL_TYPE (symbol), frame, data, size, + val = dwarf2_evaluate_loc_desc (symbol->type (), frame, data, size, dlbaton->per_cu, dlbaton->per_objfile); return val; @@ -3880,13 +3880,13 @@ loclist_read_variable_at_entry (struct symbol *symbol, struct frame_info *frame) CORE_ADDR pc; if (frame == NULL || !get_frame_func_if_available (frame, &pc)) - return allocate_optimized_out_value (SYMBOL_TYPE (symbol)); + return allocate_optimized_out_value (symbol->type ()); data = dwarf2_find_location_expression (dlbaton, &size, pc); if (data == NULL) - return allocate_optimized_out_value (SYMBOL_TYPE (symbol)); + return allocate_optimized_out_value (symbol->type ()); - return value_of_dwarf_block_entry (SYMBOL_TYPE (symbol), frame, data, size); + return value_of_dwarf_block_entry (symbol->type (), frame, data, size); } /* Implementation of get_symbol_read_needs from diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 95d4d6f..3a22bcd 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -8918,7 +8918,7 @@ fixup_go_packaging (struct dwarf2_cu *cu) e.g., "main" finds the "main" module and not C's main(). */ sym->set_domain (STRUCT_DOMAIN); sym->set_aclass_index (LOC_TYPEDEF); - SYMBOL_TYPE (sym) = type; + sym->set_type (type); add_symbol_to_list (sym, cu->get_builder ()->get_global_symbols ()); } @@ -21720,9 +21720,9 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, sym->set_domain (VAR_DOMAIN); sym->set_aclass_index (LOC_OPTIMIZED_OUT); if (type != NULL) - SYMBOL_TYPE (sym) = type; + sym->set_type (type); else - SYMBOL_TYPE (sym) = die_type (die, cu); + sym->set_type (die_type (die, cu)); attr = dwarf2_attr (die, inlined_func ? DW_AT_call_line : DW_AT_decl_line, cu); @@ -21764,7 +21764,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, } else sym->set_aclass_index (LOC_OPTIMIZED_OUT); - SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_core_addr; + sym->set_type (objfile_type (objfile)->builtin_core_addr); sym->set_domain (LABEL_DOMAIN); add_symbol_to_list (sym, cu->list_in_scope); break; @@ -21806,8 +21806,8 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* Compilation with minimal debug info may result in variables with missing type entries. Change the misleading `void' type to something sensible. */ - if (SYMBOL_TYPE (sym)->code () == TYPE_CODE_VOID) - SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_int; + if (sym->type ()->code () == TYPE_CODE_VOID) + sym->set_type (objfile_type (objfile)->builtin_int); attr = dwarf2_attr (die, DW_AT_const_value, cu); /* In the case of DW_TAG_member, we should only be called for @@ -21994,8 +21994,8 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* The symbol's name is already allocated along with this objfile, so we don't need to duplicate it for the type. */ - if (SYMBOL_TYPE (sym)->name () == 0) - SYMBOL_TYPE (sym)->set_name (sym->search_name ()); + if (sym->type ()->name () == 0) + sym->type ()->set_name (sym->search_name ()); } } } @@ -22230,7 +22230,7 @@ dwarf2_const_value (const struct attribute *attr, struct symbol *sym, const gdb_byte *bytes; struct dwarf2_locexpr_baton *baton; - dwarf2_const_value_attr (attr, SYMBOL_TYPE (sym), + dwarf2_const_value_attr (attr, sym->type (), sym->print_name (), &objfile->objfile_obstack, cu, &value, &bytes, &baton); |