2005-07-12 15:06:54 +02:00
|
|
|
/* DWARF 2 location expression support for GDB.
|
|
|
|
|
2012-01-04 09:17:56 +01:00
|
|
|
Copyright (C) 2003, 2005, 2007-2012 Free Software Foundation, Inc.
|
Based on a patch from Daniel Berlin (dberlin@dberlin.org).
* symtab.h: Add opaque declarations of struct axs_value and
struct agent_expr.
(enum address_class): Add LOC_COMPUTED and LOC_COMPUTED_ARG.
(struct location_funcs): New type.
(struct symbol): Add "loc" to aux_value.
(SYMBOL_LOCATION_BATON, SYMBOL_LOCATION_FUNCS): New macros.
* dwarf2read.c: Include "dwarf2expr.h".
(dwarf2_symbol_mark_computed): New function.
(read_func_scope): Use it.
(var_decode_location): New function.
(new_symbol): Use it.
* dwarf2expr.c, dwarf2expr.h, dwarf2loc.c, dwarf2loc.h: New files.
* Makefile.in (SFILES): Add dwarf2loc.c and dwarf2expr.c.
(dwarf2expr_h, dwarf2loc_h): New variables.
(COMMON_OBS): Add dwarf2expr.o and dwarf2loc.o.
(dwarf2expr.o, dwarf2loc.o): New rules.
(dwarf2read.o): Add $(dwarf2expr_h) and $(dwarf2loc_h).
* buildsym.c (finish_block): Handle LOC_COMPUTED and
LOC_COMPUTED_ARG.
* findvar.c (symbol_read_needs_frame, read_var_value): Likewise.
* m2-exp.y (yylex): Likewise.
* printcmd.c (address_info, print_frame_args): Likewise.
* stack.c (print_block_frame_locals, print_frame_arg_vars): Likewise.
* symmisc.c (print_symbol, print_partial_symbols): Likewise.
* ada-lang.c (ada_resolve_subexp, symtab_for_sym)
(ada_add_block_symbols, fill_in_ada_prototype): Likewise.
* symtab.c (lookup_block_symbol): Likewise.
2003-02-21 16:24:18 +01:00
|
|
|
|
|
|
|
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
|
2007-08-23 20:08:50 +02:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
Based on a patch from Daniel Berlin (dberlin@dberlin.org).
* symtab.h: Add opaque declarations of struct axs_value and
struct agent_expr.
(enum address_class): Add LOC_COMPUTED and LOC_COMPUTED_ARG.
(struct location_funcs): New type.
(struct symbol): Add "loc" to aux_value.
(SYMBOL_LOCATION_BATON, SYMBOL_LOCATION_FUNCS): New macros.
* dwarf2read.c: Include "dwarf2expr.h".
(dwarf2_symbol_mark_computed): New function.
(read_func_scope): Use it.
(var_decode_location): New function.
(new_symbol): Use it.
* dwarf2expr.c, dwarf2expr.h, dwarf2loc.c, dwarf2loc.h: New files.
* Makefile.in (SFILES): Add dwarf2loc.c and dwarf2expr.c.
(dwarf2expr_h, dwarf2loc_h): New variables.
(COMMON_OBS): Add dwarf2expr.o and dwarf2loc.o.
(dwarf2expr.o, dwarf2loc.o): New rules.
(dwarf2read.o): Add $(dwarf2expr_h) and $(dwarf2loc_h).
* buildsym.c (finish_block): Handle LOC_COMPUTED and
LOC_COMPUTED_ARG.
* findvar.c (symbol_read_needs_frame, read_var_value): Likewise.
* m2-exp.y (yylex): Likewise.
* printcmd.c (address_info, print_frame_args): Likewise.
* stack.c (print_block_frame_locals, print_frame_arg_vars): Likewise.
* symmisc.c (print_symbol, print_partial_symbols): Likewise.
* ada-lang.c (ada_resolve_subexp, symtab_for_sym)
(ada_add_block_symbols, fill_in_ada_prototype): Likewise.
* symtab.c (lookup_block_symbol): Likewise.
2003-02-21 16:24:18 +01:00
|
|
|
(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
|
2007-08-23 20:08:50 +02:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
Based on a patch from Daniel Berlin (dberlin@dberlin.org).
* symtab.h: Add opaque declarations of struct axs_value and
struct agent_expr.
(enum address_class): Add LOC_COMPUTED and LOC_COMPUTED_ARG.
(struct location_funcs): New type.
(struct symbol): Add "loc" to aux_value.
(SYMBOL_LOCATION_BATON, SYMBOL_LOCATION_FUNCS): New macros.
* dwarf2read.c: Include "dwarf2expr.h".
(dwarf2_symbol_mark_computed): New function.
(read_func_scope): Use it.
(var_decode_location): New function.
(new_symbol): Use it.
* dwarf2expr.c, dwarf2expr.h, dwarf2loc.c, dwarf2loc.h: New files.
* Makefile.in (SFILES): Add dwarf2loc.c and dwarf2expr.c.
(dwarf2expr_h, dwarf2loc_h): New variables.
(COMMON_OBS): Add dwarf2expr.o and dwarf2loc.o.
(dwarf2expr.o, dwarf2loc.o): New rules.
(dwarf2read.o): Add $(dwarf2expr_h) and $(dwarf2loc_h).
* buildsym.c (finish_block): Handle LOC_COMPUTED and
LOC_COMPUTED_ARG.
* findvar.c (symbol_read_needs_frame, read_var_value): Likewise.
* m2-exp.y (yylex): Likewise.
* printcmd.c (address_info, print_frame_args): Likewise.
* stack.c (print_block_frame_locals, print_frame_arg_vars): Likewise.
* symmisc.c (print_symbol, print_partial_symbols): Likewise.
* ada-lang.c (ada_resolve_subexp, symtab_for_sym)
(ada_add_block_symbols, fill_in_ada_prototype): Likewise.
* symtab.c (lookup_block_symbol): Likewise.
2003-02-21 16:24:18 +01:00
|
|
|
|
|
|
|
#if !defined (DWARF2LOC_H)
|
|
|
|
#define DWARF2LOC_H
|
|
|
|
|
gdb/
Code cleanupp: Use cu_offset and sect_offset compile time type checking.
* dwarf2expr.c (add_piece, dwarf_get_base_type, execute_stack_op)
(ctx_no_dwarf_call, ctx_no_get_base_type): Use cu_offset and
sect_offset.
* dwarf2expr.h (cu_offset, sect_offset): New types.
(struct dwarf_expr_context_funcs) <dwarf_call>
(struct dwarf_expr_context_funcs) <get_base_type>: Use cu_offset and
sect_offset.
(struct dwarf_expr_context) <len>: Improve the comment.
(struct dwarf_expr_piece, ctx_no_dwarf_call, ctx_no_get_base_type): Use
cu_offset and sect_offset.
* dwarf2loc.c (per_cu_dwarf_call, dwarf_expr_dwarf_call)
(dwarf_expr_get_base_type, needs_frame_dwarf_call)
(dwarf2_compile_expr_to_ax, disassemble_dwarf_expression): Likewise.
* dwarf2loc.h: Include dwarf2expr.h.
(dwarf2_fetch_die_location_block, dwarf2_get_die_type): Use cu_offset
and sect_offset.
* dwarf2read.c (struct dwarf2_per_objfile) <debug_types_type_hash>:
Improve the comment.
(struct comp_unit_head, struct dwarf2_cu, struct dwarf2_per_cu_data)
(struct signatured_type, struct line_header, struct partial_die_info)
(struct die_info, find_partial_die, dwarf2_get_ref_die_offset)
(lookup_signatured_type_at_offset, dwarf2_find_containing_comp_unit)
(get_die_type_at_offset, create_cus_from_index)
(create_signatured_type_table_from_index, dw2_get_file_names)
(offset_in_cu_p, read_comp_unit_head, error_check_comp_unit_head)
(read_and_check_comp_unit_head, read_and_check_type_unit_head)
(create_debug_types_hash_table, process_psymtab_comp_unit)
(load_partial_comp_unit, create_all_comp_units)
(partial_die_parent_scope, partial_die_full_name, skip_one_die)
(load_full_comp_unit, dwarf2_physname, read_import_statement)
(inherit_abstract_dies, read_func_scope, read_call_site_scope)
(dwarf2_add_member_fn, process_enumeration_scope, read_module_type)
(read_typedef, die_hash, die_eq, read_full_die, dwarf2_read_abbrevs)
(load_partial_dies, read_partial_die, find_partial_die_in_comp_unit)
(find_partial_die, read_attribute_value, lookup_die_type)
(dump_die_shallow, store_in_ref_table): Use cu_offset and sect_offset.
(is_ref_attr): New function comment.
(dwarf2_get_ref_die_offset): New function comment, new variable retval.
Use cu_offset and sect_offset.
(follow_die_offset, follow_die_ref, dwarf2_fetch_die_location_block)
(dwarf2_get_die_type, follow_die_sig, lookup_signatured_type_at_offset)
(load_full_type_unit, read_signatured_type, per_cu_header_read_in)
(dwarf2_find_containing_comp_unit, struct dwarf2_offset_and_type)
(offset_and_type_hash, offset_and_type_eq, set_die_type)
(get_die_type_at_offset, partial_die_hash, partial_die_eq)
(write_one_signatured_type, write_psymtabs_to_index): Use cu_offset and
sect_offset.
2012-03-19 20:59:19 +01:00
|
|
|
#include "dwarf2expr.h"
|
|
|
|
|
2009-06-04 14:28:39 +02:00
|
|
|
struct symbol_computed_ops;
|
2008-03-18 20:40:47 +01:00
|
|
|
struct objfile;
|
|
|
|
struct dwarf2_per_cu_data;
|
2010-11-29 22:18:16 +01:00
|
|
|
struct dwarf2_loclist_baton;
|
2011-02-17 17:20:44 +01:00
|
|
|
struct agent_expr;
|
|
|
|
struct axs_value;
|
2004-01-26 21:36:32 +01:00
|
|
|
|
Based on a patch from Daniel Berlin (dberlin@dberlin.org).
* symtab.h: Add opaque declarations of struct axs_value and
struct agent_expr.
(enum address_class): Add LOC_COMPUTED and LOC_COMPUTED_ARG.
(struct location_funcs): New type.
(struct symbol): Add "loc" to aux_value.
(SYMBOL_LOCATION_BATON, SYMBOL_LOCATION_FUNCS): New macros.
* dwarf2read.c: Include "dwarf2expr.h".
(dwarf2_symbol_mark_computed): New function.
(read_func_scope): Use it.
(var_decode_location): New function.
(new_symbol): Use it.
* dwarf2expr.c, dwarf2expr.h, dwarf2loc.c, dwarf2loc.h: New files.
* Makefile.in (SFILES): Add dwarf2loc.c and dwarf2expr.c.
(dwarf2expr_h, dwarf2loc_h): New variables.
(COMMON_OBS): Add dwarf2expr.o and dwarf2loc.o.
(dwarf2expr.o, dwarf2loc.o): New rules.
(dwarf2read.o): Add $(dwarf2expr_h) and $(dwarf2loc_h).
* buildsym.c (finish_block): Handle LOC_COMPUTED and
LOC_COMPUTED_ARG.
* findvar.c (symbol_read_needs_frame, read_var_value): Likewise.
* m2-exp.y (yylex): Likewise.
* printcmd.c (address_info, print_frame_args): Likewise.
* stack.c (print_block_frame_locals, print_frame_arg_vars): Likewise.
* symmisc.c (print_symbol, print_partial_symbols): Likewise.
* ada-lang.c (ada_resolve_subexp, symtab_for_sym)
(ada_add_block_symbols, fill_in_ada_prototype): Likewise.
* symtab.c (lookup_block_symbol): Likewise.
2003-02-21 16:24:18 +01:00
|
|
|
/* This header is private to the DWARF-2 reader. It is shared between
|
|
|
|
dwarf2read.c and dwarf2loc.c. */
|
|
|
|
|
gdb/
Implement basic support for DW_TAG_GNU_call_site.
* block.c: Include gdbtypes.h and exceptions.h.
(call_site_for_pc): New function.
* block.h (call_site_for_pc): New declaration.
* defs.h: Include hashtab.h.
(make_cleanup_htab_delete, core_addr_hash, core_addr_eq): New
declarations.
* dwarf2-frame.c (dwarf2_frame_ctx_funcs): Install
ctx_no_push_dwarf_reg_entry_value.
* dwarf2expr.c (read_uleb128, read_sleb128): Support R as NULL.
(dwarf_block_to_dwarf_reg): New function.
(execute_stack_op) <DW_OP_GNU_entry_value>: Implement it.
(ctx_no_push_dwarf_reg_entry_value): New function.
* dwarf2expr.h (struct dwarf_expr_context_funcs): New field
push_dwarf_reg_entry_value.
(ctx_no_push_dwarf_reg_entry_value, dwarf_block_to_dwarf_reg): New
declarations.
* dwarf2loc.c: Include gdbcmd.h.
(dwarf_expr_ctx_funcs): New forward declaration.
(entry_values_debug, show_entry_values_debug, call_site_to_target_addr)
(dwarf_expr_reg_to_entry_parameter)
(dwarf_expr_push_dwarf_reg_entry_value): New.
(dwarf_expr_ctx_funcs): Install dwarf_expr_push_dwarf_reg_entry_value.
(dwarf2_evaluate_loc_desc_full): Handle NO_ENTRY_VALUE_ERROR.
(needs_dwarf_reg_entry_value): New function.
(needs_frame_ctx_funcs): Install it.
(_initialize_dwarf2loc): New function.
* dwarf2loc.h (entry_values_debug): New declaration.
* dwarf2read.c (struct dwarf2_cu): New field call_site_htab.
(read_call_site_scope): New forward declaration.
(process_full_comp_unit): Copy call_site_htab.
(process_die): Support DW_TAG_GNU_call_site.
(read_call_site_scope): New function.
(dwarf2_get_pc_bounds): Support NULL HIGHPC.
(dwarf_tag_name): Support DW_TAG_GNU_call_site.
(cleanup_htab): Delete.
(write_psymtabs_to_index): Use make_cleanup_htab_delete instead of it.
* exceptions.h (enum errors): New NO_ENTRY_VALUE_ERROR.
* gdb-gdb.py (StructMainTypePrettyPrinter): Support
FIELD_LOC_KIND_DWARF_BLOCK.
* gdbtypes.h (enum field_loc_kind): New entry
FIELD_LOC_KIND_DWARF_BLOCK.
(struct main_type): New loc entry dwarf_block.
(struct call_site, FIELD_DWARF_BLOCK, SET_FIELD_DWARF_BLOCK)
(TYPE_FIELD_DWARF_BLOCK): New.
* python/py-type.c: Include dwarf2loc.h.
(check_types_equal): Support FIELD_LOC_KIND_DWARF_BLOCK. New
internal_error call on unknown FIELD_LOC_KIND.
* symtab.h (struct symtab): New field call_site_htab.
* utils.c (do_htab_delete_cleanup, make_cleanup_htab_delete)
(core_addr_hash, core_addr_eq): New functions.
gdb/testsuite/
Implement basic support for DW_TAG_GNU_call_site.
* gdb.arch/Makefile.in (EXECUTABLES): Add amd64-entry-value.
* gdb.arch/amd64-entry-value.cc: New file.
* gdb.arch/amd64-entry-value.exp: New file.
2011-10-09 21:21:39 +02:00
|
|
|
/* `set debug entry-values' setting. */
|
|
|
|
extern int entry_values_debug;
|
|
|
|
|
2010-07-13 17:09:03 +02:00
|
|
|
/* 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 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. */
|
2012-01-05 22:53:14 +01:00
|
|
|
int dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *cu);
|
2008-03-18 20:40:47 +01:00
|
|
|
|
2011-10-09 20:46:41 +02:00
|
|
|
/* Return the DW_FORM_ref_addr size given in the compilation unit header for
|
|
|
|
CU. */
|
|
|
|
int dwarf2_per_cu_ref_addr_size (struct dwarf2_per_cu_data *cu);
|
|
|
|
|
2010-06-02 21:37:56 +02:00
|
|
|
/* Return the offset size given in the compilation unit header for CU. */
|
|
|
|
int dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *cu);
|
|
|
|
|
2010-07-13 17:09:03 +02:00
|
|
|
/* 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);
|
|
|
|
|
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);
|
|
|
|
|
2010-06-07 21:55:33 +02:00
|
|
|
struct dwarf2_locexpr_baton dwarf2_fetch_die_location_block
|
gdb/
Code cleanupp: Use cu_offset and sect_offset compile time type checking.
* dwarf2expr.c (add_piece, dwarf_get_base_type, execute_stack_op)
(ctx_no_dwarf_call, ctx_no_get_base_type): Use cu_offset and
sect_offset.
* dwarf2expr.h (cu_offset, sect_offset): New types.
(struct dwarf_expr_context_funcs) <dwarf_call>
(struct dwarf_expr_context_funcs) <get_base_type>: Use cu_offset and
sect_offset.
(struct dwarf_expr_context) <len>: Improve the comment.
(struct dwarf_expr_piece, ctx_no_dwarf_call, ctx_no_get_base_type): Use
cu_offset and sect_offset.
* dwarf2loc.c (per_cu_dwarf_call, dwarf_expr_dwarf_call)
(dwarf_expr_get_base_type, needs_frame_dwarf_call)
(dwarf2_compile_expr_to_ax, disassemble_dwarf_expression): Likewise.
* dwarf2loc.h: Include dwarf2expr.h.
(dwarf2_fetch_die_location_block, dwarf2_get_die_type): Use cu_offset
and sect_offset.
* dwarf2read.c (struct dwarf2_per_objfile) <debug_types_type_hash>:
Improve the comment.
(struct comp_unit_head, struct dwarf2_cu, struct dwarf2_per_cu_data)
(struct signatured_type, struct line_header, struct partial_die_info)
(struct die_info, find_partial_die, dwarf2_get_ref_die_offset)
(lookup_signatured_type_at_offset, dwarf2_find_containing_comp_unit)
(get_die_type_at_offset, create_cus_from_index)
(create_signatured_type_table_from_index, dw2_get_file_names)
(offset_in_cu_p, read_comp_unit_head, error_check_comp_unit_head)
(read_and_check_comp_unit_head, read_and_check_type_unit_head)
(create_debug_types_hash_table, process_psymtab_comp_unit)
(load_partial_comp_unit, create_all_comp_units)
(partial_die_parent_scope, partial_die_full_name, skip_one_die)
(load_full_comp_unit, dwarf2_physname, read_import_statement)
(inherit_abstract_dies, read_func_scope, read_call_site_scope)
(dwarf2_add_member_fn, process_enumeration_scope, read_module_type)
(read_typedef, die_hash, die_eq, read_full_die, dwarf2_read_abbrevs)
(load_partial_dies, read_partial_die, find_partial_die_in_comp_unit)
(find_partial_die, read_attribute_value, lookup_die_type)
(dump_die_shallow, store_in_ref_table): Use cu_offset and sect_offset.
(is_ref_attr): New function comment.
(dwarf2_get_ref_die_offset): New function comment, new variable retval.
Use cu_offset and sect_offset.
(follow_die_offset, follow_die_ref, dwarf2_fetch_die_location_block)
(dwarf2_get_die_type, follow_die_sig, lookup_signatured_type_at_offset)
(load_full_type_unit, read_signatured_type, per_cu_header_read_in)
(dwarf2_find_containing_comp_unit, struct dwarf2_offset_and_type)
(offset_and_type_hash, offset_and_type_eq, set_die_type)
(get_die_type_at_offset, partial_die_hash, partial_die_eq)
(write_one_signatured_type, write_psymtabs_to_index): Use cu_offset and
sect_offset.
2012-03-19 20:59:19 +01:00
|
|
|
(cu_offset offset_in_cu, struct dwarf2_per_cu_data *per_cu,
|
2010-11-29 22:18:16 +01:00
|
|
|
CORE_ADDR (*get_frame_pc) (void *baton),
|
|
|
|
void *baton);
|
2010-06-07 21:55:33 +02:00
|
|
|
|
gdb/
Code cleanupp: Use cu_offset and sect_offset compile time type checking.
* dwarf2expr.c (add_piece, dwarf_get_base_type, execute_stack_op)
(ctx_no_dwarf_call, ctx_no_get_base_type): Use cu_offset and
sect_offset.
* dwarf2expr.h (cu_offset, sect_offset): New types.
(struct dwarf_expr_context_funcs) <dwarf_call>
(struct dwarf_expr_context_funcs) <get_base_type>: Use cu_offset and
sect_offset.
(struct dwarf_expr_context) <len>: Improve the comment.
(struct dwarf_expr_piece, ctx_no_dwarf_call, ctx_no_get_base_type): Use
cu_offset and sect_offset.
* dwarf2loc.c (per_cu_dwarf_call, dwarf_expr_dwarf_call)
(dwarf_expr_get_base_type, needs_frame_dwarf_call)
(dwarf2_compile_expr_to_ax, disassemble_dwarf_expression): Likewise.
* dwarf2loc.h: Include dwarf2expr.h.
(dwarf2_fetch_die_location_block, dwarf2_get_die_type): Use cu_offset
and sect_offset.
* dwarf2read.c (struct dwarf2_per_objfile) <debug_types_type_hash>:
Improve the comment.
(struct comp_unit_head, struct dwarf2_cu, struct dwarf2_per_cu_data)
(struct signatured_type, struct line_header, struct partial_die_info)
(struct die_info, find_partial_die, dwarf2_get_ref_die_offset)
(lookup_signatured_type_at_offset, dwarf2_find_containing_comp_unit)
(get_die_type_at_offset, create_cus_from_index)
(create_signatured_type_table_from_index, dw2_get_file_names)
(offset_in_cu_p, read_comp_unit_head, error_check_comp_unit_head)
(read_and_check_comp_unit_head, read_and_check_type_unit_head)
(create_debug_types_hash_table, process_psymtab_comp_unit)
(load_partial_comp_unit, create_all_comp_units)
(partial_die_parent_scope, partial_die_full_name, skip_one_die)
(load_full_comp_unit, dwarf2_physname, read_import_statement)
(inherit_abstract_dies, read_func_scope, read_call_site_scope)
(dwarf2_add_member_fn, process_enumeration_scope, read_module_type)
(read_typedef, die_hash, die_eq, read_full_die, dwarf2_read_abbrevs)
(load_partial_dies, read_partial_die, find_partial_die_in_comp_unit)
(find_partial_die, read_attribute_value, lookup_die_type)
(dump_die_shallow, store_in_ref_table): Use cu_offset and sect_offset.
(is_ref_attr): New function comment.
(dwarf2_get_ref_die_offset): New function comment, new variable retval.
Use cu_offset and sect_offset.
(follow_die_offset, follow_die_ref, dwarf2_fetch_die_location_block)
(dwarf2_get_die_type, follow_die_sig, lookup_signatured_type_at_offset)
(load_full_type_unit, read_signatured_type, per_cu_header_read_in)
(dwarf2_find_containing_comp_unit, struct dwarf2_offset_and_type)
(offset_and_type_hash, offset_and_type_eq, set_die_type)
(get_die_type_at_offset, partial_die_hash, partial_die_eq)
(write_one_signatured_type, write_psymtabs_to_index): Use cu_offset and
sect_offset.
2012-03-19 20:59:19 +01:00
|
|
|
struct type *dwarf2_get_die_type (cu_offset die_offset,
|
2011-05-12 19:40:55 +02:00
|
|
|
struct dwarf2_per_cu_data *per_cu);
|
|
|
|
|
2010-08-12 21:55:38 +02:00
|
|
|
/* 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);
|
|
|
|
|
2003-04-13 17:43:35 +02:00
|
|
|
/* 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. */
|
Based on a patch from Daniel Berlin (dberlin@dberlin.org).
* symtab.h: Add opaque declarations of struct axs_value and
struct agent_expr.
(enum address_class): Add LOC_COMPUTED and LOC_COMPUTED_ARG.
(struct location_funcs): New type.
(struct symbol): Add "loc" to aux_value.
(SYMBOL_LOCATION_BATON, SYMBOL_LOCATION_FUNCS): New macros.
* dwarf2read.c: Include "dwarf2expr.h".
(dwarf2_symbol_mark_computed): New function.
(read_func_scope): Use it.
(var_decode_location): New function.
(new_symbol): Use it.
* dwarf2expr.c, dwarf2expr.h, dwarf2loc.c, dwarf2loc.h: New files.
* Makefile.in (SFILES): Add dwarf2loc.c and dwarf2expr.c.
(dwarf2expr_h, dwarf2loc_h): New variables.
(COMMON_OBS): Add dwarf2expr.o and dwarf2loc.o.
(dwarf2expr.o, dwarf2loc.o): New rules.
(dwarf2read.o): Add $(dwarf2expr_h) and $(dwarf2loc_h).
* buildsym.c (finish_block): Handle LOC_COMPUTED and
LOC_COMPUTED_ARG.
* findvar.c (symbol_read_needs_frame, read_var_value): Likewise.
* m2-exp.y (yylex): Likewise.
* printcmd.c (address_info, print_frame_args): Likewise.
* stack.c (print_block_frame_locals, print_frame_arg_vars): Likewise.
* symmisc.c (print_symbol, print_partial_symbols): Likewise.
* ada-lang.c (ada_resolve_subexp, symtab_for_sym)
(ada_add_block_symbols, fill_in_ada_prototype): Likewise.
* symtab.c (lookup_block_symbol): Likewise.
2003-02-21 16:24:18 +01:00
|
|
|
|
|
|
|
struct dwarf2_locexpr_baton
|
|
|
|
{
|
2011-10-13 00:04:12 +02:00
|
|
|
/* Pointer to the start of the location expression. Valid only if SIZE is
|
|
|
|
not zero. */
|
2010-05-26 17:21:13 +02:00
|
|
|
const gdb_byte *data;
|
2003-04-13 17:43:35 +02:00
|
|
|
|
2011-10-13 00:04:12 +02:00
|
|
|
/* Length of the location expression. For optimized out expressions it is
|
|
|
|
zero. */
|
2007-01-28 02:38:40 +01:00
|
|
|
unsigned long size;
|
2003-04-13 17:43:35 +02:00
|
|
|
|
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;
|
2003-04-13 17:43:35 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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. */
|
2010-05-26 17:21:13 +02:00
|
|
|
const gdb_byte *data;
|
2003-04-13 17:43:35 +02:00
|
|
|
|
|
|
|
/* Length of the location list. */
|
2007-01-28 02:38:40 +01:00
|
|
|
unsigned long size;
|
2003-04-13 17:43:35 +02:00
|
|
|
|
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;
|
Based on a patch from Daniel Berlin (dberlin@dberlin.org).
* symtab.h: Add opaque declarations of struct axs_value and
struct agent_expr.
(enum address_class): Add LOC_COMPUTED and LOC_COMPUTED_ARG.
(struct location_funcs): New type.
(struct symbol): Add "loc" to aux_value.
(SYMBOL_LOCATION_BATON, SYMBOL_LOCATION_FUNCS): New macros.
* dwarf2read.c: Include "dwarf2expr.h".
(dwarf2_symbol_mark_computed): New function.
(read_func_scope): Use it.
(var_decode_location): New function.
(new_symbol): Use it.
* dwarf2expr.c, dwarf2expr.h, dwarf2loc.c, dwarf2loc.h: New files.
* Makefile.in (SFILES): Add dwarf2loc.c and dwarf2expr.c.
(dwarf2expr_h, dwarf2loc_h): New variables.
(COMMON_OBS): Add dwarf2expr.o and dwarf2loc.o.
(dwarf2expr.o, dwarf2loc.o): New rules.
(dwarf2read.o): Add $(dwarf2expr_h) and $(dwarf2loc_h).
* buildsym.c (finish_block): Handle LOC_COMPUTED and
LOC_COMPUTED_ARG.
* findvar.c (symbol_read_needs_frame, read_var_value): Likewise.
* m2-exp.y (yylex): Likewise.
* printcmd.c (address_info, print_frame_args): Likewise.
* stack.c (print_block_frame_locals, print_frame_arg_vars): Likewise.
* symmisc.c (print_symbol, print_partial_symbols): Likewise.
* ada-lang.c (ada_resolve_subexp, symtab_for_sym)
(ada_add_block_symbols, fill_in_ada_prototype): Likewise.
* symtab.c (lookup_block_symbol): Likewise.
2003-02-21 16:24:18 +01:00
|
|
|
};
|
|
|
|
|
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;
|
Based on a patch from Daniel Berlin (dberlin@dberlin.org).
* symtab.h: Add opaque declarations of struct axs_value and
struct agent_expr.
(enum address_class): Add LOC_COMPUTED and LOC_COMPUTED_ARG.
(struct location_funcs): New type.
(struct symbol): Add "loc" to aux_value.
(SYMBOL_LOCATION_BATON, SYMBOL_LOCATION_FUNCS): New macros.
* dwarf2read.c: Include "dwarf2expr.h".
(dwarf2_symbol_mark_computed): New function.
(read_func_scope): Use it.
(var_decode_location): New function.
(new_symbol): Use it.
* dwarf2expr.c, dwarf2expr.h, dwarf2loc.c, dwarf2loc.h: New files.
* Makefile.in (SFILES): Add dwarf2loc.c and dwarf2expr.c.
(dwarf2expr_h, dwarf2loc_h): New variables.
(COMMON_OBS): Add dwarf2expr.o and dwarf2loc.o.
(dwarf2expr.o, dwarf2loc.o): New rules.
(dwarf2read.o): Add $(dwarf2expr_h) and $(dwarf2loc_h).
* buildsym.c (finish_block): Handle LOC_COMPUTED and
LOC_COMPUTED_ARG.
* findvar.c (symbol_read_needs_frame, read_var_value): Likewise.
* m2-exp.y (yylex): Likewise.
* printcmd.c (address_info, print_frame_args): Likewise.
* stack.c (print_block_frame_locals, print_frame_arg_vars): Likewise.
* symmisc.c (print_symbol, print_partial_symbols): Likewise.
* ada-lang.c (ada_resolve_subexp, symtab_for_sym)
(ada_add_block_symbols, fill_in_ada_prototype): Likewise.
* symtab.c (lookup_block_symbol): Likewise.
2003-02-21 16:24:18 +01:00
|
|
|
|
2011-02-17 17:20:44 +01:00
|
|
|
/* Compile a DWARF location expression to an agent expression.
|
|
|
|
|
|
|
|
EXPR is the agent expression we are building.
|
|
|
|
LOC is the agent value we modify.
|
|
|
|
ARCH is the architecture.
|
|
|
|
ADDR_SIZE is the size of addresses, in bytes.
|
|
|
|
OP_PTR is the start of the location expression.
|
|
|
|
OP_END is one past the last byte of the location expression.
|
|
|
|
|
|
|
|
This will throw an exception for various kinds of errors -- for
|
|
|
|
example, if the expression cannot be compiled, or if the expression
|
|
|
|
is invalid. */
|
|
|
|
|
|
|
|
extern void dwarf2_compile_expr_to_ax (struct agent_expr *expr,
|
|
|
|
struct axs_value *loc,
|
|
|
|
struct gdbarch *arch,
|
|
|
|
unsigned int addr_size,
|
|
|
|
const gdb_byte *op_ptr,
|
|
|
|
const gdb_byte *op_end,
|
|
|
|
struct dwarf2_per_cu_data *per_cu);
|
|
|
|
|
gdb/
Recognize virtual tail call frames.
* Makefile.in (SFILES): Add dwarf2-frame-tailcall.c.
(HFILES_NO_SRCDIR): Add dwarf2-frame-tailcall.h.
(COMMON_OBS): Add dwarf2-frame-tailcall.o.
* dwarf2-frame-tailcall.c: New file.
* dwarf2-frame-tailcall.h: New file.
* dwarf2-frame.c: Include dwarf2-frame-tailcall.h.
(execute_cfa_program): New function comment. Return INSN_PTR. Reset
REGS.PREV only after CIE execution.
(struct dwarf2_frame_cache): New field tailcall_cache.
(dwarf2_frame_cache): New variables entry_pc, entry_cfa_sp_offset,
entry_cfa_sp_offset_p and instr. Execute FDE instructions in two
parts, try to find entry_cfa_sp_offset. Call
dwarf2_tailcall_sniffer_first.
(dwarf2_frame_prev_register): Call dwarf2_tailcall_prev_register_first
when appropriate.
(dwarf2_frame_dealloc_cache): New function.
(dwarf2_frame_sniffer): Preinitialize cache by dwarf2_frame_cache.
(dwarf2_frame_unwind): Install dwarf2_frame_dealloc_cache.
(dwarf2_signal_frame_unwind): Do not install dwarf2_frame_dealloc_cache.
(dwarf2_append_unwinders): Add dwarf2_tailcall_frame_unwind.
(dwarf2_frame_cfa): Support also dwarf2_tailcall_frame_unwind.
* dwarf2loc.c (func_addr_to_tail_call_list)
(tailcall_dump, call_sitep, VEC (call_sitep), chain_candidate)
(call_site_find_chain_1, call_site_find_chain): New.
* dwarf2loc.h (struct call_site_chain): New.
(call_site_find_chain): New declaration.
* frame.c (get_frame_address_in_block): Support also TAILCALL_FRAME.
* frame.h (enum frame_type): New entry TAILCALL_FRAME.
* python/py-frame.c (gdbpy_initialize_frames): Add TAILCALL_FRAME.
* stack.c (frame_info): Support also TAILCALL_FRAME.
gdb/doc/
Recognize virtual tail call frames.
* gdb.texinfo (Optimized Code): Add reference to Tail Call Frames.
(Tail Call Frames): New node.
(Frames In Python): Add gdb.TAILCALL_FRAME.
gdb/testsuite/
Recognize virtual tail call frames.
* gdb.arch/amd64-entry-value.cc (c, a, b, amb_z, amb_y, amb_x, amb)
(amb_b, amb_a): New.
(main): Call a and b.
* gdb.arch/amd64-entry-value.exp (tailcall: breakhere, tailcall: bt)
(tailcall: p i, tailcall: p j, set $sp0=$sp, up, p $sp0 == $sp, frame 3)
(p $sp0 + sizeof (void *) == $sp, ambiguous: breakhere, ambiguous: bt):
New tests.
2011-10-09 21:26:44 +02:00
|
|
|
/* Determined tail calls for constructing virtual tail call frames. */
|
|
|
|
|
|
|
|
struct call_site_chain
|
|
|
|
{
|
|
|
|
/* Initially CALLERS == CALLEES == LENGTH. For partially ambiguous result
|
|
|
|
CALLERS + CALLEES < LENGTH. */
|
|
|
|
int callers, callees, length;
|
|
|
|
|
|
|
|
/* Variably sized array with LENGTH elements. Later [0..CALLERS-1] contain
|
|
|
|
top (GDB "prev") sites and [LENGTH-CALLEES..LENGTH-1] contain bottom
|
|
|
|
(GDB "next") sites. One is interested primarily in the PC field. */
|
|
|
|
struct call_site *call_site[1];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct call_site_stuff;
|
|
|
|
extern struct call_site_chain *call_site_find_chain (struct gdbarch *gdbarch,
|
|
|
|
CORE_ADDR caller_pc,
|
|
|
|
CORE_ADDR callee_pc);
|
|
|
|
|
2005-07-12 15:06:54 +02:00
|
|
|
#endif /* dwarf2loc.h */
|