binutils-gdb/gdb/dwarf2loc.h

110 lines
3.7 KiB
C
Raw Normal View History

* dwarf2expr.h: Tweak comment. (struct dwarf_expr_context): Use `gdb_byte *' in read_mem and get_frame_base function pointers. (read_uleb128, read_sleb128): Change return type and types of first two arguments to `gdb_byte *'. (dwarf2_read_address): Change types of first two arguments to `gdb_byte *'. * dwarf2expr.c: Tweak comment. (dwarf_expr_eval): Change type of second argument to `gdb_byte *'. (read_uleb128, read_sleb128): Change return type and types of first two arguments to `gdb_byte *'. (dwarf2_read_address): Change types of first two arguments to `gdb_byte *'. (execute_stack_op): Change types of last two arguments to `gdb_byte *'. Use `gdb_byte *' for byte buffers. * dwarf2loc.h: Tweak comment. (struct dwarf2_locexpr_baton, struct dwarf2_loclist_baton): Use `gdb_byte *' for byte buffers. * dwarf2loc.c (find_location_expression): Change return type to `gdb_byte *'. Use `gdb_byte *' for byte buffers. Change length to `unsigned int'. (dwarf_expr_read_reg): Use `gdb_byte *' for byte buffer. Remove bogus cast. (dwarf_expr_read_mem): Change type of second argument to `gdb_byte *'. (dwarf_expr_frame_base): Change type of second argument to `gdb_byte **'. (dwarf2_evaluate_loc_desc): Change type of third argument to `gdb_byte *'. (needs_frame_read_mem): Change type of second argument to `gdb_byte *'. (needs_frame_frame_base): Change type of second argument `gdb_byte **'. Use gdb_byte for lit0. (dwarf2_tracepoint_var_ref): Change type of fourth argument to `gdb_byte *'. Use `gdb_byte *' for byte buffer. (loclist_read_variable, loclist_tracepoint_var_ref): Use `gdb_byte *' for byte buffer. * dwarf2-frame.c (struct dwarf2_cie, struct dwarf2_fde) (struct dwarf2_frame_state): Use gdb_byte instead of `unsigned char'. (read_reg): Use `gdb_byte *' for byte buffers. Remove redundant cast. (read_mem): Change second argument to `gdb_byte *'. (no_get_frame_base): Change second argument to `gdb_byte **'. (execute_stack_op): Change first argument to `gdb_byte *'. (execute_cfa_program): Change first two arguments to `gdb_byte *'. Use gdb_byte instead of `unsigned int'. Use temprorary variable to store result of read_uleb128. (struct comp_unit): Use `gdb_byte *' for byte buffers. (read_1_byte, read_4_bytes, read_8_bytes): Change last argument to `gdb_byte *'. (read_unsigned_leb128, read_signed_leb128): Change second argument to `gdb_byte *'. Use gdb_byte instead of `unsigned char'. (read_initial_length): Change second argument to `gdb_byte *'. Remove redundant casts. (read_encoded_value): Use gdb_byte instead of `unsigned char'. Remove bogus casts. (decode_frame_entry_1): Change return type and second argument to `gdb_byte *'. Use `gdb_byte *' for byte buffers. Use gdb_byte instead of `unsigned char'. (decode_frame_entry): Change return type and second argument to `gdb_byte *'. Use `gdb_byte *' for byte buffers. (dwarf2_build_frame_info): Use `gdb_byte *' for byte buffers.
2005-07-12 15:06:54 +02:00
/* DWARF 2 location expression support for GDB.
2011-01-01 16:34:07 +01:00
Copyright (C) 2003, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#if !defined (DWARF2LOC_H)
#define DWARF2LOC_H
* symtab.h: Rename SYMBOL_OPS to SYMBOL_COMPUTED_OPS. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value, symbol_read_needs_frame): Likewise. * printcmd.c (address_info): Likewise. * dwarf2loc.c (dwarf_expr_frame_base): Likewise. * dwarf2read.c (dwarf2_symbol_mark_computed): Likewise. * symtab.h: Rename struct symbol_ops to struct symbol_computed_ops. * dwarf2loc.h: Likewise. * dwarf2loc.c (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Likewise. * symtab.h: (struct symbol_register_ops): New struct definition. (struct symbol): Make "ops" member a union of symbol_computed_ops and symbol_register_ops callback pointers. (SYMBOL_REGISTER_OPS): New macro. * tracepoint.c: Include "objfiles.h". (scope_info, collect_symbol): Use SYMBOL_REGISTER_OPS register_number callback to retrieve register numbers. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value): Likewise. * printcmd.c (address_info): Likewise. * coffread.c (coff_reg_to_regnum): New function. (coff_register_funcs): New static variable. (process_coff_symbol): Do not call gdbarch_sdb_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * mdebugread.c (mdebug_reg_to_regnum): New function. (mdebug_register_funcs): New static variable. (parse_symbol): Do not call gdbarch_ecoff_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * stabsread.c (stab_reg_to_regnum): New function. (stab_register_funcs): New static variable. (define_symbol): Do not call gdbarch_stab_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks.
2009-06-04 14:28:39 +02:00
struct symbol_computed_ops;
2008-03-18 Ulrich Weigand <uweigand@de.ibm.com> Jim Blandy <jimb@codesourcery.com> Daniel Jacobowitz <drow@false.org> * dwarf2expr.h (struct dwarf_expr_context): Add ADDR_SIZE member. (dwarf2_read_address): Update prototype. * dwarf2expr.c (unsigned_address_type): Add ADDR_SIZE parameter. (signed_address_type): Likewise. (dwarf2_read_address): Replace BYTES_READ parameter with ADDR_SIZE. (execute_stack_op): Update calls to unsigned_address_type, signed_address_type and dwarf2_read_address. Fix implementation of DW_OP_deref_size. * dwarf2loc.h (dwarf2_per_cu_objfile): Add prototype. (dwarf2_per_cu_addr_size): Likewise. (struct dwarf2_locexpr_baton): Replace OBJFILE with PER_CU. (struct dwarf2_loclist_baton): Likewise. * dwarf2loc.c (find_location_expression): Update calls to dwarf2_read_address. Use dwarf2_per_cu_objfile and dwarf2_per_cu_addr_size to retrieve PER_CU parameters. (locexpr_describe_location): Likewise. (dwarf2_evaluate_loc_desc): Replace OBJFILE with PER_CU parameter. Set ctx->addr_size to dwarf2_per_cu_addr_size (per_cu). (dwarf2_loc_desc_needs_frame): Add PER_CU parameter. Set ctx->addr_size to dwarf2_per_cu_addr_size (per_cu). (locexpr_read_variable): Update dwarf2_evaluate_loc_desc call. (loclist_read_variable): Likewise. (locexpr_read_needs_frame): Update dwarf2_loc_desc_needs_frame call. * dwarf2read.c (dwarf2_symbol_mark_computed): Set baton->per_cu instead of baton->objfile. (dwarf2_per_cu_obfile): New function. (dwarf2_per_cu_addr_size): Likewise. * dwarf2-frame.c (struct comp_unit): Move higher. (struct dwarf2_cie): Add UNIT and ADDR_SIZE members. (execute_stack_op): Add ADDR_SIZE parameter; set ctx->addr_size. (execute_cfa_program): Add FDE parameter. Replace EH_FRAME_P parameter by using fde->eh_frame_p. Use read_encoded_value to implement DW_CFA_set_loc. (struct dwarf2_frame_cache): Add ADDR_SIZE member. (dwarf2_frame_cache): Set cache->addr_size. Update calls to execute_stack_op and execute_cfa_program. (dwarf2_frame_prev_register): Update calls to execute_stack_op. (size_of_encoded_value): Remove. (read_encoded_value): Add PTR_LEN and FUNC_BASE parameters. Remove call to size_of_encoded_value. Implement DW_EH_PE_funcrel. (add_cie): Set cie->unit backlink. (decode_frame_entry_1): Set cie->addr_size. Update calls to read_encoded_value. (dwarf2_build_frame_info): Allocate UNIT on objfile obstack.
2008-03-18 20:40:47 +01:00
struct objfile;
struct dwarf2_per_cu_data;
gdb * opencl-lang.c (lval_func_check_synthetic_pointer): New function. * value.h (struct lval_funcs) <indirect, check_synthetic_pointer>: New fields. (value_bits_synthetic_pointer): Declare. * value.c (value_bits_synthetic_pointer): New function. * valprint.c (valprint_check_validity): Handle synthetic pointers. * valops.c (value_ind): Use new 'indirect' lval_funcs method. * valarith.c (value_ptradd): Use set_value_component_location. * p-valprint.c (pascal_object_print_value_fields): Handle synthetic pointers. * jv-valprint.c (java_print_value_fields): Handle synthetic pointers. * dwarf2read.c (dwarf_stack_op_name): Add DW_OP_GNU_implicit_pointer. (dwarf2_fetch_die_location_block): Add get_frame_pc, baton arguments. Handle location lists. (fill_in_loclist_baton): New function. (dwarf2_symbol_mark_computed): Use it. * dwarf2loc.h (dwarf2_find_location_expression): Declare. (dwarf2_fetch_die_location_block): Add get_frame_pc, baton arguments. * dwarf2loc.c (dwarf2_find_location_expression): Rename from find_location_expression. No longer static. Update all callers. (dwarf_expr_frame_pc): New function. (per_cu_dwarf_call): Add get_frame_pc, baton arguments. Update all callers. (struct piece_closure) <per_cu>: New field. (allocate_piece_closure): Add per_cu argument. (read_pieced_value): Handle DWARF_VALUE_IMPLICIT_POINTER. (check_pieced_value_bits): Remove validity argument, add check_for argument. Handle DWARF_VALUE_IMPLICIT_POINTER. (check_pieced_value_validity, check_pieced_value_invalid): Update. (check_pieced_synthetic_pointer): New function. (get_frame_address_in_block_wrapper): New function. (indirect_pieced_value): New function. (pieced_value_funcs): Update. (invalid_synthetic_pointer): New function. (dwarf2_evaluate_loc_desc_full): Rename from dwarf2_evaluate_loc_desc. Add byte_offset argument. (dwarf2_evaluate_loc_desc): Rewrite. (dwarf2_loc_desc_needs_frame): Set new field on context. (get_ax_pc): New function. (disassemble_dwarf_expression): Handle DW_OP_GNU_implicit_pointer. * dwarf2expr.h (enum dwarf_value_location) <DWARF_VALUE_IMPLICIT_POINTER>: New constant. (struct dwarf_expr_context) <get_frame_pc>: New field. (struct dwarf_expr_piece) <v.ptr>: New field. * dwarf2expr.c (add_piece): Handle DWARF_VALUE_IMPLICIT_POINTER. (execute_stack_op): Handle DW_OP_GNU_implicit_pointer. * dwarf2-frame.c (no_get_frame_pc): New function. (execute_stack_op): Set new field on context. * cp-valprint.c (cp_print_value_fields): Handle synthetic pointers. gdb/testsuite * gdb.dwarf2/implptr.exp: New file. * gdb.dwarf2/implptr.c: New file. * gdb.dwarf2/implptr.S: New file.
2010-11-29 22:18:16 +01:00
struct dwarf2_loclist_baton;
/* This header is private to the DWARF-2 reader. It is shared between
dwarf2read.c and dwarf2loc.c. */
/* Return the OBJFILE associated with the compilation unit CU. If CU
came from a separate debuginfo file, then the master objfile is
returned. */
2008-03-18 Ulrich Weigand <uweigand@de.ibm.com> Jim Blandy <jimb@codesourcery.com> Daniel Jacobowitz <drow@false.org> * dwarf2expr.h (struct dwarf_expr_context): Add ADDR_SIZE member. (dwarf2_read_address): Update prototype. * dwarf2expr.c (unsigned_address_type): Add ADDR_SIZE parameter. (signed_address_type): Likewise. (dwarf2_read_address): Replace BYTES_READ parameter with ADDR_SIZE. (execute_stack_op): Update calls to unsigned_address_type, signed_address_type and dwarf2_read_address. Fix implementation of DW_OP_deref_size. * dwarf2loc.h (dwarf2_per_cu_objfile): Add prototype. (dwarf2_per_cu_addr_size): Likewise. (struct dwarf2_locexpr_baton): Replace OBJFILE with PER_CU. (struct dwarf2_loclist_baton): Likewise. * dwarf2loc.c (find_location_expression): Update calls to dwarf2_read_address. Use dwarf2_per_cu_objfile and dwarf2_per_cu_addr_size to retrieve PER_CU parameters. (locexpr_describe_location): Likewise. (dwarf2_evaluate_loc_desc): Replace OBJFILE with PER_CU parameter. Set ctx->addr_size to dwarf2_per_cu_addr_size (per_cu). (dwarf2_loc_desc_needs_frame): Add PER_CU parameter. Set ctx->addr_size to dwarf2_per_cu_addr_size (per_cu). (locexpr_read_variable): Update dwarf2_evaluate_loc_desc call. (loclist_read_variable): Likewise. (locexpr_read_needs_frame): Update dwarf2_loc_desc_needs_frame call. * dwarf2read.c (dwarf2_symbol_mark_computed): Set baton->per_cu instead of baton->objfile. (dwarf2_per_cu_obfile): New function. (dwarf2_per_cu_addr_size): Likewise. * dwarf2-frame.c (struct comp_unit): Move higher. (struct dwarf2_cie): Add UNIT and ADDR_SIZE members. (execute_stack_op): Add ADDR_SIZE parameter; set ctx->addr_size. (execute_cfa_program): Add FDE parameter. Replace EH_FRAME_P parameter by using fde->eh_frame_p. Use read_encoded_value to implement DW_CFA_set_loc. (struct dwarf2_frame_cache): Add ADDR_SIZE member. (dwarf2_frame_cache): Set cache->addr_size. Update calls to execute_stack_op and execute_cfa_program. (dwarf2_frame_prev_register): Update calls to execute_stack_op. (size_of_encoded_value): Remove. (read_encoded_value): Add PTR_LEN and FUNC_BASE parameters. Remove call to size_of_encoded_value. Implement DW_EH_PE_funcrel. (add_cie): Set cie->unit backlink. (decode_frame_entry_1): Set cie->addr_size. Update calls to read_encoded_value. (dwarf2_build_frame_info): Allocate UNIT on objfile obstack.
2008-03-18 20:40:47 +01:00
struct objfile *dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *cu);
/* Return the address size given in the compilation unit header for CU. */
CORE_ADDR dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *cu);
/* Return the offset size given in the compilation unit header for CU. */
int dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *cu);
/* Return the text offset of the CU. The returned offset comes from
this CU's objfile. If this objfile came from a separate debuginfo
file, then the offset may be different from the corresponding
offset in the parent objfile. */
CORE_ADDR dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *cu);
gdb * opencl-lang.c (lval_func_check_synthetic_pointer): New function. * value.h (struct lval_funcs) <indirect, check_synthetic_pointer>: New fields. (value_bits_synthetic_pointer): Declare. * value.c (value_bits_synthetic_pointer): New function. * valprint.c (valprint_check_validity): Handle synthetic pointers. * valops.c (value_ind): Use new 'indirect' lval_funcs method. * valarith.c (value_ptradd): Use set_value_component_location. * p-valprint.c (pascal_object_print_value_fields): Handle synthetic pointers. * jv-valprint.c (java_print_value_fields): Handle synthetic pointers. * dwarf2read.c (dwarf_stack_op_name): Add DW_OP_GNU_implicit_pointer. (dwarf2_fetch_die_location_block): Add get_frame_pc, baton arguments. Handle location lists. (fill_in_loclist_baton): New function. (dwarf2_symbol_mark_computed): Use it. * dwarf2loc.h (dwarf2_find_location_expression): Declare. (dwarf2_fetch_die_location_block): Add get_frame_pc, baton arguments. * dwarf2loc.c (dwarf2_find_location_expression): Rename from find_location_expression. No longer static. Update all callers. (dwarf_expr_frame_pc): New function. (per_cu_dwarf_call): Add get_frame_pc, baton arguments. Update all callers. (struct piece_closure) <per_cu>: New field. (allocate_piece_closure): Add per_cu argument. (read_pieced_value): Handle DWARF_VALUE_IMPLICIT_POINTER. (check_pieced_value_bits): Remove validity argument, add check_for argument. Handle DWARF_VALUE_IMPLICIT_POINTER. (check_pieced_value_validity, check_pieced_value_invalid): Update. (check_pieced_synthetic_pointer): New function. (get_frame_address_in_block_wrapper): New function. (indirect_pieced_value): New function. (pieced_value_funcs): Update. (invalid_synthetic_pointer): New function. (dwarf2_evaluate_loc_desc_full): Rename from dwarf2_evaluate_loc_desc. Add byte_offset argument. (dwarf2_evaluate_loc_desc): Rewrite. (dwarf2_loc_desc_needs_frame): Set new field on context. (get_ax_pc): New function. (disassemble_dwarf_expression): Handle DW_OP_GNU_implicit_pointer. * dwarf2expr.h (enum dwarf_value_location) <DWARF_VALUE_IMPLICIT_POINTER>: New constant. (struct dwarf_expr_context) <get_frame_pc>: New field. (struct dwarf_expr_piece) <v.ptr>: New field. * dwarf2expr.c (add_piece): Handle DWARF_VALUE_IMPLICIT_POINTER. (execute_stack_op): Handle DW_OP_GNU_implicit_pointer. * dwarf2-frame.c (no_get_frame_pc): New function. (execute_stack_op): Set new field on context. * cp-valprint.c (cp_print_value_fields): Handle synthetic pointers. gdb/testsuite * gdb.dwarf2/implptr.exp: New file. * gdb.dwarf2/implptr.c: New file. * gdb.dwarf2/implptr.S: New file.
2010-11-29 22:18:16 +01:00
/* Find a particular location expression from a location list. */
const gdb_byte *dwarf2_find_location_expression
(struct dwarf2_loclist_baton *baton,
size_t *locexpr_length,
CORE_ADDR pc);
struct dwarf2_locexpr_baton dwarf2_fetch_die_location_block
gdb * opencl-lang.c (lval_func_check_synthetic_pointer): New function. * value.h (struct lval_funcs) <indirect, check_synthetic_pointer>: New fields. (value_bits_synthetic_pointer): Declare. * value.c (value_bits_synthetic_pointer): New function. * valprint.c (valprint_check_validity): Handle synthetic pointers. * valops.c (value_ind): Use new 'indirect' lval_funcs method. * valarith.c (value_ptradd): Use set_value_component_location. * p-valprint.c (pascal_object_print_value_fields): Handle synthetic pointers. * jv-valprint.c (java_print_value_fields): Handle synthetic pointers. * dwarf2read.c (dwarf_stack_op_name): Add DW_OP_GNU_implicit_pointer. (dwarf2_fetch_die_location_block): Add get_frame_pc, baton arguments. Handle location lists. (fill_in_loclist_baton): New function. (dwarf2_symbol_mark_computed): Use it. * dwarf2loc.h (dwarf2_find_location_expression): Declare. (dwarf2_fetch_die_location_block): Add get_frame_pc, baton arguments. * dwarf2loc.c (dwarf2_find_location_expression): Rename from find_location_expression. No longer static. Update all callers. (dwarf_expr_frame_pc): New function. (per_cu_dwarf_call): Add get_frame_pc, baton arguments. Update all callers. (struct piece_closure) <per_cu>: New field. (allocate_piece_closure): Add per_cu argument. (read_pieced_value): Handle DWARF_VALUE_IMPLICIT_POINTER. (check_pieced_value_bits): Remove validity argument, add check_for argument. Handle DWARF_VALUE_IMPLICIT_POINTER. (check_pieced_value_validity, check_pieced_value_invalid): Update. (check_pieced_synthetic_pointer): New function. (get_frame_address_in_block_wrapper): New function. (indirect_pieced_value): New function. (pieced_value_funcs): Update. (invalid_synthetic_pointer): New function. (dwarf2_evaluate_loc_desc_full): Rename from dwarf2_evaluate_loc_desc. Add byte_offset argument. (dwarf2_evaluate_loc_desc): Rewrite. (dwarf2_loc_desc_needs_frame): Set new field on context. (get_ax_pc): New function. (disassemble_dwarf_expression): Handle DW_OP_GNU_implicit_pointer. * dwarf2expr.h (enum dwarf_value_location) <DWARF_VALUE_IMPLICIT_POINTER>: New constant. (struct dwarf_expr_context) <get_frame_pc>: New field. (struct dwarf_expr_piece) <v.ptr>: New field. * dwarf2expr.c (add_piece): Handle DWARF_VALUE_IMPLICIT_POINTER. (execute_stack_op): Handle DW_OP_GNU_implicit_pointer. * dwarf2-frame.c (no_get_frame_pc): New function. (execute_stack_op): Set new field on context. * cp-valprint.c (cp_print_value_fields): Handle synthetic pointers. gdb/testsuite * gdb.dwarf2/implptr.exp: New file. * gdb.dwarf2/implptr.c: New file. * gdb.dwarf2/implptr.S: New file.
2010-11-29 22:18:16 +01:00
(unsigned int offset, struct dwarf2_per_cu_data *per_cu,
CORE_ADDR (*get_frame_pc) (void *baton),
void *baton);
/* 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. */
struct value *dwarf2_evaluate_loc_desc (struct type *type,
struct frame_info *frame,
const gdb_byte *data,
unsigned short size,
struct dwarf2_per_cu_data *per_cu);
/* The symbol location baton types used by the DWARF-2 reader (i.e.
SYMBOL_LOCATION_BATON for a LOC_COMPUTED symbol). "struct
dwarf2_locexpr_baton" is for a symbol with a single location
expression; "struct dwarf2_loclist_baton" is for a symbol with a
location list. */
struct dwarf2_locexpr_baton
{
/* Pointer to the start of the location expression. */
const gdb_byte *data;
/* Length of the location expression. */
unsigned long size;
2008-03-18 Ulrich Weigand <uweigand@de.ibm.com> Jim Blandy <jimb@codesourcery.com> Daniel Jacobowitz <drow@false.org> * dwarf2expr.h (struct dwarf_expr_context): Add ADDR_SIZE member. (dwarf2_read_address): Update prototype. * dwarf2expr.c (unsigned_address_type): Add ADDR_SIZE parameter. (signed_address_type): Likewise. (dwarf2_read_address): Replace BYTES_READ parameter with ADDR_SIZE. (execute_stack_op): Update calls to unsigned_address_type, signed_address_type and dwarf2_read_address. Fix implementation of DW_OP_deref_size. * dwarf2loc.h (dwarf2_per_cu_objfile): Add prototype. (dwarf2_per_cu_addr_size): Likewise. (struct dwarf2_locexpr_baton): Replace OBJFILE with PER_CU. (struct dwarf2_loclist_baton): Likewise. * dwarf2loc.c (find_location_expression): Update calls to dwarf2_read_address. Use dwarf2_per_cu_objfile and dwarf2_per_cu_addr_size to retrieve PER_CU parameters. (locexpr_describe_location): Likewise. (dwarf2_evaluate_loc_desc): Replace OBJFILE with PER_CU parameter. Set ctx->addr_size to dwarf2_per_cu_addr_size (per_cu). (dwarf2_loc_desc_needs_frame): Add PER_CU parameter. Set ctx->addr_size to dwarf2_per_cu_addr_size (per_cu). (locexpr_read_variable): Update dwarf2_evaluate_loc_desc call. (loclist_read_variable): Likewise. (locexpr_read_needs_frame): Update dwarf2_loc_desc_needs_frame call. * dwarf2read.c (dwarf2_symbol_mark_computed): Set baton->per_cu instead of baton->objfile. (dwarf2_per_cu_obfile): New function. (dwarf2_per_cu_addr_size): Likewise. * dwarf2-frame.c (struct comp_unit): Move higher. (struct dwarf2_cie): Add UNIT and ADDR_SIZE members. (execute_stack_op): Add ADDR_SIZE parameter; set ctx->addr_size. (execute_cfa_program): Add FDE parameter. Replace EH_FRAME_P parameter by using fde->eh_frame_p. Use read_encoded_value to implement DW_CFA_set_loc. (struct dwarf2_frame_cache): Add ADDR_SIZE member. (dwarf2_frame_cache): Set cache->addr_size. Update calls to execute_stack_op and execute_cfa_program. (dwarf2_frame_prev_register): Update calls to execute_stack_op. (size_of_encoded_value): Remove. (read_encoded_value): Add PTR_LEN and FUNC_BASE parameters. Remove call to size_of_encoded_value. Implement DW_EH_PE_funcrel. (add_cie): Set cie->unit backlink. (decode_frame_entry_1): Set cie->addr_size. Update calls to read_encoded_value. (dwarf2_build_frame_info): Allocate UNIT on objfile obstack.
2008-03-18 20:40:47 +01:00
/* The compilation unit containing the symbol whose location
we're computing. */
struct dwarf2_per_cu_data *per_cu;
};
struct dwarf2_loclist_baton
{
/* The initial base address for the location list, based on the compilation
unit. */
CORE_ADDR base_address;
/* Pointer to the start of the location list. */
const gdb_byte *data;
/* Length of the location list. */
unsigned long size;
2008-03-18 Ulrich Weigand <uweigand@de.ibm.com> Jim Blandy <jimb@codesourcery.com> Daniel Jacobowitz <drow@false.org> * dwarf2expr.h (struct dwarf_expr_context): Add ADDR_SIZE member. (dwarf2_read_address): Update prototype. * dwarf2expr.c (unsigned_address_type): Add ADDR_SIZE parameter. (signed_address_type): Likewise. (dwarf2_read_address): Replace BYTES_READ parameter with ADDR_SIZE. (execute_stack_op): Update calls to unsigned_address_type, signed_address_type and dwarf2_read_address. Fix implementation of DW_OP_deref_size. * dwarf2loc.h (dwarf2_per_cu_objfile): Add prototype. (dwarf2_per_cu_addr_size): Likewise. (struct dwarf2_locexpr_baton): Replace OBJFILE with PER_CU. (struct dwarf2_loclist_baton): Likewise. * dwarf2loc.c (find_location_expression): Update calls to dwarf2_read_address. Use dwarf2_per_cu_objfile and dwarf2_per_cu_addr_size to retrieve PER_CU parameters. (locexpr_describe_location): Likewise. (dwarf2_evaluate_loc_desc): Replace OBJFILE with PER_CU parameter. Set ctx->addr_size to dwarf2_per_cu_addr_size (per_cu). (dwarf2_loc_desc_needs_frame): Add PER_CU parameter. Set ctx->addr_size to dwarf2_per_cu_addr_size (per_cu). (locexpr_read_variable): Update dwarf2_evaluate_loc_desc call. (loclist_read_variable): Likewise. (locexpr_read_needs_frame): Update dwarf2_loc_desc_needs_frame call. * dwarf2read.c (dwarf2_symbol_mark_computed): Set baton->per_cu instead of baton->objfile. (dwarf2_per_cu_obfile): New function. (dwarf2_per_cu_addr_size): Likewise. * dwarf2-frame.c (struct comp_unit): Move higher. (struct dwarf2_cie): Add UNIT and ADDR_SIZE members. (execute_stack_op): Add ADDR_SIZE parameter; set ctx->addr_size. (execute_cfa_program): Add FDE parameter. Replace EH_FRAME_P parameter by using fde->eh_frame_p. Use read_encoded_value to implement DW_CFA_set_loc. (struct dwarf2_frame_cache): Add ADDR_SIZE member. (dwarf2_frame_cache): Set cache->addr_size. Update calls to execute_stack_op and execute_cfa_program. (dwarf2_frame_prev_register): Update calls to execute_stack_op. (size_of_encoded_value): Remove. (read_encoded_value): Add PTR_LEN and FUNC_BASE parameters. Remove call to size_of_encoded_value. Implement DW_EH_PE_funcrel. (add_cie): Set cie->unit backlink. (decode_frame_entry_1): Set cie->addr_size. Update calls to read_encoded_value. (dwarf2_build_frame_info): Allocate UNIT on objfile obstack.
2008-03-18 20:40:47 +01:00
/* The compilation unit containing the symbol whose location
we're computing. */
struct dwarf2_per_cu_data *per_cu;
};
* symtab.h: Rename SYMBOL_OPS to SYMBOL_COMPUTED_OPS. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value, symbol_read_needs_frame): Likewise. * printcmd.c (address_info): Likewise. * dwarf2loc.c (dwarf_expr_frame_base): Likewise. * dwarf2read.c (dwarf2_symbol_mark_computed): Likewise. * symtab.h: Rename struct symbol_ops to struct symbol_computed_ops. * dwarf2loc.h: Likewise. * dwarf2loc.c (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Likewise. * symtab.h: (struct symbol_register_ops): New struct definition. (struct symbol): Make "ops" member a union of symbol_computed_ops and symbol_register_ops callback pointers. (SYMBOL_REGISTER_OPS): New macro. * tracepoint.c: Include "objfiles.h". (scope_info, collect_symbol): Use SYMBOL_REGISTER_OPS register_number callback to retrieve register numbers. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value): Likewise. * printcmd.c (address_info): Likewise. * coffread.c (coff_reg_to_regnum): New function. (coff_register_funcs): New static variable. (process_coff_symbol): Do not call gdbarch_sdb_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * mdebugread.c (mdebug_reg_to_regnum): New function. (mdebug_register_funcs): New static variable. (parse_symbol): Do not call gdbarch_ecoff_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * stabsread.c (stab_reg_to_regnum): New function. (stab_register_funcs): New static variable. (define_symbol): Do not call gdbarch_stab_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks.
2009-06-04 14:28:39 +02:00
extern const struct symbol_computed_ops dwarf2_locexpr_funcs;
extern const struct symbol_computed_ops dwarf2_loclist_funcs;
* dwarf2expr.h: Tweak comment. (struct dwarf_expr_context): Use `gdb_byte *' in read_mem and get_frame_base function pointers. (read_uleb128, read_sleb128): Change return type and types of first two arguments to `gdb_byte *'. (dwarf2_read_address): Change types of first two arguments to `gdb_byte *'. * dwarf2expr.c: Tweak comment. (dwarf_expr_eval): Change type of second argument to `gdb_byte *'. (read_uleb128, read_sleb128): Change return type and types of first two arguments to `gdb_byte *'. (dwarf2_read_address): Change types of first two arguments to `gdb_byte *'. (execute_stack_op): Change types of last two arguments to `gdb_byte *'. Use `gdb_byte *' for byte buffers. * dwarf2loc.h: Tweak comment. (struct dwarf2_locexpr_baton, struct dwarf2_loclist_baton): Use `gdb_byte *' for byte buffers. * dwarf2loc.c (find_location_expression): Change return type to `gdb_byte *'. Use `gdb_byte *' for byte buffers. Change length to `unsigned int'. (dwarf_expr_read_reg): Use `gdb_byte *' for byte buffer. Remove bogus cast. (dwarf_expr_read_mem): Change type of second argument to `gdb_byte *'. (dwarf_expr_frame_base): Change type of second argument to `gdb_byte **'. (dwarf2_evaluate_loc_desc): Change type of third argument to `gdb_byte *'. (needs_frame_read_mem): Change type of second argument to `gdb_byte *'. (needs_frame_frame_base): Change type of second argument `gdb_byte **'. Use gdb_byte for lit0. (dwarf2_tracepoint_var_ref): Change type of fourth argument to `gdb_byte *'. Use `gdb_byte *' for byte buffer. (loclist_read_variable, loclist_tracepoint_var_ref): Use `gdb_byte *' for byte buffer. * dwarf2-frame.c (struct dwarf2_cie, struct dwarf2_fde) (struct dwarf2_frame_state): Use gdb_byte instead of `unsigned char'. (read_reg): Use `gdb_byte *' for byte buffers. Remove redundant cast. (read_mem): Change second argument to `gdb_byte *'. (no_get_frame_base): Change second argument to `gdb_byte **'. (execute_stack_op): Change first argument to `gdb_byte *'. (execute_cfa_program): Change first two arguments to `gdb_byte *'. Use gdb_byte instead of `unsigned int'. Use temprorary variable to store result of read_uleb128. (struct comp_unit): Use `gdb_byte *' for byte buffers. (read_1_byte, read_4_bytes, read_8_bytes): Change last argument to `gdb_byte *'. (read_unsigned_leb128, read_signed_leb128): Change second argument to `gdb_byte *'. Use gdb_byte instead of `unsigned char'. (read_initial_length): Change second argument to `gdb_byte *'. Remove redundant casts. (read_encoded_value): Use gdb_byte instead of `unsigned char'. Remove bogus casts. (decode_frame_entry_1): Change return type and second argument to `gdb_byte *'. Use `gdb_byte *' for byte buffers. Use gdb_byte instead of `unsigned char'. (decode_frame_entry): Change return type and second argument to `gdb_byte *'. Use `gdb_byte *' for byte buffers. (dwarf2_build_frame_info): Use `gdb_byte *' for byte buffers.
2005-07-12 15:06:54 +02:00
#endif /* dwarf2loc.h */