Commit Graph

255 Commits

Author SHA1 Message Date
Yao Qi ccce17b060 gdb/
* dwarf2loc.c (entry_values_debug): Add 'unsigned'.
	(_initialize_dwarf2loc): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* dwarf2loc.h: Update the declaration of 'entry_values_debug'.
	* dwarf2read.c (dwarf2_die_debug): Add 'unsigned'.
	(_initialize_dwarf2_read): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.
	* darwin-nat.c (dwarwin_debug_flag): Add 'unsigned'.
	(_initialize_darwin_inferior): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.
	* frame.c (frame_debug): Add 'unsigned'.
	(_intialize_frame): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* frame.h: Update the declaration of 'frame_debug'.
	* gdbtypes.c (overload_debug): Add 'unsigned'.
	(_initialize_gdbtypes): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* inferior.h: Update declaration of 'debug_infrun'.
	* infrun.c (debug_infrun): Add 'unsigned'.
	(_initialize_infrun): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* jit.c (jit_debug): Add 'unsigned'.
	(_initialize_jit): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* linux-nat.c (debug_linux_nat): Add 'unsigned'.
	(_initialize_linux_nat): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.
	* linux-thread-db.c (libthread_db_debug): Add 'unsigned'.
	(_initialize_thread_db): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* machoread.c (mach_o_debug_level): Add 'unsigned'.
	(_initialize_machoread): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.
	* mi/mi-cmd-var.c: Update the declaration of 'varobjdebug'.
	* microblaze-tdep.c (microblaze_debug_flag): Add 'unsigned'.
	(_initialize_microblaze_tdep): Call add_setshow_zuinteger_cmd
	intead of add_setshow_zinteger_cmd.
	* mips-tdep.c (mips_debug): Add 'unsigned'.
	(_initialize_mips_tdep): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.
	* monitor.c (monitor_debug): Add 'unsigned'.
	(_initialize_remote_monitors): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* observer.c (observer_debug): Add 'unsigned'.
	(_initialize_observer): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* parse.c (expressiondebug): Add 'unsigned'.
	(_initialize_parse): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* record.c (record_debug): Add 'unsigned'.
	(_initialize_record): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* record.h: Update the declaration of 'record_debug'.
	* stap-probe.c (stap_expression_debug): Add 'unsigned'.
	(_initialize_stap_probe): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* serial.c (global_serial_debug_p): Add 'unsigned'.
	(_initialize_serial): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* solib-dsbt.c (solib_dsbt_debug): Add 'unsigned'.
	(_initialize_dsbt_solib): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* solib-frv.c (solib_frv_debug): Add 'unsigned'.
	(_initialize_frv_solib): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* target.c (targetdebug): Add 'unsigned'.
	(initialize_targets): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* valops.c (overload_debug): Add 'unsigned'.
	* varobj.c (varobjdebug): Add 'unsigned'.
	(_initialize_varobj): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* xtensa-tdep.c (xtensa_debug_level): Add 'unsigned'.
	(_initialize_xtensa_tdep): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.

	* arch-utils.h: Remove the declaration of 'gdbarch_debug'.
	* gdbarch.sh (gdbarch_debug): Add 'unsigned'.
	(extern void _initialize_gdbarch): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.
	* gdbarch.c, gdbarch.h: Re-generated.
2012-08-02 09:36:40 +00:00
Tristan Gingold a55c1f3223 2012-07-26 Tristan Gingold <gingold@adacore.com>
* dwarf2loc.c (locexpr_describe_location_piece): Use uint64_t for
	offset.
2012-07-26 08:47:14 +00:00
Siddhesh Poyarekar 56eb65bdc1 * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Expand parameter
SIZE to size_t.
	(dwarf2_evaluate_loc_desc): Likewise.
	(dwarf2_loc_desc_needs_frame): Likewise.
	(locexpr_describe_location_1): Likewise.
	* dwarf2loc.h (struct dwarf2_locexpr_baton): Make SIZE as
	size_t.
	(struct dwarf2_loclist_baton): Likewise.
	* dwarf2read.c (struct dwarf_block): Likewise.
	(dump_die_shallow): Use pulongest to print dwarf_block.size.
	(decode_locdesc): Expand SIZE and I to size_t.
2012-07-26 02:03:16 +00:00
Jan Kratochvil a24f71abb4 gdb/
* dwarf2loc.c (disassemble_dwarf_expression): Handle
	DW_OP_GNU_parameter_ref.
2012-07-13 20:15:50 +00:00
Doug Evans 49f6c8397d * dwarf2expr.c (execute_stack_op): Handle DW_OP_GNU_const_index.
Adjust address for DW_OP_GNU_addr_index.
	* dwarf2expr.h (dwarf_expr_context): Update comment.
	* dwarf2loc.c (locexpr_describe_location_piece): New arg per_cu,
	all callers updated.  Handle TLS vars described with
	DW_OP_GNU_const_index.
	(disassemble_dwarf_expression): Handle DW_OP_GNU_addr_index
	and DW_OP_GNU_const_index.
	* dwarf2read.c (decode_locdesc): Handle DW_OP_GNU_addr_index.
2012-06-19 00:37:18 +00:00
Jan Kratochvil 1788b2d3be gdb/
* dwarf2expr.c (execute_stack_op): Support DW_OP_GNU_parameter_ref.
	* dwarf2loc.c (call_site_parameter_matches): Support
	CALL_SITE_PARAMETER_PARAM_OFFSET.
	(needs_dwarf_reg_entry_value): Push stub value.
	* dwarf2read.c (read_call_site_scope): New variable origin.  Support
	CALL_SITE_PARAMETER_PARAM_OFFSET and its DW_AT_abstract_origin.
	* gdbtypes.h (enum call_site_parameter_kind): New item
	CALL_SITE_PARAMETER_PARAM_OFFSET.
	(struct call_site.parameter.u): New field param_offset.

gdb/testsuite/
	* gdb.arch/amd64-entry-value-param.S: New file.
	* gdb.arch/amd64-entry-value-param.c: New file.
	* gdb.arch/amd64-entry-value-param.exp: New file.
2012-06-17 19:53:52 +00:00
Jan Kratochvil 24c5c679cb gdb/
Code cleanup: Generalize call_site.parameter key.
	* dwarf2expr.c (execute_stack_op) <DW_OP_GNU_entry_value>: Remove
	variable dwarf_reg.  New variable kind_u.  Update parameters to
	push_dwarf_reg_entry_value.
	(ctx_no_push_dwarf_reg_entry_value): Update parameters.
	* dwarf2expr.h (enum call_site_parameter_kind)
	(union call_site_parameter_u): Forward declarations.
	(struct dwarf_expr_context_funcs): Update parameters and their
	description for push_dwarf_reg_entry_value.
	(ctx_no_push_dwarf_reg_entry_value): Update parameters.
	* dwarf2loc.c (call_site_parameter_matches): New function.
	(dwarf_expr_reg_to_entry_parameter): Update parameters and their
	description.  Use call_site_parameter_matches.
	(dwarf_expr_push_dwarf_reg_entry_value, value_of_dwarf_reg_entry):
	Update parameters and their description.
	(value_of_dwarf_block_entry): Remove variables dwarf_reg and fb_offset.
	New variable kind_u.  Adjust the caller for updated parameters.
	(needs_dwarf_reg_entry_value): Update parameters.
	* dwarf2read.c (read_call_site_scope): New variable loc.  Use it
	instead of attr.  Update for the changed fields of struct
	call_site_parameter.
	* gdbtypes.h: Include dwarf2expr.h.
	(enum call_site_parameter_kind): New.
	(struct call_site.parameter): New field kind.  Wrap dwarf_reg and
	fb_offset into new union u.
2012-06-17 19:50:53 +00:00
Doug Evans 3771a44cf0 * dwarf2loc.c (debug_loc_kind): Add DEBUG_LOC_START_LENGTH.
(DEBUG_LOC_START_END): Renamed from DEBUG_LOC_NORMAL.
	All uses updated.
	(decode_debug_loc_dwo_addresses): New arg "byte_order".  All callers
	updated.  Handle DEBUG_LOC_START_LENGTH.
	(dwarf2_find_location_expression): Handle DEBUG_LOC_START_LENGTH.
	(loclist_describe_location): Ditto.
2012-06-14 22:56:47 +00:00
Doug Evans 9fccedf760 * dwarf2-frame.c (execute_cfa_program): Update to handle long long ->
int64_t change to leb128 API.
	(read_encoded_value, decode_frame_entry_1): Ditto.
	* dwarf2expr.c (safe_read_uleb128, safe_read_sleb128): Ditto.
	(dwarf_block_to_dwarf_reg, dwarf_block_to_dwarf_reg_deref): Ditto.
	(dwarf_block_to_fb_offset, dwarf_block_to_sp_offset): Ditto.
	(execute_stack_op): Ditto.
	* dwarf2expr.h (gdb_read_uleb128, gdb_read_sleb128): Ditto.
	(safe_read_uleb128, safe_read_sleb128): Ditto.
	* dwarf2loc.c (decode_debug_loc_dwo_addresses): Ditto.
	(dwarf2_compile_expr_to_ax): Ditto.
	(locexpr_describe_location_piece): Ditto.
	(disassemble_dwarf_expression): Ditto.
	(locexpr_describe_location_1): Ditto.
2012-05-24 01:26:15 +00:00
Doug Evans f664829eae * dwarf2-frame.c (struct dwarf2_cie): Make initial_instructions, end
"const gdb_byte *".
	(struct dwarf2_fde): Make instructions, end "const gdb_byte *".
	(execute_cfa_program): Update to match API of leb128 functions.
	(read_1_byte, read_4_bytes, read_8_bytes): Make buf parameter
	"const gdb_byte *".
	(read_unsigned_leb128, read_signed_leb128): Delete.
	(read_initial_length): Change type of buf argument to
	"const gdb_byte *".
	(read_encoded_value): Update to match API of leb128 functions.
	(decode_frame_entry): Change result to "const gdb_byte *", and
	similarly for "start" parameter.
	(decode_frame_entry_1): Ditto.  Use new leb128 reader functions.
	(dwarf2_build_frame_info): Change local frame_ptr to
	"const gdb_byte *".
	* dwarf2expr.c (safe_read_uleb128, safe_read_sleb128): Replaces
	read_uleb128, read_sleb128.  All callers updated.
	(safe_skip_leb128): New function.
	(dwarf_block_to_dwarf_reg): Update to match API of leb128 functions.
	Call gdb_read_uleb128, gdb_skip_leb128 instead of read_uleb128.
	(dwarf_block_to_dwarf_reg_deref): Update to match API of leb128
	functions.  Call gdb_read_uleb128, gdb_read_sleb128 instead of
	read_uleb128, read_sleb128.
	(dwarf_block_to_fb_offset, dwarf_block_to_sp_offset): Ditto.
	(execute_stack_op): Update to match API of leb128 functions.
	* dwarf2expr.h: #include "leb128.h".
	(read_uleb128, read_sleb128): Delete.
	(gdb_read_uleb128, gdb_read_sleb128, gdb_skip_leb128): New functions.
	(safe_read_uleb128, safe_read_sleb128, safe_skip_leb128): Declare.
	* dwarf2loc.c (debug_loc_kind): New enum.
	(decode_debug_loc_addresses): New function.
	(decode_debug_loc_dwo_addresses): New function.
	(dwarf2_find_location_expression): Rewrite.
	(dwarf2_compile_expr_to_ax): Update to match API of leb128 functions.
	(locexpr_describe_location_piece): Ditto.
	(disassemble_dwarf_expression): Ditto.
	(locexpr_describe_location_1): Ditto.
	(loclist_describe_location): Rewrite.
	* dwarf2loc.h (dwarf2_loclist_baton): New member "from_dwo".
	* dwarf2read.c (die_reader_specs): New member "buffer_end".
	(dwarf2_section_buffer_overflow_complaint): Renamed from
	dwarf2_macros_too_long_complaint.  All callers updated.
	(skip_leb128): Delete.
	(init_cu_die_reader): Initialize reader->buffer_end.
	(skip_one_die): Replace call to skip_leb128 with safe_skip_leb128.
	(skip_form_bytes): New arg buffer_end.  All callers updated.
	Replace call to skip_leb128 with gdb_skip_leb128.
	(skip_unknown_opcode): New arg mac_end.  All callers updated.
	(fill_in_loclist_baton): Initialize baton->from_dwo.
2012-05-22 18:45:22 +00:00
Sergio Durigan Junior 22e048c9dd 2012-05-18 Sergio Durigan Junior <sergiodj@redhat.com>
* ada-lang.c:
	* ada-tasks.c:
	* ada-varobj.c:
	* amd64-darwin-tdep.c:
	* arm-symbian-tdep.c:
	* arm-tdep.c:
	* avr-tdep.c:
	* ax-gdb.c:
	* bfin-linux-tdep.c:
	* breakpoint.c:
	* c-valprint.c:
	* cli/cli-cmds.c:
	* coffread.c:
	* cp-support.c:
	* cris-tdep.c:
	* dwarf2-frame-tailcall.c:
	* dwarf2-frame.c:
	* dwarf2expr.c:
	* dwarf2loc.c:
	* dwarf2read.c:
	* elfread.c:
	* eval.c:
	* expprint.c:
	* f-valprint.c:
	* frv-tdep.c:
	* h8300-tdep.c:
	* hppa-hpux-tdep.c:
	* hppa-tdep.c:
	* hppanbsd-tdep.c:
	* i386-nto-tdep.c:
	* i386-tdep.c:
	* i387-tdep.c:
	* ia64-tdep.c:
	* jit.c:
	* linespec.c:
	* linux-tdep.c:
	* lm32-tdep.c:
	* m2-valprint.c:
	* m32c-tdep.c:
	* m32r-rom.c:
	* m32r-tdep.c:
	* m68k-tdep.c:
	* m68klinux-tdep.c:
	* mi/mi-main.c:
	* microblaze-tdep.c:
	* mips-linux-tdep.c:
	* mips-tdep.c:
	* mn10300-tdep.c:
	* p-valprint.c:
	* parse.c:
	* ppc-linux-tdep.c:
	* ppc-sysv-tdep.c:
	* printcmd.c:
	* python/py-finishbreakpoint.c:
	* python/py-inferior.c:
	* python/py-infthread.c:
	* python/py-type.c:
	* python/python.c:
	* remote-fileio.c:
	* remote-m32r-sdi.c:
	* remote-mips.c:
	* reverse.c:
	* rl78-tdep.c:
	* rs6000-aix-tdep.c:
	* rs6000-tdep.c:
	* s390-tdep.c:
	* score-tdep.c:
	* sh64-tdep.c:
	* skip.c:
	* solib-darwin.c:
	* solib-dsbt.c:
	* solib-frv.c:
	* sparc-tdep.c:
	* spu-multiarch.c:
	* spu-tdep.c:
	* stack.c:
	* symfile.c:
	* symtab.c:
	* tic6x-tdep.c:
	* tracepoint.c:
	* v850-tdep.c:
	* valarith.c:
	* valprint.c:
	* value.c:
	* xcoffread.c:
	* xtensa-tdep.c:
	* ada-lang.c:
	* ada-tasks.c:
	* ada-varobj.c:
	* amd64-darwin-tdep.c:
	* arm-symbian-tdep.c:
	* arm-tdep.c: Delete unused variables.
2012-05-18 21:02:52 +00:00
Tom Tromey f39c6ffde7 * dwarf2read.c (dwarf_tag_name): Return const char *. Use
get_DW_TAG_name.
	(dwarf_attr_name): Return const char *.  Use get_DW_AT_name.
	(dwarf_form_name): Return const char *.  Use get_DW_FORM_name.
	(dwarf_stack_op_name): Remove.
	(dwarf_cfi_name): Return const char *.  Use get_DW_ATE_name.
	(decode_locdesc): Use get_DW_OP_name.
	* dwarf2loc.c (unimplemented): Use get_DW_OP_name.
	(dwarf2_compile_expr_to_ax): Likewise.
	(disassemble_dwarf_expression): Likewise.
	* dwarf2expr.h: (dwarf_stack_op_name): Remove.
2012-05-07 15:18:38 +00:00
Doug Evans 3019eac3a2 Initial support for Fission. http://gcc.gnu.org/wiki/DebugFission
* symfile.c (default_symfile_relocate): Use sectp->owner instead of
	objfile->obfd.
	* symfile.h (dwarf2_debug_sections): New member addr.
	* dwarf2expr.c (execute_stack_op): New case DW_OP_GNU_addr_index.
	(ctx_no_get_addr_index): New function.
	* dwarf2expr.h (dwarf_expr_context_funcs): New member get_addr_index.
	(ctx_no_get_addr_index): Declare.
	* dwarf2-frame.c (dwarf2_frame_ctx_funcs): Update.
	* dwarf2loc.c (dwarf_expr_get_addr_index): New function.
	(dwarf_expr_ctx_funcs): Update.
	(needs_get_addr_index): New function.
	(needs_frame_ctx_funcs): Update.
	* dwarf2loc.h (dwarf2_read_addr_index): Declare.
	* dwarf2read.c: #include "gdbcore.h".
	(dwarf2_per_objfile): New members addr, dwo_files.
	(dwarf2_elf_names): Add entry for addr.
	(struct dwo_section_names): New type.
	(dwo_section_names): New static global.
	(dwarf2_cu): New members dwo_unit, addr_base, have_addr_base.
	(dwarf2_per_cu_data): New member is_debug_types, all boolean uses of
	old debug_types_section member updated to use this.
	Rename member debug_types_section to info_or_types_section,
	all uses updated.
	(signatured_type): Rename member type_offset to type_offset_in_tu,
	all uses updated.  New member type_offset_in_section.
	(struct dwo_sections): New type.
	(struct dwo_unit): New type.
	(struct dwo_file): New type.
	(die_reader_specs): New member dwo_file.
	(dwarf2_locate_sections): Watch for .debug_addr.
	(zlib_decompress_section): Use sectp->owner instead of objfile->obfd.
	(dwarf2_read_section): Get bfd of section from bfd's asection,
	instead of objfile.
	(create_cus_from_index): Initialize the_cu->info_or_types_section.
	(create_signatured_type_table_from_index): Initialize
	sig_type->info_or_types_section.
	(dw2_get_file_names): Statement lists for type units with DWO files
	live in the DWO file.
	(create_debug_types_hash_table): New function.
	(create_all_type_units): Rewrite.
	(init_cu_die_reader): New arg dwo_file, all callers updated.
	(init_and_read_dies_worker): Get section from
	this_cu->info_or_types_section.  Set sig_type->type_offset_in_section.
	Watch for DW_AT_GNU_dwo_name and if present lookup the file and
	continue reading the CU/TU from there.
	(init_cutu_and_read_dies_no_follow): New arg dwo_file, all callers
	updated.  Get section from this_cu->info_or_types_section.
	(create_all_comp_units): Initialize this_cu->info_or_types_section.
	(skip_one_die): New cases DW_FORM_GNU_addr_index,
	DW_FORM_GNU_str_index.
	(hash_dwo_file, eq_dwo_file): New functions.
	(allocate_dwo_file_hash_table): New function.
	(hash_dwo_unit, eq_dwo_unit): New functions.
	(allocate_dwo_unit_table): New function.
	(dwarf2_locate_dwo_sections): New function.
	(struct create_dwo_info_table_data): New type.
	(create_debug_info_hash_table_reader): New function.
	(create_debug_info_hash_table): New function.
	(try_open_dwo_file, open_dwo_file, init_dwo_file): New function.
	(lookup_dwo_file): New function.
	(lookup_dwo_comp_unit, lookup_dwo_type_unit): New functions.
	(free_dwo_file, free_dwo_file_cleanup): New functions.
	(free_dwo_file_from_slot, free_dwo_files): New functions.
	(dwarf2_get_pc_bounds): Handle DW_FORM_GNU_addr_index.
	(dwarf2_record_block_ranges): Ditto.
	(read_partial_die): Ditto.
	(process_enumeration_scope): Update to use type_offset_in_section.
	(read_full_die_1): New function.
	(read_full_die): Rewrite.
	(read_attribute_value): New cases DW_FORM_GNU_addr_index,
	DW_FORM_GNU_str_index.
	(read_addr_index_1, read_addr_index): New functions.
	(read_addr_index_from_leb128): New function.
	(struct dwarf2_read_addr_index_data): New type.
	(dwarf2_read_addr_index_reader): New function.
	(dwarf2_read_addr_index): New function.
	(read_str_index): New function.
	(leb128_size): New function.
	(dwarf_decode_line_header): Delete arg abfd, all callers updated.
	If processing a type unit from a DWO file, get the line section
	from the DWO file.
	(var_decode_location): Watch for DW_OP_GNU_addr_index.
	(dwarf2_const_value_attr): New cases DW_FORM_GNU_addr_index,
	DW_FORM_GNU_str_index.
	(lookup_die_type): Check whether section offset of type's die is
	known before looking it up.  Remove assert.  Condition can
	legimately happen for inter-cu type references.
	(dwarf_attr_name): Handle Fission attributes.
	(dwarf_form_name): Handle Fission forms.
	(dump_die_shallow): New cases DW_FORM_GNU_addr_index,
	DW_FORM_GNU_str_index.
	(follow_die_sig): Update to use type_offset_in_section.
	(decode_locdesc): New case DW_OP_GNU_addr_index.
	(skip_form_bytes): New cases DW_FORM_GNU_addr_index,
	DW_FORM_GNU_str_index.
	(cu_debug_loc_section): New function.
	(fill_in_loclist_baton, dwarf2_symbol_mark_computed): Call it.
	(dwarf2_per_objfile_free): Unmap .debug_addr section.
	Free DWO files if present.
	* xcoffread.c (dwarf2_xcoff_names): Add .debug_addr.

	testsuite/
	* gdb.dwarf2/dw2-intercu.S (.Ltype_int2_in_cu2): Renamed from
	.Ltype_int_in_cu2.  Use name "int2" instead of "int".
	All uses updated.
	* gdb.dwarf2/dw2-intercu.exp: Add "ptype int2" ahead of
	"ptype func_cu1" to expand cu2 before cu1.
2012-04-28 23:22:14 +00:00
Jan Kratochvil b64f50a1ae 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 19:59:19 +00:00
Yao Qi fa3064dd8a gdb:
* inferior.h (struct inferior): Remove fields any_syscall_count,
	syscalls_counts and total_syscalls_count.  Move them to new
	struct catch_syscall_inferior_data in breakpoint.c.
	* breakpoint.c: Call DEF_VEC_I(int).
	(struct catch_syscall_inferior_data): New.
	(get_catch_syscall_inferior_data): New.
	(catch_syscall_inferior_data_cleanup): New.
	(insert_catch_syscall): Update to access data in
	struct catch_syscall_inferior_data.
	(insert_catch_syscall): Likewise.
	(remove_catch_syscall): Likewise.
	(remove_catch_syscall): Likewise.
	(is_syscall_catchpoint_enabled): Likewise.
	(add_catch_command): Likewise.
	(_initialize_breakpoint): Register cleanup.
	* breakpoint.h: Removed DEF_VEC_I(int).
	* dwarf2loc.c: Call DEF_VEC_I(int).
	* mi/mi-main.c: Likewise.
2012-03-13 01:16:07 +00:00
Pedro Alves 70221824e3 2012-03-01 Pedro Alves <palves@redhat.com>
* amd64-linux-tdep.c (amd64_linux_record_signal): Make static.
	* breakpoint.c (create_exception_master_breakpoint, trace_command)
	(ftrace_command, strace_command): Make static.
	* d-lang.c (_initialize_d_language): Declare.
	* dwarf2expr.c (_initialize_dwarf2expr): Declare.
	* dwarf2loc.c (_initialize_dwarf2loc):
	* dwarf2read.c (process_psymtab_comp_unit): Make static.
	* exec.c (exec_get_section_table): Make static.
	* i386-linux-tdep.c (i386_linux_record_signal): Make static.
	* infcmd.c (ensure_valid_thread, ensure_not_tfind_mode): Make static.
	* inferior.c (remove_inferior_command, add_inferior_command)
	(clone_inferior_command): Make static.
	* linux-nat.c (linux_nat_thread_address_space)
	(linux_nat_core_of_thread): Make static.
	* linux-tdep.c (_initialize_linux_tdep): Declare.
	* objc-lang.c (_initialize_objc_lang): Declare.
	* opencl-lang.c (builtin_opencl_type, opencl_language_arch_info):
	Make static.
	(_initialize_opencl_language): Declare.
	* record.c (_initialize_record): Declare.
	* remote.c (demand_private_info, remote_get_tib_address)
	(remote_supports_cond_tracepoints)
	(remote_supports_fast_tracepoints, remote_get_tracepoint_status):
	Make static.
	* skip.c (_initialize_step_skip): Declare.
	* symtab.c (skip_prologue_using_lineinfo): Make static.
	* tracepoint.c (delete_trace_state_variable)
	(trace_variable_command, delete_trace_variable_command)
	(get_uploaded_tsv, find_matching_tracepoint_location)
	(find_matching_tsv, create_tsv_from_upload, get_traceframe_info):
	Make static.
	* value.c (pack_unsigned_long): Make static.
	* varobj.c (varobj_ensure_python_env): Make static.
	* windows-tdep.c (_initialize_windows_tdep): Declare.
	* xml-syscall.c (make_cleanup_free_syscalls_info): Make static.
2012-03-01 21:14:00 +00:00
Joel Brobecker 0b30217134 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:17:56 +00:00
Tom Tromey f8eba3c616 the "ambiguous linespec" series
gdb
2011-12-06  Joel Brobecker  <brobecker@acacore.com>

        * language.h (struct language_defn): Add new component
        la_symbol_name_compare.
        * symfile.h (struct quick_symbol_functions): Update the profile
        of parameter "name_matcher" for the expand_symtabs_matching
        method.  Update the documentation accordingly.
        * ada-lang.h (ada_name_for_lookup): Add declaration.
        * ada-lang.c (ada_name_for_lookup): New function, extracted out
        from ada_iterate_over_symbols.
        (ada_iterate_over_symbols): Do not encode symbol name anymore.
        (ada_expand_partial_symbol_name): Adjust profile.
        (ada_language_defn): Add value for la_symbol_name_compare field.
        * linespec.c: #include "ada-lang.h".
        (iterate_name_matcher): Add language parameter. Replace call
        to strcmp_iw by call to language->la_symbol_name_compare.
        (decode_variable): Encode COPY if current language is Ada.
        * dwarf2read.c (dw2_expand_symtabs_matching): Adjust profile
        of name_matcher parameter.  Adjust call to name_matcher.
        * psymtab.c (expand_symtabs_matching_via_partial): Likewise.
        (expand_partial_symbol_names): Update profile of parameter "fun".
        * psymtab.h (expand_partial_symbol_names): Update profile of
        parameter "fun".
        * symtab.c (demangle_for_lookup): Update function documentation.
        (search_symbols_name_matches): Add language parameter.
        (expand_partial_symbol_name): Likewise.
        * c-lang.c (c_language_defn, cplus_language_defn)
        (asm_language_defn, minimal_language_defn): Add value for
        la_symbol_name_compare field.
        * d-lang.c (d_language_defn): Likewise.
        * f-lang.c (f_language_defn): Ditto.
        * jv-lang.c (java_language_defn): Ditto.
        * m2-lang.c (m2_language_defn): Ditto.
        * objc-lang.c (objc_language_defn): Ditto.
        * opencl-lang.c (opencl_language_defn): Ditto.
        * p-lang.c (pascal_language_defn): Ditto.
        * language.c (unknown_language_defn, auto_language_defn)
        (local_language_defn): Ditto.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* linespec.c (iterate_over_all_matching_symtabs): Use
	LA_ITERATE_OVER_SYMBOLS.
	(lookup_prefix_sym, add_matching_symbols_to_info): Likewise.
	(find_function_symbols, decode_variable): Remove Ada special
	case.
	* language.h (struct language_defn) <la_iterate_over_symbols>: New
	field.
	(LA_ITERATE_OVER_SYMBOLS): New macro.
	* language.c (unknown_language_defn, auto_language_defn)
	(local_language_defn): Update.
	* c-lang.c (c_language_defn, cplus_language_defn)
	(asm_language_defn, minimal_language_defn): Update.
	* d-lang.c (d_language_defn): Update.
	* f-lang.c (f_language_defn): Update.
	* jv-lang.c (java_language_defn): Update.
	* m2-lang.c (m2_language_defn): Update.
	* objc-lang.c (objc_language_defn): Update.
	* opencl-lang.c (opencl_language_defn): Update.
	* p-lang.c (pascal_language_defn): Update.
	* ada-lang.c (ada_iterate_over_symbols): New function.
	(ada_language_defn): Update.

2011-12-06  Tom Tromey  <tromey@redhat.com>
	    Joel Brobecker  <brobecker@acacore.com>

	PR breakpoints/13105, PR objc/8341, PR objc/8343, PR objc/8366,
	PR objc/8535, PR breakpoints/11657, PR breakpoints/11970,
	PR breakpoints/12023, PR breakpoints/12334, PR breakpoints/12856,
	PR shlibs/8929, PR shlibs/7393:
	* python/py-type.c (compare_maybe_null_strings): Rename from
	compare_strings.
	(check_types_equal): Update.
	* utils.c (compare_strings): New function.
	* tui/tui-winsource.c (tui_update_breakpoint_info): Update for
	location changes.
	* tracepoint.c (scope_info): Update.
	(trace_find_line_command): Use DECODE_LINE_FUNFIRSTLINE.
	* symtab.h (iterate_over_minimal_symbols)
	(iterate_over_some_symtabs, iterate_over_symtabs)
	(find_pcs_for_symtab_line, iterate_over_symbols)
	(demangle_for_lookup): Declare.
	(expand_line_sal): Remove.
	* symtab.c (iterate_over_some_symtabs, iterate_over_symtabs)
	(lookup_symtab_callback): New functions.
	(lookup_symtab): Rewrite.
	(demangle_for_lookup): New function, extract from
	lookup_symbol_in_language.
	(lookup_symbol_in_language): Use it.
	(iterate_over_symbols): New function.
	(find_line_symtab): Update.
	(find_pcs_for_symtab_line): New functions.
	(find_line_common): Add 'start' argument.
	(decode_line_spec): Update.  Change argument to 'flags', change
	interpretation.
	(append_expanded_sal): Remove.
	(append_exact_match_to_sals): Remove.
	(expand_line_sal): Remove.
	* symfile.h (struct quick_symbol_functions) <lookup_symtab>:
	Remove.
	<map_symtabs_matching_filename>: New field.
	* stack.c (func_command): Only look in the current program space.
	Use DECODE_LINE_FUNFIRSTLINE.
	* source.c (line_info): Set pspace on sal.  Check program space in
	the loop.  Use DECODE_LINE_LIST_MODE.
	(select_source_symtab): Use DECODE_LINE_FUNFIRSTLINE.
	* solib-target.c: Remove DEF_VEC_I(CORE_ADDR).
	* python/python.c (gdbpy_decode_line): Update.
	* psymtab.c (partial_map_expand_apply): New function.
	(partial_map_symtabs_matching_filename): Rename from
	lookup_partial_symbol.  Update arguments.
	(lookup_symtab_via_partial_symtab): Remove.
	(psym_functions): Update.
	* objc-lang.h (parse_selector, parse_method): Don't declare.
	(find_imps): Update.
	* objc-lang.c (parse_selector, parse_method): Now static.
	(find_methods): Change arguments.  Fill in a vector of symbol
	names.
	(uniquify_strings): New function.
	(find_imps): Change arguments.
	* minsyms.c (iterate_over_minimal_symbols): New function.
	* linespec.h (enum decode_line_flags): New.
	(struct linespec_sals): New.
	(struct linespec_result) <canonical>: Remove.
	<pre_expanded, addr_string, sals>: New fields.
	(destroy_linespec_result, make_cleanup_destroy_linespec_result)
	(decode_line_full): Declare.
	(decode_line_1): Update.
	* linespec.c (struct address_entry, struct linespec_state, struct
	collect_info): New types.
	(add_sal_to_sals_basic, add_sal_to_sals, hash_address_entry)
	(eq_address_entry, maybe_add_address): New functions.
	(total_number_of_methods): Remove.
	(iterate_name_matcher, iterate_over_all_matching_symtabs): New
	functions.
	(find_methods): Change arguments.  Don't canonicalize input.
	Simplify logic.
	(add_matching_methods, add_constructors)
	(build_canonical_line_spec): Remove.
	(filter_results, convert_results_to_lsals): New functions.
	(decode_line_2): Change arguments.  Rewrite for new data
	structures.
	(decode_line_internal): Rename from decode_line_1.  Change
	arguments.  Add cleanups.  Update for new data structures.
	(linespec_state_constructor, linespec_state_destructor)
	(decode_line_full, decode_line_1): New functions.
	(decode_indirect): Change arguments.  Update.
	(locate_first_half): Use skip_spaces.
	(decode_objc): Change arguments.  Update for new data structures.
	Simplify logic.
	(decode_compound): Change arguments.  Add cleanups.  Remove
	fallback code, replace with error.
	(struct decode_compound_collector): New type.
	(collect_one_symbol): New function.
	(lookup_prefix_sym): Change arguments.  Update.
	(compare_symbol_name, add_all_symbol_names_from_pspace)
	(find_superclass_methods ): New functions.
	(find_method): Rewrite.
	(struct symtab_collector): New type.
	(add_symtabs_to_list, collect_symtabs_from_filename): New
	functions.
	(symtabs_from_filename): Change API.  Rename from
	symtab_from_filename.
	(collect_function_symbols): New function.
	(find_function_symbols): Change API.  Rename from
	find_function_symbol.  Rewrite.
	(decode_all_digits): Change arguments.  Rewrite.
	(decode_dollar): Change arguments.  Use decode_variable.
	(decode_label): Change arguments.  Rewrite.
	(collect_symbols): New function.
	(minsym_found): Change arguments.  Rewrite.
	(check_minsym, search_minsyms_for_name)
	(add_matching_symbols_to_info): New function.
	(decode_variable): Change arguments.  Iterate over all symbols.
	(symbol_found): Remove.
	(symbol_to_sal): New function.
	(init_linespec_result, destroy_linespec_result)
	(cleanup_linespec_result, make_cleanup_destroy_linespec_result):
	New functions.
	(decode_digits_list_mode, decode_digits_ordinary): New functions.
	* dwarf2read.c (dw2_map_expand_apply): New function.
	(dw2_map_symtabs_matching_filename): Rename from
	dw2_lookup_symtab.  Change arguments.
	(dwarf2_gdb_index_functions): Update.
	* dwarf2loc.c: Remove DEF_VEC_I(CORE_ADDR).
	* defs.h (compare_strings): Declare.
	* cli/cli-cmds.c (compare_strings): Move to utils.c.
	(edit_command, list_command): Use DECODE_LINE_LIST_MODE.  Call
	filter_sals.
	(compare_symtabs, filter_sals): New functions.
	* breakpoint.h (struct bp_location) <line_number, source_file>:
	New fields.
	(struct breakpoint) <line_number, source_file>: Remove.
	<filter>: New field.
	* breakpoint.c (print_breakpoint_location, init_raw_breakpoint)
	(momentary_breakpoint_from_master, add_location_to_breakpoint):
	Update for changes to locations.
	(init_breakpoint_sal): Add 'filter' argument.  Set 'filter' on
	breakpoint.
	(create_breakpoint_sal): Add 'filter' argument.
	(remove_sal, expand_line_sal_maybe): Remove.
	(create_breakpoints_sal): Remove 'sals' argument.  Handle
	pre-expanded sals and the filter.
	(parse_breakpoint_sals): Use decode_line_full.
	(check_fast_tracepoint_sals): Use get_sal_arch.
	(create_breakpoint): Create a linespec_sals.  Update.
	(break_range_command): Use decode_line_full.  Update.
	(until_break_command): Update.
	(clear_command): Update match conditions for linespec.c changes.
	Use DECODE_LINE_LIST_MODE.
	(say_where): Update for changes to locations.
	(bp_location_dtor): Free 'source_file'.
	(base_breakpoint_dtor): Free 'filter'.  Don't free 'source_file'.
	(update_static_tracepoint): Update for changes to locations.
	(update_breakpoint_locations): Disable ranged breakpoint if too
	many locations match.  Update.
	(addr_string_to_sals): Use decode_line_full.  Resolve all sal
	PCs.
	(breakpoint_re_set_default): Don't call expand_line_sal_maybe.
	(decode_line_spec_1): Update.  Change argument name to 'flags',
	change interpretation.
	* block.h (block_containing_function): Declare.
	* block.c (block_containing_function): New function.
	* skip.c (skip_function_command): Update.
	(skip_re_set): Update.
	* infcmd.c (jump_command): Use DECODE_LINE_FUNFIRSTLINE.
	* mi/mi-main.c (mi_cmd_trace_find): Use DECODE_LINE_FUNFIRSTLINE.
	* NEWS: Add entry.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* elfread.c (elf_gnu_ifunc_resolver_return_stop): Allow
	breakpoint's pspace to be NULL.
	* breakpoint.h (struct breakpoint) <pspace>: Update comment.
	* breakpoint.c (init_raw_breakpoint): Conditionally set
	breakpoint's pspace.
	(init_breakpoint_sal): Don't set breakpoint's pspace.
	(prepare_re_set_context): Conditionally switch program space.
	(addr_string_to_sals): Check executing_startup on location's
	program space.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* breakpoint.h (enum enable_state) <bp_startup_disabled>: Remove.
	* breakpoint.c (should_be_inserted): Explicitly check if program
	space is executing startup.
	(describe_other_breakpoints): Update.
	(disable_breakpoints_before_startup): Change executing_startup
	earlier.  Remove loop.
	(enable_breakpoints_after_startup): Likewise.
	(init_breakpoint_sal): Don't use bp_startup_disabled.
	(create_breakpoint): Don't use bp_startup_disabled.
	(update_global_location_list): Use should_be_inserted.
	(bkpt_re_set): Update.
gdb/testsuite
2011-12-06  Joel Brobecker  <brobecker@acacore.com>

        * gdb.ada/fullname_bp.exp: Add tests for other valid linespecs
        involving a fully qualified function name.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* gdb.ada/homonym.exp: Add three breakpoint tests.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* gdb.base/solib-weak.exp (do_test): Remove kfail.
	* gdb.trace/tracecmd.exp: Disable pending breakpoints earlier.
	* gdb.objc/objcdecode.exp: Update for output changes.
	* gdb.linespec/linespec.exp: New file.
	* gdb.linespec/lspec.cc: New file.
	* gdb.linespec/lspec.h: New file.
	* gdb.linespec/body.h: New file.
	* gdb.linespec/base/two/thefile.cc: New file.
	* gdb.linespec/base/one/thefile.cc: New file.
	* gdb.linespec/Makefile.in: New file.
	* gdb.cp/templates.exp (test_template_breakpoints): Update for
	output changes.
	* gdb.cp/re-set-overloaded.exp: Remove kfail.
	* gdb.cp/ovldbreak.exp: Update for output changes.  "all" test now
	makes one breakpoint.
	* gdb.cp/method2.exp (test_break): Update for output changes.
	* gdb.cp/mb-templates.exp: Update for output changes.
	* gdb.cp/mb-inline.exp: Update for output changes.
	* gdb.cp/mb-ctor.exp: Update for output changes.
	* gdb.cp/ovsrch.exp: Use fully-qualified names.
	* gdb.base/solib-symbol.exp: Run to main later.  Breakpoint now
	has multiple matches.
	* gdb.base/sepdebug.exp: Disable pending breakpoints.  Update for
	error message change.
	* gdb.base/list.exp (test_list_filename_and_number): Update for
	error message change.
	* gdb.base/break.exp: Disable pending breakpoints.  Update for
	output changes.
	* configure.ac: Add gdb.linespec.
	* configure: Rebuild.
	* Makefile.in (ALL_SUBDIRS): Add gdb.linespec.
gdb/doc
2011-12-06  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (Set Breaks): Update for new behavior.
2011-12-06 18:54:43 +00:00
Jan Kratochvil 1d6edc3c37 gdb/
Fix empty DWARF expressions DATA vs. SIZE conditionals.
	* dwarf2loc.c (dwarf2_find_location_expression): Clear *LOCEXPR_LENGTH.
	(dwarf_expr_frame_base_1): Indicate unavailability via zero *LENGTH.
	(locexpr_tracepoint_var_ref): Check only zero SIZE, not zero DATA.
	(loclist_read_variable, loclist_tracepoint_var_ref): Do not check for
	zero DATA.
	* dwarf2loc.h (struct dwarf2_locexpr_baton): Comment DATA vs. SIZE
	validity.
	* dwarf2read.c (struct dwarf_block): Comment DATA validity.
	(dwarf2_fetch_die_location_block, dwarf2_symbol_mark_computed): Do not
	clear DATA on zero SIZE.

gdb/testsuite/
	Fix empty DWARF expressions DATA vs. SIZE conditionals.
	* gdb.dwarf2/dw2-op-call.S (arraycallnoloc, arraynoloc): New DIEs.
	(loclist): New.
	(4): New abbrev.
	* gdb.dwarf2/dw2-op-call.exp: Remove variable srcfile and executable.
	Use prepare_for_testing, remove clean_restart.
	(p arraynoloc, p arraycallnoloc): New tests.
2011-10-12 22:04:12 +00:00
Jan Kratochvil 509f0fd941 gdb/
Fix compatibility with older GCCs.
	* dwarf2loc.c (dwarf_expr_reg_to_entry_parameter): Initialize parameter.
	* stack.c (read_frame_arg): Initialize val_deref.
2011-10-09 20:57:03 +00:00
Jan Kratochvil 2bda9cc5ee gdb/
Entry values NEWS entries, DWARF disassembly support.
	* NEWS: New entry values entry.
	(set print entry-values, show print entry-values)
	(set debug entry-values, show debug entry-values): New entries.
	* dwarf2loc.c (disassemble_dwarf_expression): New parameters start and
	indent.  Remove variable start.  Move header printing out.  Respect
	INDENT.  Support DW_OP_GNU_entry_value.
	(locexpr_describe_location_1): Move the header printing here, extend
	the disassemble_dwarf_expression passed parameters.

gdb/testsuite/
	* gdb.arch/amd64-entry-value.s: New file.
	* gdb.mi/mi2-amd64-entry-value.s: New file.
2011-10-09 19:46:05 +00:00
Jan Kratochvil a471c5941e gdb/
Display @entry parameter values even for references.
	* ada-valprint.c (ada_val_print_1) <TYPE_CODE_REF>: Try also
	coerce_ref_if_computed.
	* c-valprint.c (c_val_print) <TYPE_CODE_REF>: Likewise.
	* dwarf2expr.c (dwarf_block_to_dwarf_reg_deref): New function.
	(execute_stack_op) <DW_OP_GNU_entry_value>: Add -1 deref_size to the
	existing push_dwarf_reg_entry_value call.  Add new detection calling
	dwarf_block_to_dwarf_reg_deref.  Update the error message.
	(ctx_no_push_dwarf_reg_entry_value): New parameter deref_size.
	* dwarf2expr.h
	(struct dwarf_expr_context_funcs) <push_dwarf_reg_entry_value>: Add new
	parameter deref_size, describe it in the comment.
	(ctx_no_push_dwarf_reg_entry_value): Add new parameter deref_size.
	(dwarf_block_to_dwarf_reg_deref): New declaration.
	* dwarf2loc.c (dwarf_entry_parameter_to_value): Add new parameter
	deref_size, describe it in the function comment.  New variables
	data_src and size, fetch the alternative block accoring to DEREF_SIZE.
	(dwarf_expr_push_dwarf_reg_entry_value): Add new parameter deref_size,
	describe it in the function comment.  Fetch the alternative block
	accoring to DEREF_SIZE.
	(entry_data_value_coerce_ref, entry_data_value_copy_closure)
	(entry_data_value_free_closure, entry_data_value_funcs): New.
	(value_of_dwarf_reg_entry): New variables checked_type, target_type,
	outer_val, target_val, val and addr.  Try to fetch and create also
	referenced value content.
	(pieced_value_funcs): NULL value for coerce_ref.
	(needs_dwarf_reg_entry_value): Add new parameter deref_size.
	* f-valprint.c (f_val_print) <TYPE_CODE_REF>: Try also
	coerce_ref_if_computed.
	* opencl-lang.c (opencl_value_funcs): NULL value for coerce_ref.
	* p-valprint.c (pascal_val_print) <TYPE_CODE_REF>: Likewise.
	* stack.c (read_frame_arg): Compare also dereferenced values.
	* value.c (value_computed_funcs): Make the parameter v const, use
	value_lval_const for it.
	(value_lval_const, coerce_ref_if_computed): New function.
	(coerce_ref): New variable retval.  Call also coerce_ref_if_computed.
	* value.h (struct lval_funcs): New field coerce_ref.
	(value_computed_funcs): Make the parameter v const.
	(value_lval_const, coerce_ref_if_computed): New declarations.

gdb/testsuite/
	Display @entry parameter values even for references.
	* gdb.arch/amd64-entry-value.cc (reference, datap, datap_input): New
	functions.
	(main): New variables regvar, nodatavarp, stackvar1, stackvar2.  Call
	reference and datap_input.
	* gdb.arch/amd64-entry-value.exp (reference, breakhere_reference): New
	breakpoints.
	(continue to breakpoint: entry_reference: reference)
	(entry_reference: bt at entry)
	(continue to breakpoint: entry_reference: breakhere_reference)
	(entry_reference: bt, entry_reference: ptype regparam)
	(entry_reference: p regparam, entry_reference: ptype regparam@entry)
	(entry_reference: p regparam@entry, entry_reference: p &regparam@entry)
	(entry_reference: p regcopy, entry_reference: p nodataparam)
	(entry_reference: p nodataparam@entry): New tests.
2011-10-09 19:43:41 +00:00
Jan Kratochvil e18b27534c gdb/
Display @entry parameter values (without references).
	* dwarf2expr.c (dwarf_block_to_fb_offset, dwarf_block_to_sp_offset):
	New functions.
	* dwarf2expr.h (dwarf_block_to_fb_offset, dwarf_block_to_sp_offset):
	New declarations.
	* dwarf2loc.c (dwarf2_find_location_expression): Support location list
	entry record.
	(dwarf_entry_parameter_to_value, value_of_dwarf_reg_entry)
	(value_of_dwarf_block_entry, locexpr_read_variable_at_entry): New
	functions.
	(dwarf2_locexpr_funcs): Install locexpr_read_variable_at_entry.
	(loclist_read_variable_at_entry): New function.
	(dwarf2_loclist_funcs): Install loclist_read_variable_at_entry.
	* dwarf2read.c (read_call_site_scope): Support also DW_OP_fbreg in
	DW_AT_location, call dwarf_block_to_sp_offset for it.
	* frame.h (print_entry_values_no, print_entry_values_only)
	(print_entry_values_preferred, print_entry_values_if_needed)
	(print_entry_values_both, print_entry_values_compact)
	(print_entry_values_default, print_entry_values): New declarations.
	(struct frame_arg): New field entry_kind.
	(read_frame_arg): New parameter entryargp.
	* mi/mi-cmd-stack.c (list_arg_or_local): New gdb_assert for
	arg->entry_kind.  Optionally print the `@entry' suffix.
	(list_args_or_locals): New variable entryarg, initialize it.
	Initialize also entry_kind of arg and entryarg.  Conditionalize
	list_arg_or_local for arg, add list_arg_or_local for entryarg.  Call
	xfree for entryarg.error.
	* stack.c (print_entry_values_no, print_entry_values_only)
	(print_entry_values_preferred, print_entry_values_if_needed)
	(print_entry_values_both, print_entry_values_compact)
	(print_entry_values_default, print_entry_values_choices)
	(print_entry_values): New variables.
	(print_frame_arg): New gdb_assert for arg->entry_kind.  Optionally
	print the `@entry' suffix, possibly in combination for
	print_entry_values_compact.
	(read_frame_arg): New parameter entryargp, new variables entryval,
	entryval_error and val_equal.  Read in also entryargp, respect
	print_entry_values, compare the values using val_equal, fill in also
	argp->entry_kind (together with entryargp->entry_kind).
	(print_frame_args): New variable entryarg, initialize it.
	Conditionalize print_frame_arg for arg, add print_frame_arg for
	entryarg.  Call xfree for entryarg.error.
	(_initialize_stack): Call add_setshow_enum_cmd for `entry-values'.
	* symtab.h (struct symbol_computed_ops): New field
	read_variable_at_entry.

gdb/doc/
	Display @entry parameter values (without references).
	* gdb.texinfo (Tail Call Frames): Add anchor.  Add self tail call
	example.
	(Print Settings): New description of set print entry-values and show
	print entry-values.

gdb/testsuite/
	Display @entry parameter values (without references).
	* gdb.arch/amd64-entry-value.cc (locexpr, stacktest, data, data2)
	(different, validity, invalid): New functions.
	(main): Call them.
	* gdb.arch/amd64-entry-value.exp: New breakpoints breakhere_locexpr,
	stacktest, breakhere_stacktest, different, breakhere_different,
	breakhere_validity and breakhere_invalid.
	(entry: bt): Update for @entry.
	(entry_locexpr: *, entry_stack: *, entry_equal: *, entry_different: *)
	(entry_validity: *, entry_invalid: *): Many new tests.
	* gdb.base/break.exp
	(run until breakpoint set at small function, optimized file): Accept
	also the @entry suffix.
	* gdb.mi/Makefile.in (PROGS): Add mi2-amd64-entry-value.
	* gdb.mi/mi2-amd64-entry-value.c: New files.
	* gdb.mi/mi2-amd64-entry-value.exp: New files.
2011-10-09 19:34:19 +00:00
Jan Kratochvil 2d6c5dc2c7 gdb/
Protect entry values against self tail calls.
	* dwarf2loc.c (VEC (CORE_ADDR), func_verify_no_selftailcall): New.
	(dwarf_expr_dwarf_reg_entry_value): Call func_verify_no_selftailcall.

gdb/testsuite/
	Protect entry values against self tail calls.
	* gdb.arch/amd64-entry-value.cc (self2, self): New.
	(main): Call self.
	* gdb.arch/amd64-entry-value.exp (self: breakhere, self: bt)
	(set debug entry-values 1, self: bt debug entry-values): New tests.
2011-10-09 19:29:11 +00:00
Jan Kratochvil 111c64899c 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 19:26:44 +00:00
Jan Kratochvil 8e3b41a906 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 19:21:39 +00:00
Jan Kratochvil 181cebd4f8 gdb/
Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches.
	* dwarf2-frame.c (execute_stack_op): Initialize ctx->ref_addr_size.
	* dwarf2expr.c (execute_stack_op) <DW_OP_GNU_implicit_pointer>: Use
	ctx->ref_addr_size.  Handle its invalid value.
	* dwarf2expr.h (struct dwarf_expr_context): New field ref_addr_size.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc_full)
	(dwarf2_loc_desc_needs_frame): Initialize ctx->ref_addr_size.
	* dwarf2loc.h (dwarf2_per_cu_ref_addr_size): New declaration.
	* dwarf2read.c (decode_locdesc): Initialize ctx->ref_addr_size.
	(dwarf2_per_cu_ref_addr_size): New function.

gdb/testsuite/
	Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches.
	* gdb.dwarf2/implptr-64bit.S: New file.
	* gdb.dwarf2/implptr-64bit.exp: New file.
2011-10-09 18:46:41 +00:00
Jan Kratochvil d83e736b11 gdb/
Remove excessive DWARF expressions memory duplication.
	* dwarf2loc.c (per_cu_dwarf_call): Remove variable back_to and its use
	for block.data.
	(indirect_pieced_value): Remove variable result.  Remove variable
	back_to and its use for baton.data.
	(dwarf2_compile_expr_to_ax): Remove variable back_to and its use for
	block.data.
	* dwarf2read.c (dwarf2_fetch_die_location_block): Remove xmemdup.
	Update the function comment.
2011-09-13 21:44:27 +00:00
Jan Kratochvil b6cede7829 gdb/
* dwarf2loc.c (dwarf2_evaluate_loc_desc_full) <DWARF_VALUE_STACK>
	(dwarf2_evaluate_loc_desc_full) <DWARF_VALUE_LITERAL>: New variable
	objfile_gdbarch.  Fix BFD_ENDIAN_BIG case.

gdb/testsuite/
	* gdb.dwarf2/dw2-op-stack-value.S: New file.
	* gdb.dwarf2/dw2-op-stack-value.exp: New file.
2011-08-08 21:41:14 +00:00
Jan Kratochvil 543305c9cd gdb/
Fix implicit pointer offsets.
	* dwarf2loc.c (indirect_pieced_value): Comment byte_offset.  Use also
	ptr.OFFSET.

gdb/testsuite/
	Fix implicit pointer offsets.
	* gdb.dwarf2/implptr.c (add): New marker baz breakpoint.
	* gdb.dwarf2/implptr.exp (set baz breakpoint for implptr)
	(continue to breakpoint: continue to baz breakpoint for implptr)
	(sanity check element 0, sanity check element 1)
	(enter the inlined function, check element 0 for the offset)
	(check element 1 for the offset)
	(continue to breakpoint: ignore the second baz breakpoint): New tests.
	(set foo breakpoint for implptr): Update the breakpoint number.
2011-07-25 16:04:53 +00:00
Jan Kratochvil 918dd91059 gdb/
Fix crash if referenced CU is aged out.
	* dwarf2loc.c (per_cu_dwarf_call): New variable back_to, use to for
	xfree of block.data.
	(indirect_pieced_value): New variable back_to, use to for xfree of
	baton.data.
	(dwarf2_compile_expr_to_ax): New variable back_to, use to for xfree of
	block.data.
	* dwarf2read.c (dwarf2_find_base_address): New prototype.
	(load_cu): New function from ...
	(dw2_do_instantiate_symtab): ... the code here ...
	(process_full_comp_unit): ... and here.
	(dwarf2_fetch_die_location_block): Call load_cu first.  Call xmemdup on
	retval.data.

gdb/testsuite/
	Fix crash if referenced CU is aged out.
	* gdb.dwarf2/dw2-op-call.exp (maintenance set dwarf2 max-cache-age 0):
	New.
	* gdb.dwarf2/implptr.exp: Likewise.
2011-07-19 20:28:52 +00:00
Jan Kratochvil 0e37a63c3c gdb/
* dwarf2loc.c (indirect_pieced_value): Use check_typedef for VALUE's
	type.

gdb/testsuite/
	* gdb.dwarf2/implptr.S: Rebuilt.
	* gdb.dwarf2/implptr.c (intp, intpp, intppp): New typedefs.
	(bar): Use them for j, k, l.
	* gdb.dwarf2/implptr.exp: New variable opts.  Support runtest parameter
	COMPILE.
	(print j in implptr:bar): Update for the intp typedef.
	(print p[0].x in implptr:foo): Use more exact regex.
2011-07-19 20:25:14 +00:00
Jan Kratochvil 9e8b7a03dd gdb/
Code cleanup.
	* dwarf2-frame.c (dwarf2_frame_ctx_funcs): New.
	(execute_stack_op): Use dwarf2_frame_ctx_funcs
	* dwarf2expr.c (dwarf_get_base_type): Access get_base_type via funcs.
	(execute_stack_op): Access read_reg, get_frame_base, read_mem,
	get_frame_cfa, get_tls_address and dwarf_call via funcs.
	* dwarf2expr.h (struct dwarf_expr_context): New forward declaration.
	(struct dwarf_expr_context_funcs): New, move here methods from ...
	(struct dwarf_expr_context): ... here.  New fields funcs.
	* dwarf2loc.c (dwarf_expr_dwarf_call): Access get_frame_pc via funcs.
	(dwarf_expr_ctx_funcs): New.
	(dwarf2_evaluate_loc_desc_full): Use dwarf_expr_ctx_funcs.
	(needs_frame_dwarf_call): Access get_frame_pc via funcs.
	(needs_frame_ctx_funcs): New.
	(dwarf2_loc_desc_needs_frame): Use needs_frame_ctx_funcs.
2011-07-15 20:54:32 +00:00
Jan Kratochvil c8f2448ab7 gdb/
Code cleanup - constify struct lval_funcs.
	* dwarf2loc.c (pieced_value_funcs): Make it const.
	* infrun.c (siginfo_value_funcs): Likewise.
	* opencl-lang.c (opencl_value_funcs): Likewise.
	* valops.c (value_assign, value_ind): Make the funcs variable const.
	* value.c (struct value): Make location.computed.funcs target const.
	Rearrange the comments.
	(allocate_computed_value): Make the funcs parameter target const.
	(value_computed_funcs): Return the funcs target const.
	(value_free, value_copy, set_value_component_location): Make the funcs
	variable const.
	* value.h (allocate_computed_value): Make the funcs parameter target
	const.
	(value_computed_funcs): Return the funcs target const.
	* windows-tdep.c (tlb_value_funcs): Make it const.
2011-07-14 15:00:20 +00:00
Jan Kratochvil 1632a688b3 gdb/
Code cleanup.
	* dwarf2loc.c (dwarf_expr_frame_base_1, dwarf2_evaluate_loc_desc_full):
	Indent prototypes so they do not get into tags.
2011-07-13 15:15:42 +00:00
Jan Kratochvil a7035dbbd1 gdb/
Code cleanup making also optimized out values lazy.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use
	allocate_optimized_out_value.  Twice.
	(loclist_read_variable)  Use allocate_optimized_out_value.  Once.
	* findvar.c (read_var_value): Likewise.
	* value.c (allocate_optimized_out_value): New function.
	* value.h (allocate_optimized_out_value): New declaration.
2011-07-12 21:16:48 +00:00
Tom Tromey 5e44ecb338 * dwarf2loc.c (locexpr_regname): New function.
(locexpr_describe_location_piece): Use it.
	(disassemble_dwarf_expression): Add per_cu argument.  Use
	locexpr_regname.
	<DW_OP_GNU_deref_type, DW_OP_GNU_const_type,
	DW_OP_GNU_regval_type, DW_OP_GNU_convert, DW_OP_GNU_reinterpret>:
	New cases.
	(locexpr_describe_location_1): Add per_cu argument.
	(locexpr_describe_location): Update.
	(loclist_describe_location): Update.
2011-07-08 19:54:55 +00:00
Tom Tromey 06826322cb * dwarf2loc.c (disassemble_dwarf_expression): Fix instruction
offset display.
2011-05-13 18:42:48 +00:00
Tom Tromey 72fc29ff12 * utils.c (do_value_free): New function.
(make_cleanup_value_free): Likewise.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Handle value
	freeing correctly.
	(dwarf2_loc_desc_needs_frame): Call
	make_cleanup_value_free_to_mark.
	* dwarf2expr.h (struct dwarf_expr_context) <mark>: Remove field.
	* dwarf2expr.c (free_dwarf_expr_context): Don't call
	value_free_to_mark.
	(new_dwarf_expr_context): Don't call value_mark.
	* dwarf2-frame.c (execute_stack_op): Call
	make_cleanup_value_free_to_mark.
	* defs.h (make_cleanup_value_free): Declare.
2011-05-13 15:44:49 +00:00
Tom Tromey 8a9b8146fd gdb
PR gdb/12617:
	* value.h (value_from_contents): Declare.
	* value.c (value_from_contents): New function.
	* dwarf2read.c (dwarf_stack_op_name): Add new values.
	(dwarf2_get_die_type): New function.
	* dwarf2loc.c (dwarf_expr_get_base_type): New function.
	(allocate_piece_closure): Acquire reference to values.
	(read_pieced_value): Update for value-based expressions.
	(write_pieced_value): Likewise.
	(free_pieced_value_closure): Call value_free as needed.
	(dwarf2_evaluate_loc_desc_full): Set get_base_type field.
	Update for value-based expressions.
	* dwarf2loc.h (dwarf2_get_die_type): Declare.
	* dwarf2expr.h (struct dwarf_stack_value) <value>: Change type.
	<get_base_type>: New field.
	(struct dwarf_expr_piece) <v.value>: Change type.
	<v.regno>: New field.
	(struct dwarf_expr_context) <mark>: New field.
	(dwarf_expr_piece, dwarf_expr_fetch): Update.
	(dwarf_expr_pop, dwarf_expr_push): Remove.
	(dwarf_expr_push_address): Declare.
	* dwarf2expr.c (dwarf_arch_cookie): New global.
	(struct dwarf_gdbarch_types): New.
	(dwarf_gdbarch_types_init, dwarf_expr_address_type): New
	functions.
	(dwarf_expr_push): Change type of 'value' argument.  Update.  Now
	static.
	(dwarf_expr_push_address): New function.
	(dwarf_expr_pop): Now static.
	(dwarf_expr_fetch): Change return type.
	(dwarf_require_integral): New function.
	(dwarf_expr_fetch): Simplify.
	(add_piece): Update.
	(base_types_equal_p, dwarf_get_base_type, get_unsigned_type): New
	functions.
	(execute_stack_op) <sign_ext>: Remove.
	Use values for DWARF stack.
	<DW_OP_GNU_const_type, DW_OP_GNU_deref_type,
	DW_OP_GNU_regval_type, DW_OP_GNU_convert, DW_OP_GNU_reinterpret>:
	New cases.
	(_initialize_dwarf2expr): New function.
	(add_piece): Update.
	(new_dwarf_expr_context): Set new field.
	(free_dwarf_expr_context): Call value_free_to_mark.
	* dwarf2-frame.c (no_base_type): New function.
	(execute_stack_op): Set get_base_type field.  Update.
gdb/testsuite
	* gdb.dwarf2/typeddwarf.S: New file.
	* gdb.dwarf2/typeddwarf.c: New file.
	* gdb.dwarf2/typeddwarf.exp: New file.
2011-05-12 17:40:55 +00:00
Jan Kratochvil dd90784ccd gdb/
* dwarf2expr.c (execute_stack_op): Handle DW_OP_GNU_entry_value.  New
	label abort_expression.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Handle
	DWARF_VALUE_OPTIMIZED_OUT.

gdb/testsuite/
	* gdb.dwarf2/dw2-entry-value-main.c: New file.
	* gdb.dwarf2/dw2-entry-value.S: New file.
	* gdb.dwarf2/dw2-entry-value.exp: New file.
2011-03-22 21:06:34 +00:00
Pedro Alves 79e1a869ac gdb/
* dwarf2loc.c (dwarf2_evaluate_loc_desc): Catch
	NOT_AVAILABLE_ERROR when evaluating the location expression.
2011-03-18 18:43:33 +00:00
Pedro Alves 8dccd430c9 gdb/
* dwarf2loc.c (read_pieced_value): Handle get_frame_register_bytes
	returning that the register piece is unavailable/optimized out.
	(write_pieced_value): Handle get_frame_register_bytes returning
	that the register piece is unavailable/optimized out when doing a
	read-modify write of a bitfield.
	* findvar.c (value_from_register): Handle get_frame_register_bytes
	returning that the register piece is unavailable/optimized out.
	* frame.c (get_frame_register_bytes): New parameters `optimizedp'
	and `unavailablep'.  Throw error on bad debug info.  Use
	frame_register instead of frame_register_read, to fill in the new
	arguments.
	* frame.h (get_frame_register_bytes): New parameters `optimizedp'
	and `unavailablep'.
	* valops.c: (value_assign): Adjust, and handle
	get_frame_register_bytes failing.
	* spu-tdep.c: Include exceptions.h.
	(spu_software_single_step): Adjust, and handle
	get_frame_register_bytes failing.
	(spu_get_longjmp_target): Ditto.
	* gdbarch.sh (register_to_value): Change to return int.  New
	parameters `optimizedp' and `unavailablep'.
	* gdbarch.h, gdbarch.c: Regenerate.
	* i386-tdep.c (i386_register_to_value): Adjust to new
	gdbarch_register_to_value interface.
	* i387-tdep.c (i387_register_to_value): Ditto.
	* i387-tdep.h (i387_register_to_value): Ditto.
	* alpha-tdep.c (alpha_register_to_value): Ditto.
	* ia64-tdep.c (ia64_register_to_value): Ditto.
	* m68k-tdep.c (m68k_register_to_value): Ditto.
	* mips-tdep.c (mips_register_to_value): Ditto.
	* rs6000-tdep.c (rs6000_register_to_value): Ditto.
2011-03-18 18:42:41 +00:00
Tom Tromey 37b50a69d6 PR gdb/12576:
* dwarf2loc.c (dwarf_expr_dwarf_call): Remove 'return'.
	(needs_frame_dwarf_call): Likewise.
2011-03-14 15:58:56 +00:00
Michael Snyder e0e40094f8 2011-03-04 Michael Snyder <msnyder@vmware.com>
* dwarf2loc.c (indirect_pieced_value): Assert 'piece' not null.
2011-03-07 20:06:12 +00:00
Michael Snyder 8c814cdde7 2011-02-26 Michael Snyder <msnyder@vmware.com>
* dwarf2loc.c (insert_bits): Avoid shadowing a function param
	with a local variable of the same name.
2011-02-27 00:01:12 +00:00
Jan Kratochvil 0502ed8ce1 gdb/
* dwarf2loc.c (disassemble_dwarf_expression) <DW_OP_breg[0-9]+>: Use
	L and plongest.
	(disassemble_dwarf_expression) <DW_OP_bregx>: Drop variable offset,
	use L and plongest.
	(disassemble_dwarf_expression) <DW_OP_fbreg>: Use L and plongest.
2011-02-25 08:35:36 +00:00
Tom Tromey c7f96d2b95 gdb
* ax-general.c (aop_map): Add pick and rot.
	* dwarf2loc.c (compile_dwarf_to_ax) <DW_OP_over>: Reimplement.
	<DW_OP_rot>: Implement.
	* ax.h (enum agent_op) <aop_pick, aop_rot>: New constants.
	(ax_pick): Declare.
	* ax-general.c (ax_pick): New function.
doc
	* agentexpr.texi (Bytecode Descriptions): Document pick and rot.
gdbserver
	* tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
	gdb_agent_op_rot>: New constants.
	(gdb_agent_op_names): Add pick and roll.
	(eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
	cases.
2011-02-18 20:55:45 +00:00
Tom Tromey 9f6f94ff25 * dwarf2loc.h (dwarf2_compile_expr_to_ax): Declare.
* dwarf2loc.c (dwarf2_compile_expr_to_ax): Rename from
	compile_dwarf_to_ax.  No longer static.  Call
	dwarf2_compile_cfa_to_ax.
	(locexpr_tracepoint_var_ref): Update.
	(loclist_tracepoint_var_ref): Update.
	* dwarf2-frame.h (dwarf2_compile_cfa_to_ax): Declare.
	* dwarf2-frame.c (execute_cfa_program): Remove 'this_frame'
	argument; add 'gdbarch' and 'pc'.
	(dwarf2_compile_cfa_to_ax): New function.
	(dwarf2_frame_cache): Update.
2011-02-17 16:20:44 +00:00
Tom Tromey 1ba1b3533c * dwarf2loc.c (unimplemented): Fix typo. 2011-02-16 21:45:38 +00:00
Tom Tromey b1bfef6533 * dwarf2loc.c (unimplemented): Handle unnamed opcodes.
(compile_dwarf_to_ax) <default>: Use unimplemented.
	<DW_OP_deref>: Update.
	(disassemble_dwarf_expression): Update.
	* dwarf2read.c (dwarf_stack_op_name): Remove 'def' argument.
	(decode_locdesc): Update.
	* dwarf2expr.h (dwarf_stack_op_name): Update.
2011-02-16 21:32:05 +00:00
Pedro Alves e6ca34fcfb Mark pieces of values as unavailable if the corresponding memory
is unavailable.

	gdb/
	* valops.c: Include tracepoint.h.
	(value_fetch_lazy): Use read_value_memory.
	(read_value_memory): New.
	* value.h (read_value_memory): Declare.
	* dwarf2loc.c (read_pieced_value): Use read_value_memory.
	* exec.c (section_table_available_memory): New function.
	* exec.h (section_table_available_memory): Declare.
2011-02-14 11:21:25 +00:00
Jan Kratochvil 41e8491fdf gdb/
Make value allocations more lazy.
	* ada-lang.c (coerce_unspec_val_to_type): Use allocate_value_lazy
	instead of allocate_value and set_value_lazy when possible.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use allocate_value_lazy
	instead of allocate_value and set_value_lazy.
	* findvar.c (value_of_register_lazy): Likewise.
	(read_var_value): Remove V preallocation, call just check_typedef in
	advance.  Move allocate_value to LOC_CONST, LOC_LABEL,
	LOC_CONST_BYTES.  Use allocate_value_lazy in LOC_STATIC, LOC_ARG,
	LOC_REF_ARG, LOC_LOCAL, LOC_BLOCK.  Set ADDR instead of
	set_value_address and break in LOC_BLOCK.  Use allocate_value_lazy and
	remove lval_memory set in LOC_REGPARM_ADDR.  Use allocate_value_lazy
	in LOC_UNRESOLVED and LOC_OPTIMIZED_OUT.  Add setting lval_memory at
	the end, remove set_value_lazy there.
	* valarith.c (value_subscripted_rvalue): Use allocate_value_lazy
	instead of allocate_value and set_value_lazy when possible.
	* valops.c (value_fetch_lazy): Do nop for value_optimized_out VAL.
	* value.c (allocate_computed_value): Use allocate_value_lazy instead
	of allocate_value and set_value_lazy.
	(value_from_contents_and_address): Use allocate_value_lazy instead of
	allocate_value and set_value_lazy when possible.
2011-01-12 16:10:05 +00:00
Michael Snyder 0963b4bd45 2011-01-07 Michael Snyder <msnyder@vmware.com>
* ada-lang.c: Comment cleanup, mostly periods and spaces.
	* ada-lang.h: Ditto.
	* ada-tasks.c: Ditto.
	* ada-valprint.c: Ditto.
	* aix-threads.c: Ditto.
	* alpha-linux-nat.c: Ditto.
	* alpha-linux-tdep.c: Ditto.
	* alpha-mdebug-tdep.c: Ditto.
	* alpha-nat.c: Ditto.
	* alpha-osf1-tdep.c: Ditto.
	* alpha-tdep.c: Ditto.
	* alphabsd-nat.c: Ditto.
	* alphabsd-tdep.c: Ditto.
	* amd64-darwin-tdep.c: Ditto.
	* amd64-linux-nat.c: Ditto.
	* amd64-linux-tdep.c: Ditto.
	* amd64-sol2-tdep.c: Ditto.
	* amd64-tdep.c: Ditto.
	* amd64-fbsd-tdep.c: Ditto.
	* amd64-nbsd-tdep.c: Ditto.
	* amd64-obsd-tdep.c: Ditto.
	* amd64-linux-nat.c: Ditto.
	* amd64-linux-tdep.c: Ditto.
	* arm-tdep.c: Ditto.
	* arm-tdep.h: Ditto.
	* armnbsd-nat.c: Ditto.
	* avr-tdep.c: Ditto.
	* bfin-tdep.c: Ditto.
	* bsd-kvm.c: Ditto.
	* c-typeprintc: Ditto.
	* c-valprint.c: Ditto.
	* coff-pe-read.h: Ditto.
	* coffreead.c: Ditto.
	* cris-tdep.c: Ditto.
	* d-lang.c: Ditto.
	* darwin-nat-info.c: Ditto.
	* darwin-nat.c: Ditto.
	* dbug-rom.c: Ditto.
	* dbxread.c: Ditto.
	* dcache.c: Ditto.
	* dcache.h: Ditto.
	* dec-thread.c: Ditto.
	* defs.h: Ditto.
	* demangle.c: Ditto.
	* dicos-tdep.c: Ditto.
	* dictionary.c: Ditto.
	* dictionary.h: Ditto.
	* dink32-rom.c: Ditto.
	* disasm.c: Ditto.
	* doublest.c: Ditto.
	* dsrec.c: Ditto.
	* dummy-frame.c: Ditto.
	* dwarf2-frame.c: Ditto.
	* dwarf2expr.c: Ditto.
	* dwarf2loc.c: Ditto.
	* dwarf2read.c: Ditto.
	* elfread.c: Ditto.
	* environ.c: Ditto.
	* eval.c: Ditto.
	* event-top.h: Ditto.
	* exceptions.c: Ditto.
	* exceptions.h: Ditto.
	* exec.c: Ditto.
	* expprint.c: Ditto.
	* expression.h: Ditto.
	* f-exp.y: Ditto.
	* f-lang.c: Ditto.
	* f-lang.h: Ditto.
	* f-typeprint.c: Ditto.
	* f-valprint.c: Ditto.
	* fbsd-nat.c: Ditto.
	* findvar.c: Ditto.
	* fork-child.c: Ditto.
	* frame.c: Ditto.
	* frame.h: Ditto.
	* frv-linux-tdep.c: Ditto.
	* frv-tdep.c: Ditto.
	* gcore.c: Ditto.
	* gdb-stabs.h: Ditto.
	* gdb_assert.h: Ditto.
	* gdb_string.h: Ditto.
	* gdb_thread_db.h: Ditto.
	* gdb_wait.h: Ditto.
	* gdbarch.sh: Ditto.
	* gdbcore.h: Ditto.
	* gdbthread.h: Ditto.
	* gdbtypes.c: Ditto.
	* gdbtypes.h: Ditto.
	* gnu-nat.c: Ditto.
	* gnu-nat.h: Ditto.
	* gnu-v2-abi.c: Ditto.
	* gnu-v3-abi.c: Ditto.
	* go32-nat.c: Ditto.
	* gdbarch.c: Regenerate.
	* gdbarch.h: Regenerate.
2011-01-07 19:36:19 +00:00
Michael Snyder 3e43a32aaa 2011-01-05 Michael Snyder <msnyder@vmware.com>
* addrmap.c: Shorten lines of >= 80 columns.
	* arch-utils.c: Ditto.
	* arch-utils.h: Ditto.
	* ax-gdb.c: Ditto.
	* ax-general.c: Ditto.
	* bcache.c: Ditto.
	* blockframe.c: Ditto.
	* breakpoint.c: Ditto.
	* buildsym.c: Ditto.
	* c-lang.c: Ditto.
	* c-typeprint.c: Ditto.
	* charset.c: Ditto.
	* coffread.c: Ditto.
	* command.h: Ditto.
	* corelow.c: Ditto.
	* cp-abi.c: Ditto.
	* cp-namespace.c: Ditto.
	* cp-support.c: Ditto.
	* dbug-rom.c: Ditto.
	* dbxread.c: Ditto.
	* defs.h: Ditto.
	* dfp.c: Ditto.
	* dfp.h: Ditto.
	* dictionary.c: Ditto.
	* disasm.c: Ditto.
	* doublest.c: Ditto.
	* dwarf2-frame.c: Ditto.
	* dwarf2expr.c: Ditto.
	* dwarf2loc.c: Ditto.
	* dwarf2read.c: Ditto.
	* elfread.c: Ditto.
	* eval.c: Ditto.
	* event-loop.c: Ditto.
	* event-loop.h: Ditto.
	* exceptions.h: Ditto.
	* exec.c: Ditto.
	* expprint.c: Ditto.
	* expression.h: Ditto.
	* f-lang.c: Ditto.
	* f-valprint.c: Ditto.
	* findcmd.c: Ditto.
	* frame-base.c: Ditto.
	* frame-unwind.c: Ditto.
	* frame-unwind.h: Ditto.
	* frame.c: Ditto.
	* frame.h: Ditto.
	* gcore.c: Ditto.
	* gdb-stabs.h: Ditto.
	* gdb_assert.h: Ditto.
	* gdb_dirent.h: Ditto.
	* gdb_obstack.h: Ditto.
	* gdbcore.h: Ditto.
	* gdbtypes.c: Ditto.
	* gdbtypes.h: Ditto.
	* inf-ttrace.c: Ditto.
	* infcall.c: Ditto.
	* infcmd.c: Ditto.
	* inflow.c: Ditto.
	* infrun.c: Ditto.
	* inline-frame.h: Ditto.
	* language.c: Ditto.
	* language.h: Ditto.
	* libunwind-frame.c: Ditto.
	* libunwind-frame.h: Ditto.
	* linespec.c: Ditto.
	* linux-nat.c: Ditto.
	* linux-nat.h: Ditto.
	* linux-thread-db.c: Ditto.
	* machoread.c: Ditto.
	* macroexp.c: Ditto.
	* macrotab.c: Ditto.
	* main.c: Ditto.
	* maint.c: Ditto.
	* mdebugread.c: Ditto.
	* memattr.c: Ditto.
	* minsyms.c: Ditto.
	* monitor.c: Ditto.
	* monitor.h: Ditto.
	* objfiles.c: Ditto.
	* objfiles.h: Ditto.
	* osabi.c: Ditto.
	* p-typeprint.c: Ditto.
	* p-valprint.c: Ditto.
	* parse.c: Ditto.
	* printcmd.c: Ditto.
	* proc-events.c: Ditto.
	* procfs.c: Ditto.
	* progspace.c: Ditto.
	* progspace.h: Ditto.
	* psympriv.h: Ditto.
	* psymtab.c: Ditto.
	* record.c: Ditto.
	* regcache.c: Ditto.
	* regcache.h: Ditto.
	* remote-fileio.c: Ditto.
	* remote.c: Ditto.
	* ser-mingw.c: Ditto.
	* ser-tcp.c: Ditto.
	* ser-unix.c: Ditto.
	* serial.c: Ditto.
	* serial.h: Ditto.
	* solib-frv.c: Ditto.
	* solib-irix.c: Ditto.
	* solib-osf.c: Ditto.
	* solib-pa64.c: Ditto.
	* solib-som.c: Ditto.
	* solib-sunos.c: Ditto.
	* solib-svr4.c: Ditto.
	* solib-target.c: Ditto.
	* solib.c: Ditto.
	* somread.c: Ditto.
	* source.c: Ditto.
	* stabsread.c: Ditto.
	* stabsread.c: Ditto.
	* stack.c: Ditto.
	* stack.h: Ditto.
	* symfile-mem.c: Ditto.
	* symfile.c: Ditto.
	* symfile.h: Ditto.
	* symmisc.c: Ditto.
	* symtab.c: Ditto.
	* symtab.h: Ditto.
	* target-descriptions.c: Ditto.
	* target-memory.c: Ditto.
	* target.c: Ditto.
	* target.h: Ditto.
	* terminal.h: Ditto.
	* thread.c: Ditto.
	* top.c: Ditto.
	* tracepoint.c: Ditto.
	* tracepoint.h: Ditto.
	* ui-file.c: Ditto.
	* ui-file.h: Ditto.
	* ui-out.h: Ditto.
	* user-regs.c: Ditto.
	* user-regs.h: Ditto.
	* utils.c: Ditto.
	* valarith.c: Ditto.
	* valops.c: Ditto.
	* valprint.c: Ditto.
	* valprint.h: Ditto.
	* value.c: Ditto.
	* varobj.c: Ditto.
	* varobj.h: Ditto.
	* vec.h: Ditto.
	* xcoffread.c: Ditto.
	* xcoffsolib.c: Ditto.
	* xcoffsolib.h: Ditto.
	* xml-syscall.c: Ditto.
	* xml-tdesc.c: Ditto.
2011-01-05 22:22:53 +00:00
Joel Brobecker 7b6bb8daac run copyright.sh for 2011. 2011-01-01 15:34:07 +00:00
Tom Tromey 8cf6f0b103 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 21:18:16 +00:00
Tom Tromey 7155d5780a gdb
PR symtab/8399:
	* dwarf2loc.c (locexpr_describe_location_piece): Don't call error
	for unrecognized frame base expression.
gdb/testsuite
	PR symtab/8399:
	* gdb.threads/tls.exp: Remove kfail.  Update expected output.
2010-09-14 19:39:59 +00:00
Pedro Alves 98bfdba52e 2010-08-12 Daniel Jacobowitz <dan@codesourcery.com>
Pedro Alves  <pedro@codesourcery.com>

	* dwarf2read.c: Include "c-lang.h" and "valprint.h".
	(struct dwarf2_per_objfile) <reading_partial_symbols>: New field.
	(struct partial_die_info) <has_template_arguments>: New field.
	<num_attrs>: Change type to unsigned char.
	<building_fullname>: New field.
	(dwarf2_build_psymtabs_hard): Set reading_partial_symbols.  Only
	allocate a CU if we don't have one already.  Add a cleanup for the
	CU.
	(partial_die_full_name): Handle template arguments not in
	DW_AT_name.
	(dwarf2_psymtab_to_symtab): Clear reading_partial_symbols.
	(load_full_comp_unit): Only allocate a CU if we don't have one
	already.
	(do_ui_file_peek_last): New.
	(dwarf2_compute_name): Handle template parameters not in
	DW_AT_name.
	(read_comp_unit): Read and free abbrevs if not read yet.
	(load_partial_dies): Handle template arguments not in DW_AT_name.
	(find_partial_die): If we have a CU, but no a partial dies yet,
	also read in the CU.
	(dwarf2_const_value_attr): New, abstracted out from
	dwarf2_const_value.
	(dwarf2_const_value, dwarf2_const_value_data): Adjust to use
	dwarf2_const_value_attr.
	(determine_prefix): Detect and break loops created by RCVT's debug
	info.
	(maybe_queue_comp_unit): Bail out early if reading partial
	symbols.
	(follow_die_offset): Load full CU if we have no dies.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc): Make public.
	* dwarf2loc.h (dwarf2_evaluate_loc_desc): Declare.
2010-08-12 19:55:38 +00:00
Tom Tromey 09d8bd0068 * dwarf2loc.c (locexpr_describe_location_piece): Also recognize
TLS with DW_OP_const4u or DW_OP_const8u.
2010-07-26 20:25:00 +00:00
Tom Tromey 9aa1f1e339 * dwarf2loc.h (dwarf2_per_cu_text_offset): Declare.
* dwarf2loc.c (find_location_expression): Use
	dwarf2_per_cu_text_offset.
	(dwarf2_evaluate_loc_desc): Likewise.
	(dwarf2_loc_desc_needs_frame): Likewise.
	(compile_dwarf_to_ax): Likewise.
	(loclist_describe_location): Likewise.
	* dwarf2read.c (dwarf2_per_cu_text_offset): New function.
	(dwarf2_per_cu_objfile): Update comment.
2010-07-13 15:09:03 +00:00
Tom Tromey ac56253dde * dwarf2read.c (dwarf2_const_value) <DW_form_addr>: Create a
LOC_COMPUTED symbol.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc): Set new field.
	(dwarf2_loc_desc_needs_frame): Likewise.
	(compile_dwarf_to_ax) <DW_OP_addr>: Use offset.
	* dwarf2expr.h (struct dwarf_expr_context) <offset>: New field.
	* dwarf2expr.c (execute_stack_op) <DW_OP_addr>: Use offset.
	* dwarf2-frame.c (execute_stack_op): Set 'offset' field.  Add
	'offset' argument.
	(struct dwarf2_frame_cache) <text_offset>: New field.
	(dwarf2_frame_cache): Set new field.
	(dwarf2_frame_prev_register): Update.
	(dwarf2_frame_sniffer): Update.
	(dwarf2_frame_base_sniffer): Update.
	(dwarf2_frame_find_fde): Add 'out_offset' argument.
2010-07-07 17:26:38 +00:00
Pedro Alves cabe9ab66e * dwarf2loc.c (locexpr_tracepoint_var_ref)
(loclist_tracepoint_var_ref): Handle optimized out values.
2010-07-01 15:45:31 +00:00
Ulrich Weigand f2c7657e9a ChangeLog:
* dwarf2expr.h (struct dwarf_value_location): Use ULONGEST as type
	of stack values.
	(struct dwarf_expr_piece): Rename "expr" member to "mem".  Add new
	"value" member.
	(dwarf_expr_push): Change input type to ULONGEST.
	(dwarf_expr_fetch): Change return type to ULONGEST.
	(dwarf_expr_fetch_address): Add prototype.
	(dwarf2_read_address): Remove prototype.
	* dwarf2expr.c (dwarf_expr_push): Use ULONGEST as type of stack values.
	Truncate stack values to ctx->addr_size bytes.
	(dwarf_expr_fetch): Change return value to ULONGEST.
	(dwarf_expr_fetch_address): New function.
	(add_piece): Use dwarf_expr_fetch_address instead of dwarf_expr_fetch
	when appropriate.  Update for struct dwarf_expr_piece changes.
	(dwarf2_read_address): Remove.
	(unsigned_address_type): Remove.
	(signed_address_type): Remove.
	(execute_stack_op): Use dwarf_expr_fetch_address instead of
	dwarf_expr_fetch when appropriate.  Use ULONGEST as type of stack
	values.  Perform operations on ULONGEST instead of on GDB values,
	sign-extending from ctx->addr_size bytes as needed.  Read DW_OP_addr
	values and DW_OP_deref results as unsigned integers.
	* dwarf2loc.c (read_pieced_value): Update for struct dwarf_expr_piece
	changes.
	(write_pieced_value): Likewise.
	(dwarf2_evaluate_loc_desc): Use dwarf_expr_fetch_address instead of
	dwarf_expr_fetch when appropriate.
	(compile_dwarf_to_ax): Read DW_OP_addr values as unsigned integers.
	* dwarf2-frame.c (execute_stack_op): Use dwarf_expr_fetch_address
	instead of dwarf_expr_fetch when appropriate.

testsuite/ChangeLog:

	* gdb.cell/dwarfaddr.exp: New file.
	* gdb.cell/dwarfaddr.S: New file.
2010-06-25 13:00:33 +00:00
Ulrich Weigand d4a087c799 * dwarf2loc.c (find_location_expression): Add relocation offset
to base-address-selection entry base addresses.  Read addresses
	(and offsets) as signed/unsigned integers, depending on the
	BFD's sign_extend_vma flag.  Do not call dwarf2_read_address.
	(loclist_describe_location): Likewise.
	(disassemble_dwarf_expression): Read DW_OP_addr operand as
	unsigned integer.  Do not call dwarf2_read_address.
	(locexpr_describe_location): Likewise for DW_OP_GNU_push_tls_address.
2010-06-21 16:50:18 +00:00
Tom Tromey 0e03807e1c gdb
PR gdb/9977, PR exp/11636:
	* value.h (value_offset): Update.
	(struct lval_funcs) <check_validity>: New field.
	<copy_closure>: Make argument const.
	(value_computed_closure): Update.
	(value_contents_for_printing): Declare.
	(value_bits_valid): Likewise.
	(val_print): Likewise.
	(set_value_component_location): Update.
	(value_entirely_optimized_out): Declare.
	* value.c (value_offset): Argument now const.
	(require_not_optimized_out): New function.
	(value_contents_for_printing): New function.
	(value_contents_all): Call require_not_optimized_out.
	(value_contents): Likewise.
	(value_bits_valid): New function.
	(value_computed_closure): Argument now const.
	(set_value_component_location): Make 'whole' argument const.
	(value_entirely_optimized_out): New function.
	(value_bitsize): Argument now 'const'.
	(value_bitpos): Likewise.
	(value_type): Likewise.
	* valprint.h (val_print_array_elements): Update.
	* valprint.c (val_print): Add 'val' argument.  Use
	valprint_check_validity.
	(valprint_check_validity): New function.
	(value_check_printable): Use value_entirely_optimized_out.
	(common_val_print): Update.
	(value_print): Likewise.
	(val_print_array_elements): Add 'val' argument.
	* valops.c (value_fetch_lazy): Use value_contents_for_printing,
	value_bits_valid.  Reinit frame cache for lval_computed.
	* sh64-tdep.c (sh64_do_register): Update.
	* scm-valprint.c (scm_val_print): Add 'val' argument.
	* scm-lang.h (scm_val_print): Update.
	* python/python.h (apply_val_pretty_printer): Update.
	* python/py-prettyprint.c (apply_val_pretty_printer): Add 'val'
	argument.  Call set_value_component_location.
	* printcmd.c (print_scalar_formatted): Update.
	* p-valprint.c (pascal_val_print): Add 'val' argument.
	(pascal_object_print_value_fields): Likewise.
	(pascal_object_print_value): Likewise.
	(pascal_object_print_static_field): Update.
	* p-lang.h (pascal_val_print): Update.
	(pascal_object_print_value_fields): Update.
	* mt-tdep.c (mt_registers_info): Update.
	* mi/mi-main.c (get_register): Update.
	(mi_cmd_data_evaluate_expression): Use common_val_print.
	* m2-valprint.c (m2_print_array_contents): Add 'val' argument.
	(m2_print_unbounded_array): Likewise.
	(m2_val_print): Likewise.
	* m2-lang.h (m2_val_print): Update.
	* language.h (struct language_defn) <la_val_print>: Add 'val'
	argument.
	(LA_VAL_PRINT): Likewise.
	* language.c (unk_lang_val_print): Add 'val' argument.
	* jv-valprint.c (java_print_value_fields): Add 'val' argument.
	(java_val_print): Likewise.
	* jv-lang.h (java_val_print): Add 'val' argument.
	* infcmd.c (default_print_registers_info): Update.
	* f-valprint.c (f77_print_array_1): Add 'val' argument.
	(f77_print_array): Likewise.
	(f_val_print): Likewise.
	* f-lang.h (f_val_print): Add 'val' argument.
	* dwarf2loc.c (read_pieced_value): Use value_bitsize and
	value_bitpos.
	<DWARF_VALUE_OPTIMIZED_OUT>: Don't print warning.  Call
	set_value_optimized_out.
	(write_pieced_value): Use value_bitsize and value_bitpos.
	<default>: Don't exit loop.
	(check_pieced_value_validity): New function.
	(pieced_value_funcs): Reference check_pieced_value_validity,
	check_pieced_value_invalid.
	(copy_pieced_value_closure): Update.
	(check_pieced_value_bits): New function.
	(check_pieced_value_invalid): New function.
	* d-valprint.c (dynamic_array_type): Add 'val' argument.
	(d_val_print): Likewise.
	* d-lang.h (d_val_print): Update.
	* cp-valprint.c (cp_print_value_fields): Add 'val' argument.
	(cp_print_value_fields_rtti): Likewise.
	(cp_print_value): Likewise.
	(cp_print_static_field): Update.
	* c-valprint.c (c_val_print): Add 'val' argument.
	(c_value_print): Update.
	* c-lang.h (c_val_print): Update.
	(cp_print_value_fields): Likewise.
	(cp_print_value_fields_rtti): Likewise.
	* ada-valprint.c (struct ada_val_print_args): Remove.
	(val_print_packed_array_elements): Add 'val' argument.
	(ada_val_print): Likewise.  Rewrite.
	(ada_val_print_stub): Remove.
	(ada_val_print_array): Add 'val' argument.
	(ada_val_print_1): Likewise.
	(print_variant_part): Likewise.
	(ada_value_print): Update.
	(print_record): Add 'val' argument.
	(print_field_values): Likewise.
	* ada-lang.h (ada_val_print): Update.
gdb/testsuite
	PR gdb/9977, PR exp/11636::
	* gdb.dwarf2/pieces.exp (pieces_test_f3): Remove kfail.
	(pieces_test_f6): Update expected output.
2010-06-11 15:36:10 +00:00
Tom Tromey 3cf03773b7 * vec.h (VEC_cleanup): New macro.
(DEF_VEC_ALLOC_FUNC_I): Update.
	(DEF_VEC_ALLOC_FUNC_P): Likewise.
	(DEF_VEC_ALLOC_FUNC_O): Likewise.
	* dwarf2loc.c (struct axs_var_loc): Remove.
	(unimplemented): New function.
	(translate_register): Likewise.
	(access_memory): Likewise.
	(compile_dwarf_to_ax): Likewise.
	(dwarf2_tracepoint_var_loc): Remove.
	(dwarf2_tracepoint_var_access): Likewise.
	(dwarf2_tracepoint_var_ref): Likewise.
	(locexpr_tracepoint_var_ref): Use compile_dwarf_to_ax.
	(loclist_tracepoint_var_ref): Likewise.
	* dwarf2expr.h (dwarf_expr_require_composition): Declare.
	* dwarf2expr.c (dwarf_expr_require_composition): Rename from
	require_composition.  No longer static.
	(execute_stack_op): Update.
	* ax-gdb.h (trace_kludge): Declare.
2010-06-11 15:21:11 +00:00
Jan Kratochvil 5c631832c1 gdb/
Fix PR 10640.
	* dwarf2-frame.c (no_dwarf_call): New function.
	(execute_stack_op): Set CTX->DWARF_CALL.
	* dwarf2expr.c (execute_stack_op) <DW_OP_call2, DW_OP_call4>: New.
	* dwarf2expr.h (struct dwarf_expr_context) <dwarf_call>: New.
	(struct dwarf_expr_context) <get_subr>: Remove the #if0-ed field.
	* dwarf2loc.c (per_cu_dwarf_call, dwarf_expr_dwarf_call): New functions.
	(dwarf2_evaluate_loc_desc): Initialize CTX->DWARF_CALL.
	(needs_frame_dwarf_call): New function.
	(dwarf2_loc_desc_needs_frame): Initialize CTX->DWARF_CALL.
	* dwarf2read.c (follow_die_offset): Based on former follow_die_ref.
	Update the comment.  Move variables die, offset and error call to ...
	(follow_die_ref): ... a new function.
	(dwarf2_fetch_die_location_block): New function.
	* dwarf2loc.h (dwarf2_fetch_die_location_block): New prototype.

gdb/testsuite/
	Test PR 10640.
	* gdb.dwarf2/dw2-op-call.exp, gdb.dwarf2/dw2-op-call.S: New.
2010-06-07 19:55:33 +00:00
Jan Kratochvil 17ea53c331 gdb/
* dwarf2loc.c (struct dwarf_expr_baton) Replace objfile by per_cu.
	(dwarf_expr_tls_address): Use per_cu instead of objfile.
	(dwarf2_evaluate_loc_desc): Drop initialization of BATON.OBJFILE.
	Initialize new BATON.PER_CU.  Adjust CTX->GDBARCH initialization for
	this change.
	(struct needs_frame_baton): New field per_cu.
	(dwarf2_loc_desc_needs_frame): Initialize new BATON.PER_CU.
	* dwarf2read.c (struct dwarf2_per_cu_data) <cu>: Extend the comment.
2010-06-07 19:42:58 +00:00
Hui Zhu 44b5680ae1 2010-06-04 Hui Zhu <teawater@gmail.com>
* dwarf2loc.c (disassemble_dwarf_expression): Change ul to l.
2010-06-04 02:39:16 +00:00
Tom Tromey 9eae7c5264 gdb
* dwarf2loc.h (dwarf2_per_cu_data): Declare.
	* dwarf2read.c (dwarf_stack_op_name): No longer static.  Return
	type is const.  Add 'def' argument.  Add missing operators, remove
	unhandled ones.
	(decode_locdesc): Update.
	(dwarf2_always_disassemble): New global.
	(show_dwarf2_always_disassemble): New function.
	(_initialize_dwarf2_read): Add always-disassemble.
	(dwarf2_per_cu_offset_size): New function.
	* dwarf2loc.c (dwarf2_always_disassemble): Declare.
	(piece_end_p): New function.
	(locexpr_describe_location_piece): Replace 'size' argument with
	'end'.  Use piece_end_p.  Rewrite recognition of TLS.  Recognize
	some constants.  Remove errors.
	(disassemble_dwarf_expression): New function.
	(locexpr_describe_location_1): Use disassemble_dwarf_expression.
	Add 'offset_size' argument.
	(loclist_describe_location): Change output formatting.
	* dwarf2expr.h (dwarf_stack_op_name): Declare.
gdb/doc
	* gdb.texinfo (Maintenance Commands): Document maint set dwarf2
	always-disassemble.
2010-06-02 19:37:56 +00:00
Tom Tromey 88bfdde411 * dwarf2loc.c (struct piece_closure) <refc>: New field.
(allocate_piece_closure): Initialize refc.
	(copy_pieced_value_closure): Use refc.
	(free_pieced_value_closure): Likewise.
2010-05-27 19:14:35 +00:00
Tom Tromey 947bb88ff5 * dwarf2loc.h (struct dwarf2_locexpr_baton) <data>: Now const.
(struct dwarf2_loclist_baton) <data>: Likewise.
	* dwarf2loc.c (find_location_expression): Constify return type.
	(dwarf2_evaluate_loc_desc): Make 'data' argument const.
	(dwarf2_loc_desc_needs_frame): Likewise.
	(loclist_read_variable): Constify.
	(loclist_describe_location): Likewise.
	(loclist_tracepoint_var_ref): Likewise.
2010-05-26 15:21:13 +00:00
Tom Tromey 0d45f56e47 * dwarf2loc.c (dwarf_expr_frame_base): Constify.
(dwarf_expr_frame_base_1): Likewise.
	(read_pieced_value): Update.
	(needs_frame_frame_base): Constify.
	(dwarf2_tracepoint_var_loc): Likewise.
	(dwarf2_tracepoint_var_access): Likewise.
	(locexpr_describe_location_piece): Likewise.
	(locexpr_describe_location_1): Likewise.
	* dwarf2expr.h (struct dwarf_expr_context) <get_frame_base>:
	Constify.
	(data): Now const.
	(struct dwarf_expr_piece) <v.literal.data>: Likewise.
	(dwarf_expr_eval, read_uleb128, read_sleb128)
	(dwarf2_read_address): Update.
	* dwarf2expr.c (dwarf_expr_eval): Constify.
	(read_uleb128): Likewise.
	(read_sleb128): Likewise.
	(dwarf2_read_address): Likewise.
	(require_composition): Likewise.
	(execute_stack_op): Likewise.
	* dwarf2-frame.h (struct dwarf2_frame_state_reg) <loc.exp>: Now a
	"const gdb_byte *".
	* dwarf2-frame.c (struct dwarf2_frame_state_reg_info) <cfa_exp>:
	Now const.
	(no_get_frame_base): Constify.
	(execute_stack_op): Likewise.
	(execute_cfa_program): Likewise.
	(read_encoded_value): Likewise.
2010-05-25 16:41:46 +00:00
Tom Tromey d3b1e87423 gdb
* dwarf2loc.c (extract_bits_primitive): New function.
	(extract_bits): Likewise.
	(insert_bits): Likewise.
	(copy_bitwise): Likewise.
	(read_pieced_value): Do all operations in bits.
	(write_pieced_value): Likewise.
	* dwarf2expr.h (struct dwarf_expr_piece) <offset>: New field.
	* dwarf2expr.c (add_piece): New arguments bit_piece, offset.
	Always use xrealloc to resize piece array.
	(execute_stack_op) <DW_OP_reg0>: Handle DW_OP_bit_piece.
	<DW_OP_piece>: Update.
	<DW_OP_bit_piece>: New case.
gdb/testsuite
	* gdb.dwarf2/pieces.exp (pieces_test_f3): New proc.
	Call it.
	* gdb.dwarf2/pieces.S: Update.
	* gdb.dwarf2/pieces.c (struct B): Remove initial field.
2010-05-21 21:13:13 +00:00
Tom Tromey cb82636715 gdb
* dwarf2loc.c (read_pieced_value): Exit loop when result is full.
	<DWARF_VALUE_OPTIMIZED_OUT>: New case.
	* dwarf2expr.h (enum dwarf_value_location)
	<DWARF_VALUE_OPTIMIZED_OUT>: New constant.
	* dwarf2expr.c (dwarf_expr_stack_empty_p): New function.
	(add_piece): Handle empty piece.
	(execute_stack_op) <DW_OP_piece>: Handle
	DWARF_VALUE_OPTIMIZED_OUT.
gdb/testsuite
	* gdb.dwarf2/pieces.exp (pieces_test_f6): New proc.
	Call it.
	* gdb.dwarf2/pieces.c (struct C): New.
	(f6): New function.
	* gdb.dwarf2/pieces.S: Replace.
2010-05-21 21:01:46 +00:00
Tom Tromey afd74c5ff7 gdb
* dwarf2loc.c (read_pieced_value): Work properly when 'v' has an
	offset.
	(write_pieced_value): Likewise.
gdb/testsuite
	* gdb.dwarf2.pieces.exp: New file.
	* gdb.dwarf2.pieces.S: New file.
	* gdb.dwarf2.pieces.c: New file.
2010-05-21 20:39:50 +00:00
Michael Snyder 9a619af0d3 2010-05-14 Michael Snyder <msnyder@vmware.com>
* dbxread.c: White space.
	* dcache.c: White space.
	* disasm.c: White space.
	* doublest.c: White space.
	* dsrec.c: White space.
	* dummy-frame.c: White space.
	* dwarf2expr.c: White space.
	* dwarf2-frame.c: White space.
	* dwarf2loc.c: White space.
	* dwarf2read.c: White space.
2010-05-14 17:53:16 +00:00
Jan Kratochvil a2d33775a1 gdb/
Code cleanup.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc): Change the parameter to type.
	(locexpr_read_variable, loclist_read_variable): Update the callers.
2010-05-13 15:44:35 +00:00
Matthew Gretton-Dann 63b4f126d1 * gdb/dwarf2loc.c (read_pieced_value, write_pieced_value,
dwarf2_evaluate_loc_desc): Handle not being able to access DWARF
	registers gracefully.
2010-05-04 09:54:18 +00:00
Stan Shebs 08922a1050 2010-04-20 Stan Shebs <stan@codesourcery.com>
Nathan Sidwell  <nathan@codesourcery.com>

	* dwarf2loc.c (struct axs_var_loc): New struct.
	(dwarf2_tracepoint_var_loc): New function.
	(dwarf2_tracepoint_var_access): New function.
	(dwarf2_tracepoint_var_ref): Use dwarf2_tracepoint_var_loc, deal
	with DW_OP_piece.
	(locexpr_describe_location_piece): New function.
	(locexpr_describe_location_1): New function.
	(locexpr_describe_location): Call it, update signature.
	(loclist_describe_location): Rewrite to loop over locations,
	update signature.
	* symtab.h (struct symbol_computed_ops): Add address to
	describe_location arguments, return void.
	* printcmd.c (address_info): Get context PC, pass to computed
	location description.
	* tracepoint.c (scope_info): Ditto.
	* ax-gdb.c (trace_kludge): Export.
2010-04-20 18:52:59 +00:00
Stan Shebs 400c6af037 2010-03-17 Stan Shebs <stan@codesourcery.com>
* ax-gdb.h (struct axs_value): New field optimized_out.
	(gen_trace_for_var): Add gdbarch argument.
	* ax-gdb.c (gen_trace_static_fields): New function.
	(gen_traced_pop): Call it, add gdbarch argument.
	(gen_trace_for_expr): Update call to it.
	(gen_trace_for_var): Ditto, and report optimized-out variables.
	(gen_struct_ref_recursive): Check for optimized-out value.
	(gen_struct_elt_for_reference): Ditto.
	(gen_static_field): Pass gdbarch instead of expression, assume
	optimization if field not found.
	(gen_var_ref): Set the optimized_out flag.
	(gen_expr): Error on optimized-out variable.
	* tracepoint.c (collect_symbol): Handle struct-valued vars as
	expressions, skip optimized-out variables with computed locations.
	* dwarf2loc.c (dwarf2_tracepoint_var_ref): Flag instead of
	erroring out if location expression missing.
	(loclist_tracepoint_var_ref): Don't error out here.
2010-03-17 22:04:43 +00:00
Ulrich Weigand 6063c216d5 * dwarf2loc.c (struct piece_closure): Remove ARCH member,
add ADDR_SIZE member.
	(allocate_piece_closure): Update.
	(copy_pieced_value_closure): Likewise.
	(dwarf2_evaluate_loc_desc): Likewise.
	(read_pieced_value): Use DWARF address size instead of
	GDB's gdbarch_addr_bit as size of values on the DWARF stack.
2010-02-26 12:48:18 +00:00
Tom Tromey 05566b3b85 * dwarf2loc.c (read_pieced_value) <DWARF_VALUE_STACK>: Correctly
handle big-endian values.
	(dwarf2_evaluate_loc_desc) <DWARF_VALUE_STACK>: Likewise.
2010-02-23 16:14:36 +00:00
Ulrich Weigand dcbf108f79 * dwarf2loc.c (read_pieced_value): If a piece occupies part of
a register, assume the least-signficant part is used.
	(write_pieced_value): Likewise.
2010-01-04 14:56:16 +00:00
Joel Brobecker 4c38e0a4fc Update copyright year in most headers.
Automatic update by copyright.sh.
2010-01-01 07:32:07 +00:00
Stan Shebs 0936ad1d22 2009-12-23 Stan Shebs <stan@codesourcery.com>
* ax-gdb.h (gen_trace_for_var): Declare.
	* ax-gdb.c (gen_trace_for_var): New function.
	* dwarf2loc.c (dwarf_expr_frame_base_1): New function, split from...
	(dwarf_expr_frame_base): ...here.
	(dwarf2_tracepoint_var_ref): Add computed location case.
	* tracepoint.c (collect_symbol): Add scope arg and LOC_COMPUTED
	case.
	(add_local_symbols): Update call to collect_symbol.
	(encode_actions): Ditto.
2009-12-24 00:40:49 +00:00
Doug Evans 44353522ec * dwarf2expr.h (dwarf_value_location): Add more comments describing
enum values.
	(struct dwarf_stack_value): New struct.
	(struct dwarf_expr_context): Change type of `stack' from CORE_ADDR*
	to struct dwarf_stack_value*.
	(struct dwarf_expr_piece): Move `v.value' into its own struct, v.expr,
	all uses updated.  Add v.expr.in_stack_memory.
	(dwarf_expr_push): Update declaration.
	(dwarf_expr_fetch_in_stack_memory): Declare.
	* dwarf2expr.c (dwarf_expr_grow_stack): Update calculation of
	size of stack value.
	(dwarf_expr_push): New arg in_stack_memory, all callers updated.
	(dwarf_expr_fetch_in_stack_memory): New function.
	(add_piece): Set in_stack_memory for non-literal values.
	(execute_stack_op): Allow ops to specify whether the value is on the
	program's stack.
	(execute_stack_op, case DW_OP_fbreg): Mark value as in stack memory.
	(execute_stack_op, case DW_OP_call_frame_cfa): Ditto.
	(execute_stack_op, case DW_OP_dup): Copy in_stack_memory flag.
	(execute_stack_op, cases DW_OP_pick, DW_OP_over): Ditto.
	(execute_stack_op, cases DW_OP_swap, DW_OP_rot): Update type of
	dwarf stack value.
	* dwarf2loc.c (read_pieced_value): Call read_stack for values known
	to be on the program's stack.
	(dwarf2_evaluate_loc_desc, case DWARF_VALUE_MEMORY): Call
	set_value_stack only for objects known to be in stack memory.
	* dwarf2-frame.c (execute_stack_op): New arg initial_in_stack_memory,
	all callers updated.
2009-09-15 16:20:53 +00:00
Tom Tromey cec03d703f gdb
* dwarf2loc.c (struct piece_closure) <arch>: New field.
	(dwarf2_evaluate_loc_desc): Update.
	(dwarf2_loc_desc_needs_frame): Likewise.
	(allocate_piece_closure): Initialize new field.
	(read_pieced_value): Update.
	(write_pieced_value): Update.
	(copy_pieced_value_closure): Update.
	* dwarf2expr.h (enum dwarf_value_location): New.
	(struct dwarf_expr_context) <in_reg>: Remove.
	<location, len, data>: New fields.
	(struct dwarf_expr_piece) <in_reg, value>: Remove.
	<location, v>: New fields.
	* dwarf2expr.c (add_piece): Remove in_reg, value arguments.
	Update.
	(require_composition): New function.
	(execute_stack_op): Update.
	<DW_OP_implicit_value, DW_OP_stack_value>: New cases.
	<DW_OP_reg0>: Set location, not in_reg.
	<DW_OP_regx>: Likewise.  Use require_composition.
	<DW_OP_fbreg>: Update.
	<DW_OP_piece>: Likewise.
	* dwarf2-frame.c (execute_stack_op): Update.
gdb/testsuite
	* gdb.dwarf2/valop.S: New file.
	* gdb.dwarf2/valop.exp: New file.
2009-09-11 18:38:39 +00:00
Nathan Froyd 052b950219 * dwarf2loc.c (struct piece_closure): New.
(allocate_piece_closure): New function.
	(read_pieced_value): New function.
	(write_pieced_value): New function.
	(copy_pieced_value_closure): New function.
	(free_pieced_value_closure): New function.
	(pieced_value_funcs): Define.
	(dwarf2_evaluate_loc_desc): Return a computed value for a variable
	described with pieces.
2009-09-04 20:05:25 +00:00
Tom Tromey e78022079c gdb
* frame.h (frame_unwinder_is): Declare.
	* frame.c (frame_unwinder_is): New function.
	* dwarf2loc.c: Include dwarf2-frame.h.
	(dwarf_expr_frame_cfa): New function.
	(dwarf2_evaluate_loc_desc): Use it.
	(needs_frame_frame_cfa): New function.
	(dwarf2_loc_desc_needs_frame): Use it.
	* dwarf2expr.h (struct dwarf_expr_context) <get_frame_cfa>: New
	field.
	* dwarf2expr.c (execute_stack_op) <DW_OP_call_frame_cfa>: New
	case.
	* dwarf2-frame.h (dwarf2_frame_cfa): Declare.
	* dwarf2-frame.c (no_get_frame_cfa): New function.
	(execute_stack_op): Use it.
	(dwarf2_frame_cfa): New function.
gdb/testsuite
	* gdb.dwarf2/callframecfa.exp: New file.
	* gdb.dwarf2/callframecfa.S: New file.
2009-09-02 14:53:57 +00:00
Doug Evans 4e5d721fc0 Implement TARGET_OBJECT_STACK_MEMORY.
* NEWS: Add note on new "set stack-cache" option.
	* corefile.c (read_stack): New function.
	* dcache.c (dcache_struct): New member ptid.
	(dcache_enable_p): Mark as obsolete.
	(show_dcache_enabled_p): Flag option as deprecated.
	(dcache_invalidate): Update ptid.
	(dcache_invalidate_line): New function.
	(dcache_read_line): No longer check cacheable attribute, stack
	accesses get cached despite attribute.
	(dcache_init): Set ptid.
	(dcache_xfer_memory): Flush cache if from different ptid than before.
	Update cache after write.
	(dcache_update): New function.
	(dcache_info): Report ptid.
	(_initialize_dcache): Update text for `remotecache' to indicate it
	is obsolete.
	* dcache.h (dcache_update): Declare.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc): Mark values on stack with
	set_value_stack.
	* frame-unwind.c (frame_unwind_got_memory): Ditto.
	* gdbcore.h (read_stack): Declare.
	* memattr.c (mem_enable_command): Call target_dcache_invalidate
	instead of dcache_invalidate.
	(mem_disable_command, mem_delete_command): Ditto.
	* target.c (stack_cache_enabled_p_1): New static global.
	(stack_cache_enabled_p): New static global.
	(set_stack_cache_enabled_p): New function.
	(show_stack_cache_enabled_p): New function.
	(target_dcache): Make static.
	(target_dcache_invalidate): New function.
	(target_load, target_resume): Call target_dcache_invalidate
	instead of dcache_invalidate.
	(memory_xfer_partial): New arg object, all callers updated.
	Check for existing inferior before calling dcache routines.
	When writing non-TARGET_OBJECT_STACK_MEMORY, notify dcache.
	(target_xfer_partial): Call memory_xfer_partial for
	TARGET_OBJECT_STACK_MEMORY.
	(target_read_stack): New function.
	(initialize_targets): Install new option `stack-cache'.
	* target.h: Remove #include of dcache.h.
	(enum target_object): New value TARGET_OBJECT_STACK_MEMORY.
	(target_dcache): Delete.
	(target_dcache_invalidate): Declare.
	(target_read_stack): Declare.
	* top.c (prepare_execute_command): New function.
	(execute_command): Call prepare_execute_command
	instead of free_all_values.
	* top.h (prepare_execute_command): Declare.
	* valops.c (get_value_at): New function.
	(value_at): Guts moved to get_value_at.
	(value_at_lazy): Similarly.
	(value_fetch_lazy): Call read_stack for stack values.
	* value.c (struct value): New member `stack'.
	(value_stack, set_value_stack): New functions.
	* value.h (value_stack, set_value_stack): Declare.
	* mi/mi-main.c (mi_cmd_execute): Call prepare_execute_command
	instead of free_all_values.

	doc/
	* gdb.texinfo (Caching Data of Remote Targets): Update text.
	Mark `set/show remotecache' options as obsolete.
	Document new `set/show stack-cache' option.
	Update text for `info dcache'.
2009-08-31 20:18:46 +00:00
Tom Tromey 4a22739830 * dwarf2loc.c (dwarf2_evaluate_loc_desc): Make a cleanup.
(dwarf2_loc_desc_needs_frame): Likewise.
	* dwarf2expr.h (make_cleanup_free_dwarf_expr_context): Declare.
	* dwarf2expr.c (free_dwarf_expr_context_cleanup): New function.
	(make_cleanup_free_dwarf_expr_context): Likewise.
	* dwarf2-frame.c (execute_stack_op): Make a cleanup.
2009-08-11 20:36:49 +00:00
Ulrich Weigand b5758fe446 * dwarf2loc.c (find_location_expression): Retrieve beginning and
ending address offsets in location list entries as integers,
	not as addresses.
2009-07-20 15:06:13 +00:00
Tom Tromey fa8f86ff3b bfd
* Makefile.am (dwarf2.lo): Use dwarf2.h, not elf/dwarf2.h.
	(elf-eh-frame.lo): Likewise.
	(elf32-bfin.lo): Likewise.
	(elf32-frv.lo): Likewise.
	(elf32-xc16x.lo): Likewise.
	* Makefile.in: Rebuild.
	* dwarf2.c: Included dwarf.h, not elf/dwarf2.h.
	* elf-eh-frame.c: Likewise.
	* elf32-bfin.c: Likewise.
	* elf32-frv.c: Likewise.
	* elf32-xc16x.c: Likewise.
binutils
	* Makefile.am (dwarf.o): Refer to dwarf2.h, not elf/dwarf2.h.
	* Makefile.in: Rebuild.
	* dwarf.c: Include dwarf2.h, not elf/dwarf2.h.
gas
	* Makefile.am (DEPTC_alpha_ecoff): Refer to dwarf2.h, not
	elf/dwarf2.h.
	(DEPTC_alpha_elf): Likewise.
	(DEPTC_alpha_evax): Likewise.
	(DEPTC_arm_elf): Likewise.
	(DEPTC_hppa_elf): Likewise.
	(DEPTC_i386_aout): Likewise.
	(DEPTC_i386_coff): Likewise.
	(DEPTC_i386_elf): Likewise.
	(DEPTC_m68k_aout): Likewise.
	(DEPTC_m68k_coff): Likewise.
	(DEPTC_m68k_elf): Likewise.
	(DEPTC_mips_coff): Likewise.
	(DEPTC_mips_ecoff): Likewise.
	(DEPTC_mips_elf): Likewise.
	(DEPTC_ppc_coff): Likewise.
	(DEPTC_ppc_elf): Likewise.
	(DEPTC_s390_elf): Likewise.
	(DEPTC_sh_coff): Likewise.
	(DEPTC_sh_elf): Likewise.
	(DEPTC_sh64_elf): Likewise.
	(DEPTC_sparc_aout): Likewise.
	(DEPTC_sparc_coff): Likewise.
	(DEPTC_sparc_elf): Likewise.
	(as.o): Likewise.
	(dwarf2dbg.o): Likewise.
	(dw2gencfi.o): Likewise.
	(ehopt.o): Likewise.
	(read.o): Likewise.
	* Makefile.in: Rebuild.
	* dw2gencfi.h: Include dwarf2.h, not elf/dwarf2.h.
	* dwarf2dbg.c: Likewise.
	* ehopt.c: Likewise.
gdb
	* dwarf2-frame.c: Include dwarf2.h, not elf/dwarf2.h.
	* dwarf2expr.c: Likewise.
	* dwarf2loc.c: Likewise.
	* dwarf2read.c: Likewise.
	* sh-tdep.c: Likewise.
	* xtensa-tdep.c: Likewise.
include
	* dwarf2.h: New file, moved from elf/.
include/elf

	* dwarf2.h: Move to `..'.
2009-07-10 15:27:04 +00:00
Ulrich Weigand e17a411335 * defs.h (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer, store_signed_integer,
	store_unsigned_integer): Add BYTE_ORDER parameter.
	* findvar.c (extract_signed_integer, extract_unsigned_integer,
	extract_long_unsigned_integer, store_signed_integer,
	store_unsigned_integer): Add BYTE_ORDER parameter.  Use it
	instead of current_gdbarch.

	* gdbcore.h (read_memory_integer, safe_read_memory_integer,
	read_memory_unsigned_integer, write_memory_signed_integer,
	write_memory_unsigned_integer): Add BYTE_ORDER parameter.
	* corefile.c (struct captured_read_memory_integer_arguments): Add
	BYTE_ORDER member.
	(safe_read_memory_integer): Add BYTE_ORDER parameter.  Store it into
	struct captured_read_memory_integer_arguments.
	(do_captured_read_memory_integer): Pass it to read_memory_integer.
	(read_memory_integer): Add BYTE_ORDER parameter.  Pass it to
	extract_signed_integer.
	(read_memory_unsigned_integer): Add BYTE_ORDER parameter.  Pass it to
	extract_unsigned_integer.
	(write_memory_signed_integer): Add BYTE_ORDER parameter.  Pass it
	to store_signed_integer.
	(write_memory_unsigned_integer): Add BYTE_ORDER parameter.  Pass it
	to store_unsigned_integer.

	* target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter.
	* target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter.
	Pass it to extract_unsigned_integer.


	Update calls to extract_signed_integer, extract_unsigned_integer,
	extract_long_unsigned_integer, store_signed_integer,
	store_unsigned_integer, read_memory_integer,
	read_memory_unsigned_integer, safe_read_memory_integer,
	write_memory_signed_integer, write_memory_unsigned_integer, and
	get_target_memory_unsigned to pass byte order:
	* ada-lang.c (ada_value_binop): Update.
	* ada-valprint.c (char_at): Update.
	* alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update.
	* alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call,
	alpha_extract_return_value, alpha_read_insn,
	alpha_get_longjmp_target): Update.
	* amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update.
	* amd64obsd-tdep.c (amd64obsd_supply_uthread,
	amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update.
	* amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue,
	amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel,
	amd64_displaced_step_fixup): Update.
	* arm-linux-tdep.c (arm_linux_sigreturn_init,
	arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update.
	* arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue,
	arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc,
	arm_get_next_pc, arm_extract_return_value, arm_store_return_value,
	arm_return_value): Update.
	* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update.
	* auxv.c (default_auxv_parse): Update.
	* avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address,
	avr_scan_prologue, avr_extract_return_value,
	avr_frame_prev_register, avr_push_dummy_call): Update.
	* bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset,
	bsd_uthread_wait, bsd_uthread_thread_alive,
	bsd_uthread_extra_thread_info): Update.
	* c-lang.c (c_printstr, print_wchar): Update.
	* cp-valprint.c (cp_print_class_member): Update.
	* cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache,
	cris_push_dummy_call, cris_scan_prologue, cris_store_return_value,
	cris_extract_return_value, find_step_target, dip_prefix,
	sixteen_bit_offset_branch_op, none_reg_mode_jump_op,
	move_mem_to_reg_movem_op, get_data_from_address): Update.
	* dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update.
	* dwarf2-frame.c (execute_cfa_program): Update.
	* dwarf2loc.c (find_location_expression): Update.
	* dwarf2read.c (dwarf2_const_value): Update.
	* expprint.c (print_subexp_standard): Update.
	* findvar.c (unsigned_pointer_to_address, signed_pointer_to_address,
	unsigned_address_to_pointer, address_to_signed_pointer,
	read_var_value): Update.
	* frame.c (frame_unwind_register_signed,
	frame_unwind_register_unsigned, get_frame_memory_signed,
	get_frame_memory_unsigned): Update.
	* frame-unwind.c (frame_unwind_got_constant): Update.
	* frv-linux-tdep.c (frv_linux_pc_in_sigtramp,
	frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache):
	Update.
	* frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue,
	frv_extract_return_value, find_func_descr,
	frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update.
	* f-valprint.c (f_val_print): Update.
	* gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr):
	Update.
	* h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue,
	h8300_push_dummy_call, h8300_extract_return_value,
	h8300h_extract_return_value, h8300_store_return_value,
	h8300h_store_return_value): Update.
	* hppabsd-tdep.c (hppabsd_find_global_pointer): Update.
	* hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register):
	Update.
	* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline,
	hppa64_hpux_in_solib_call_trampoline,
	hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code,
	hppa_hpux_sigtramp_frame_unwind_cache,
	hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer,
	hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern,
	hppa32_hpux_search_dummy_call_sequence,
	hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state,
	hppa_hpux_unwind_adjust_stub): Update.
	* hppa-linux-tdep.c (insns_match_pattern,
	hppa_linux_find_global_pointer): Update.
	* hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call,
	hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call,
	skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache,
	hppa_pseudo_register_read, hppa_frame_prev_register_helper,
	hppa_match_insns): Update.
	* hpux-thread.c (hpux_thread_fetch_registers): Update.
	* i386-tdep.c (i386bsd_sigcontext_addr): Update.
	* i386-cygwin-tdep.c (core_process_module_section): Update.
	* i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn,
	amd64_darwin_sstep_at_sigreturn): Update.
	* i386-darwin-tdep.c (i386_darwin_sigcontext_addr,
	amd64_darwin_sigcontext_addr): Likewise.
	* i386-linux-nat.c (i386_linux_sigcontext_addr): Update.
	* i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update.
	* i386-nto-tdep.c (i386nto_sigcontext_addr): Update.
	* i386obsd-nat.c (i386obsd_supply_pcb): Update.
	* i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread,
	i386obsd_trapframe_cache): Update.
	* i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump,
	i386_analyze_frame_setup, i386_analyze_prologue,
	i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache,
	i386_get_longjmp_target, i386_push_dummy_call,
	i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr,
	i386_fetch_pointer_argument): Update.
	* i387-tdep.c (i387_supply_fsave): Update.
	* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update.
	* ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write,
	examine_prologue, ia64_frame_cache, ia64_frame_prev_register,
	ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register,
	ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id,
	ia64_libunwind_frame_prev_register,
	ia64_libunwind_sigtramp_frame_this_id,
	ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer,
	find_extant_func_descr, find_func_descr,
	ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id,
	ia64_unwind_pc): Update.
	* iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer,
	iq2000_scan_prologue, iq2000_extract_return_value,
	iq2000_push_dummy_call): Update.
	* irix5nat.c (fill_gregset): Update.
	* jv-lang.c (evaluate_subexp_java): Update.
	* jv-valprint.c (java_value_print): Update.
	* lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call,
	lm32_extract_return_value, lm32_store_return_value): Update.
	* m32c-tdep.c (m32c_push_dummy_call, m32c_return_value,
	m32c_skip_trampoline_code, m32c_m16c_address_to_pointer,
	m32c_m16c_pointer_to_address): Update.
	* m32r-tdep.c (m32r_store_return_value, decode_prologue,
	m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value):
	Update.
	* m68hc11-tdep.c (m68hc11_pseudo_register_read,
	m68hc11_pseudo_register_write, m68hc11_analyze_instruction,
	m68hc11_push_dummy_call): Update.
	* m68linux-tdep.c (m68k_linux_pc_in_sigtramp,
	m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache):
	Update.
	* m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup,
	m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache,
	m68k_get_longjmp_target): Update.
	* m88k-tdep.c (m88k_fetch_instruction): Update.
	* mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write,
	mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update.
	* mi/mi-main.c (mi_cmd_data_write_memory): Update.
	* mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg,
	mips64_linux_get_longjmp_target, mips64_fill_gregset,
	mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update.
	* mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update.
	* mips-tdep.c (mips_fetch_instruction, fetch_mips_16,
	mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call,
	mips_o32_push_dummy_call, mips_o64_push_dummy_call,
	mips_single_step_through_delay, mips_skip_pic_trampoline_code,
	mips_integer_to_address): Update.
	* mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call):
	Update.
	* monitor.c (monitor_supply_register, monitor_write_memory,
	monitor_read_memory_single): Update.
	* moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value,
	moxie_analyze_prologue): Update.
	* mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor,
	mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info,
	mt_push_dummy_call): Update.
	* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
	read_objc_methlist_method, read_objc_object, read_objc_super,
	read_objc_class, find_implementation_from_class): Update.
	* ppc64-linux-tdep.c (ppc64_desc_entry_point,
	ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache):
	Update.
	* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer,
	ppcobsd_sigtramp_frame_cache): Update.
	* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
	do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
	ppc64_sysv_abi_return_value): Update.
	* ppc-linux-nat.c (ppc_linux_auxv_parse): Update.
	* procfs.c (procfs_auxv_parse): Update.
	* p-valprint.c (pascal_val_print): Update.
	* regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned,
	regcache_raw_write_signed, regcache_raw_write_unsigned,
	regcache_cooked_read_signed, regcache_cooked_read_unsigned,
	regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update.
	* remote-m32r-sdi.c (m32r_fetch_register): Update.
	* remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory):
	Update.
	* rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value,
	rs6000_convert_from_func_ptr_addr, branch_dest,
	rs6000_software_single_step): Update.
	* rs6000-tdep.c (rs6000_in_function_epilogue_p,
	ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence,
	bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue,
	rs6000_skip_main_prologue, rs6000_skip_trampoline_code,
	rs6000_frame_cache): Update.
	* s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write,
	s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load,
	s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache,
	extend_simple_arg, s390_push_dummy_call, s390_return_value): Update.
	* scm-exp.c (scm_lreadr): Update.
	* scm-lang.c (scm_get_field, scm_unpack): Update.
	* scm-valprint.c (scm_val_print): Update.
	* score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call,
	score_fetch_inst): Update.
	* sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way,
	sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value,
	sh64_pseudo_register_read, sh64_pseudo_register_write,
	sh64_frame_prev_register): Update:
	* sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu,
	sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu,
	sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update.
	* solib-darwin.c (darwin_load_image_infos): Update.
	* solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2,
	find_canonical_descriptor_in_load_object): Update.
	* solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos,
	irix_open_symbol_file_object): Update.
	* solib-som.c (som_solib_create_inferior_hook, link_map_start,
	som_current_sos, som_open_symbol_file_object): Update.
	* solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME):
	Update.
	* solib-svr4.c (read_program_header, scan_dyntag_auxv,
	solib_svr4_r_ldsomap): Update.
	* sparc64-linux-tdep.c (sparc64_linux_step_trap): Update.
	* sparc64obsd-tdep.c (sparc64obsd_supply_uthread,
	sparc64obsd_collect_uthread): Update.
	* sparc64-tdep.c (sparc64_pseudo_register_read,
	sparc64_pseudo_register_write, sparc64_supply_gregset,
	sparc64_collect_gregset): Update.
	* sparc-linux-tdep.c (sparc32_linux_step_trap): Update.
	* sparcobsd-tdep.c (sparc32obsd_supply_uthread,
	sparc32obsd_collect_uthread): Update.
	* sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code,
	sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow,
	sparc_collect_rwindow): Update.
	* spu-linux-nat.c (parse_spufs_run): Update.
	* spu-tdep.c (spu_pseudo_register_read_spu,
	spu_pseudo_register_write_spu, spu_pointer_to_address,
	spu_analyze_prologue, spu_in_function_epilogue_p,
	spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step,
	spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect,
	info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist,
	info_spu_dma_command, info_spu_proxydma_command): Update.
	* stack.c (print_frame_nameless_args, frame_info): Update.
	* symfile.c (read_target_long_array, simple_read_overlay_table,
	simple_read_overlay_region_table): Update.
	* target.c (debug_print_register): Update.
	* tramp-frame.c (tramp_frame_start): Update.
	* v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call,
	v850_extract_return_value, v850_store_return_value,
	* valarith.c (value_binop, value_bit_index): Update.
	* valops.c (value_cast): Update.
	* valprint.c (val_print_type_code_int, val_print_string,
	read_string): Update.
	* value.c (unpack_long, unpack_double, unpack_field_as_long,
	modify_field, pack_long): Update.
	* vax-tdep.c (vax_store_arguments, vax_push_dummy_call,
	vax_skip_prologue): Update.
	* xstormy16-tdep.c (xstormy16_push_dummy_call,
	xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p,
	xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry,
	xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update.
	* xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read,
	xtensa_pseudo_register_write, xtensa_frame_cache,
	xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update.


	* dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral,
	decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add
	BYTE_ORDER parameter.
	(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
	parameters.
	(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
	(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
	* dfp.c (match_endianness): Add BYTE_ORDER parameter.  Use it
	instead of current_gdbarch.
	(decimal_to_string, decimal_from_integral, decimal_from_floating,
	decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter.
	Pass it to match_endianness.
	(decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT
	parameters.  Pass them to match_endianness.
	(decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters.
	Pass them to match_endianness.
	(decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters.
	Pass them to match_endianness.
	* valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and
	BYTE_ORDER_Y output parameters.
	(value_binop): Update call to value_args_as_decimal.

	Update calls to decimal_to_string, decimal_from_string,
	decimal_from_integral, decimal_from_floating, decimal_to_doublest,
	decimal_is_zero, decimal_binop, decimal_compare and decimal_convert
	to pass/receive byte order:
	* c-exp.y (parse_number): Update.
	* printcmd.c (printf_command): Update.
	* valarith.c (value_args_as_decimal, value_binop, value_logical_not,
	value_equal, value_less): Update.
	* valops.c (value_cast, value_one): Update.
	* valprint.c (print_decimal_floating): Update.
	* value.c (unpack_long, unpack_double): Update.
	* python/python-value.c (valpy_nonzero): Update.


	* ada-valprint.c (char_at): Add BYTE_ORDER parameter.
	(printstr): Update calls to char_at.
	(ada_val_print_array): Likewise.
	* valprint.c (read_string): Add BYTE_ORDER parameter.
	(val_print_string): Update call to read_string.
	* c-lang.c (c_get_string): Likewise.
	* charset.h (target_wide_charset): Add BYTE_ORDER parameter.
	* charset.c (target_wide_charset): Add BYTE_ORDER parameter.
	Use it instead of current_gdbarch.
	* printcmd.c (printf_command): Update calls to target_wide_charset.
	* c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter.
	Pass to target_wide_charset.  Use it instead of current_gdbarch.
	(classify_type): Add BYTE_ORDER parameter.  Pass to
	charset_for_string_type.  Allow NULL encoding pointer.
	(print_wchar): Add BYTE_ORDER parameter.
	(c_emit_char): Update calls to classify_type and print_wchar.
	(c_printchar, c_printstr): Likewise.


	* gdbarch.sh (in_solib_return_trampoline): Convert to type "m".
	* gdbarch.c, gdbarch.h: Regenerate.
	* arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH
	parameter.
	* arch-utils.c (generic_in_solib_return_trampoline): Likewise.
	* hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise.
	* rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise.
	(rs6000_skip_trampoline_code): Update call.

	* alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
	dynamic_sigtramp_offset and pc_in_sigtramp callbacks.
	(alpha_read_insn): Add GDBARCH parameter.
	* alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter.
	(alpha_register_to_value): Pass architecture to alpha_sts.
	(alpha_extract_return_value): Likewise.
	(alpha_value_to_register): Pass architecture to alpha_lds.
	(alpha_store_return_value): Likewise.
	(alpha_read_insn): Add GDBARCH parameter.
	(alpha_skip_prologue): Pass architecture to alpha_read_insn.
	(alpha_heuristic_proc_start): Likewise.
	(alpha_heuristic_frame_unwind_cache): Likewise.
	(alpha_next_pc): Likewise.
	(alpha_sigtramp_frame_this_id): Pass architecture to
	tdep->dynamic_sigtramp_offset callback.
	(alpha_sigtramp_frame_sniffer): Pass architecture to
	tdep->pc_in_sigtramp callback.
	* alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter.
	(alphafbsd_sigtramp_offset): Likewise.
	* alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH
	parameter.  Pass to alpha_read_insn.
	(alpha_linux_sigtramp_offset): Add GDBARCH parameter.  Pass to
	alpha_linux_sigtramp_offset_1.
	(alpha_linux_pc_in_sigtramp): Add GDBARCH parameter.  Pass to
	alpha_linux_sigtramp_offset.
	(alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn
	and alpha_linux_sigtramp_offset.
	* alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter.
	(alphanbsd_pc_in_sigtramp): Add GDBARCH parameter.  Pass to
	alphanbsd_sigtramp_offset.
	* alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter.
	(alphaobsd_pc_in_sigtramp): Add GDBARCH parameter.  Pass to
	alpha_read_insn.
	(alphaobsd_sigcontext_addr): Pass architecture to
	alphaobsd_sigtramp_offset.
	* alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH
	parameter.

	* amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter.
	(amd64_skip_prologue): Pass architecture to amd64_analyze_prologue.
	(amd64_frame_cache): Likewise.

	* arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove.
	(thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue,
	thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros.
	* arm-wince-tdep.c: Include "frame.h".

	* avr-tdep.c (EXTRACT_INSN): Remove.
	(avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN.
	(avr_skip_prologue): Pass architecture to avr_scan_prologue.
	(avr_frame_unwind_cache): Likewise.

	* cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member.
	(find_step_target): Initialize it.
	(get_data_from_address): Add BYTE_ORDER parameter.
	(bdap_prefix): Pass byte order to get_data_from_address.
	(handle_prefix_assign_mode_for_aritm_op): Likewise.
	(three_operand_add_sub_cmp_and_or_op): Likewise.
	(handle_inc_and_index_mode_for_aritm_op): Likewise.

	* frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter.
	(frv_linux_sigcontext_reg_addr): Pass architecture to
	frv_linux_pc_in_sigtramp.
	(frv_linux_sigtramp_frame_sniffer): Likewise.

	* h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter.
	(h8300_analyze_prologue): Add GDBARCH parameter.  Pass to
	h8300_is_argument_spill.
	(h8300_frame_cache, h8300_skip_prologue): Pass architecture
	to h8300_analyze_prologue.

	* hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to
	in_solib_call_trampoline callback.
	(hppa_in_solib_call_trampoline): Add GDBARCH parameter.
	* hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH
	parameter.
	(hppa64_push_dummy_call): Pass architecture to
	hppa64_convert_code_addr_to_fptr.
	(hppa_match_insns): Add GDBARCH parameter.
	(hppa_match_insns_relaxed): Add GDBARCH parameter.  Pass to
	hppa_match_insns.
	(hppa_skip_trampoline_code): Pass architecture to hppa_match_insns.
	(hppa_in_solib_call_trampoline): Add GDBARCH parameter.  Pass to
	hppa_match_insns_relaxed.
	(hppa_stub_unwind_sniffer): Pass architecture to
	tdep->in_solib_call_trampoline callback.
	* hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter.
	(hppa32_hpux_search_dummy_call_sequence): Pass architecture to
	hppa_hpux_search_pattern.
	* hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter.
	(hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter.
	Pass to insns_match_pattern.
	(hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to
	hppa_linux_sigtramp_find_sigcontext.
	(hppa_linux_sigtramp_frame_sniffer): Likewise.
	(hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter.
	(hppa64_hpux_in_solib_call_trampoline): Likewise.

	* i386-tdep.c (i386_follow_jump): Add GDBARCH parameter.
	(i386_analyze_frame_setup): Add GDBARCH parameter.
	(i386_analyze_prologue): Add GDBARCH parameter.  Pass to
	i386_follow_jump and i386_analyze_frame_setup.
	(i386_skip_prologue): Pass architecture to i386_analyze_prologue
	and i386_follow_jump.
	(i386_frame_cache): Pass architecture to i386_analyze_prologue.
	(i386_pe_skip_trampoline_code): Add FRAME parameter.
	* i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter.
	* i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass
	frame to i386_pe_skip_trampoline_code.

	* ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter
	to sigcontext_register_address callback.
	* ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter.
	(ia64_find_unwind_table): Pass architecture to
	ia64_find_global_pointer.
	(find_extant_func_descr): Add GDBARCH parameter.
	(find_func_descr): Pass architecture to find_extant_func_descr
	and ia64_find_global_pointer.
	(ia64_sigtramp_frame_init_saved_regs): Pass architecture to
	tdep->sigcontext_register_address callback.
	* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add
	GDBARCH parameter.

	* iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter.
	(iq2000_frame_cache): Pass architecture to iq2000_scan_prologue.

	* lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter.
	(lm32_skip_prologue, lm32_frame_cache): Pass architecture to
	lm32_analyze_prologue.

	* m32r-tdep.c (decode_prologue): Add GDBARCH parameter.
	(m32r_skip_prologue): Pass architecture to decode_prologue.

	* m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter.
	(m68hc11_scan_prologue): Pass architecture to
	m68hc11_analyze_instruction.

	* m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter.
	(m68k_analyze_prologue): Pass architecture to
	m68k_analyze_frame_setup.

	* m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter.
	(m88k_analyze_prologue): Add GDBARCH parameter.  Pass byte order
	to m88k_fetch_instruction.
	(m88k_skip_prologue): Pass architecture to m88k_analyze_prologue.
	(m88k_frame_cache): Likewise.

	* mep-tdep.c (mep_get_insn): Add GDBARCH parameter.
	(mep_analyze_prologue): Pass architecture to mep_get_insn.

	* mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter.
	(mips32_next_pc): Pass architecture to mips_fetch_instruction.
	(deal_with_atomic_sequence): Likewise.
	(unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction.
	(mips16_scan_prologue): Likewise.
	(mips32_scan_prologue): Likewise.
	(mips16_in_function_epilogue_p): Likewise.
	(mips32_in_function_epilogue_p): Likewise.
	(mips_about_to_return): Likewise.
	(mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue.
	(mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue.
	(mips_skip_prologue): Pass architecture to mips16_scan_prologue
	and mips32_scan_prologue.
	(mips_in_function_epilogue_p): Pass architecture to
	mips16_in_function_epilogue_p and
	mips32_in_function_epilogue_p.
	(heuristic_proc_start): Pass architecture to mips_fetch_instruction
	and mips_about_to_return.
	(mips_skip_mips16_trampoline_code): Pass architecture to
	mips_fetch_instruction.
	(fetch_mips_16): Add GDBARCH parameter.
	(mips16_next_pc): Pass architecture to fetch_mips_16.
	(extended_mips16_next_pc): Pass architecture to unpack_mips16 and
	fetch_mips_16.

	* objc-lang.c (read_objc_method, read_objc_methlist_nmethods,
	read_objc_methlist_method, read_objc_object, read_objc_super,
	read_objc_class): Add GDBARCH parameter.
	(find_implementation_from_class): Add GDBARCH parameter, pass
	to read_objc_class, read_objc_methlist_nmethods, and
	read_objc_methlist_method.
	(find_implementation): Add GDBARCH parameter, pass to
	read_objc_object and find_implementation_from_class.
	(resolve_msgsend, resolve_msgsend_stret): Pass architecture
	to find_implementation.
	(resolve_msgsend_super, resolve_msgsend_super_stret): Pass
	architecture to read_objc_super and find_implementation_from_class.

	* ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter.
	(ppc64_standard_linkage1_target, ppc64_standard_linkage2_target,
	ppc64_standard_linkage3_target): Pass architecture to
	ppc64_desc_entry_point.
	* rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter.
	(skip_prologue): Pass byte order to bl_to_blrl_insn_p.
	(rs6000_fetch_instruction): Add GDBARCH parameter.
	(rs6000_skip_stack_check): Add GDBARCH parameter, pass to
	rs6000_fetch_instruction.
	(skip_prologue): Pass architecture to rs6000_fetch_instruction.

	* remote-mips.c (mips_store_word): Return old_contents as host
	integer value instead of target bytes.

	* s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member.
	(s390_analyze_prologue): Initialize it.
	(extend_simple_arg): Add GDBARCH parameter.
	(s390_push_dummy_call): Pass architecture to extend_simple_arg.

	* scm-lang.c (scm_get_field): Add BYTE_ORDER parameter.
	* scm-lang.h (scm_get_field): Add BYTE_ORDER parameter.
	(SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field.
	* scm-valprint.c (scm_scmval_print): Likewise.
	(scm_scmlist_print, scm_ipruk, scm_scmval_print): Define
	SCM_BYTE_ORDER.

	* sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter.
	(sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to
	look_for_args_moves.
	(sh64_skip_prologue): Pass architecture to
	sh64_skip_prologue_hard_way.
	* sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter.
	(sh_skip_prologue): Pass architecture to sh_analyze_prologue.
	(sh_frame_cache): Likewise.

	* solib-irix.c (extract_mips_address): Add GDBARCH parameter.
	(fetch_lm_info, irix_current_sos, irix_open_symbol_file_object):
	Pass architecture to extract_mips_address.

	* sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter.
	* sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter.
	(sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture
	to sparc_fetch_wcookie.
	(sparc32_frame_prev_register): Likewise.
	* sparc64-tdep.c (sparc64_frame_prev_register): Likewise.
	* sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise.
	* sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise.

	* spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter.
	(spu_skip_prologue): Pass architecture to spu_analyze_prologue.
	(spu_virtual_frame_pointer): Likewise.
	(spu_frame_unwind_cache): Likewise.
	(info_spu_mailbox_list): Add BYTE_ORER parameter.
	(info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list.
	(info_spu_dma_cmdlist): Add BYTE_ORER parameter.
	(info_spu_dma_command, info_spu_proxydma_command): Pass byte order
	to info_spu_dma_cmdlist.

	* symfile.c (read_target_long_array): Add GDBARCH parameter.
	(simple_read_overlay_table, simple_read_overlay_region_table,
	simple_overlay_update_1): Pass architecture to read_target_long_array.

	* v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter.
	(v850_frame_cache): Pass architecture to v850_analyze_prologue.

	* xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH
	parameter.
	(xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture
	to xstormy16_analyze_prologue.
	(xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter.
	(xstormy16_find_jmp_table_entry): Likewise.
	(xstormy16_skip_trampoline_code): Pass architecture to
	xstormy16_resolve_jmp_table_entry.
	(xstormy16_pointer_to_address): Likewise.
	(xstormy16_address_to_pointer): Pass architecture to
	xstormy16_find_jmp_table_entry.

	* xtensa-tdep.c (call0_track_op): Add GDBARCH parameter.
	(call0_analyze_prologue): Add GDBARCH parameter, pass to
	call0_track_op.
	(call0_frame_cache): Pass architecture to call0_analyze_prologue.
	(xtensa_skip_prologue): Likewise.
2009-07-02 17:25:59 +00:00
Ulrich Weigand 5af949e350 * defs.h (strlen_paddr, paddr, paddr_nz): Remove.
(paddress): Add GDBARCH parameter.
	* utils.c (strlen_paddr, paddr, paddr_nz): Remove.
	(paddress): Add GDBARCH parameter, use it instead of current_gdbarch.
	* ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter.
	* ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter,
	use it instead of current_gdbarch.

	Update calls to ui_out_field_core_addr to pass architecture:
	* ada-lang.c (print_one_exception): Update.
	* breakpoint.c (print_one_breakpoint_location,
	print_one_exception_catchpoint): Update.
	* disasm.c (dump_insns): Update.
	* darwin-nat-info.c (darwin_debug_regions_recurse): Update.
	* mi/mi-main.c (mi_cmd_data_read_memory): Update.
	* mi/mi-symbol-cmds.c: Include "objfiles.h".
	(mi_cmd_symbol_list_lines): Update.
	* stack.c (print_frame_info, print_frame): Update.

	Update callers of paddress to pass architecture:
	* ada-tasks.c (info_task): Update.
	* ada-valprint.c (ada_val_print_1): Update.
	* annotate.c (annotate_source, annotate_frame_begin): Update.
	* breakpoint.c (insert_bp_location, describe_other_breakpoints,
	mention): Update.
	* cli/cli-cmds.c (edit_command, list_command, print_disassembly):
	Update.
	* corefile.c (memory_error): Update.
	* c-valprint.c (print_function_pointer_address, c_val_print): Update.
	* disasm.c (dis_asm_print_address): Update.
	* exec.c (print_section_info): Update.
	* f-valprint.c (f_val_print): Update.
	* infcmd.c: Include "arch-utils.h".
	(jump_command, program_info): Update.
	* linux-fork.c: Include "arch-utils.h".
	(info_forks_command): Update.
	* m2-valprint.c (print_function_pointer_address,
	print_unpacked_pointer, print_variable_at_address,
	m2_val_print): Update.
	* m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command):
	Update.
	* printcmd.c (print_address, print_address_demangle, address_info):
	Update.
	* p-valprint.c (pascal_val_print): Update.
	* source.c: Include "arch-utils.h".
	(line_info): Update.
	* stack.c (frame_info, print_block_frame_labels): Update.
	* symfile.c (add_symbol_file_command, list_overlays_command): Update.
	* symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1,
	print_symbol, print_partial_symbols, maintenance_info_psymtabs,
	maintenance_check_symtabs): Update.
	* symtab.c (find_pc_sect_symtab): Update.
	* target.c (deprecated_debug_xfer_memory): Update.
	* tracepoint.c (scope_info): Update.
	* tui/tui-stack.c (tui_make_status_line): Update.
	* valprint.c (val_print_string): Update.

	Update callers of paddr_nz to use paddress instead (keeping
	user-visible output identical):
	* alpha-tdep.c (alpha_heuristic_proc_start): Update.
	* amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn,
	amd64_displaced_step_fixup): Update.
	* arch-utils.c (simple_displaced_step_copy_insn): Update.
	* auxv.c (fprint_target_auxv): Update.
	* breakpoint.c (insert_single_step_breakpoint): Update.
	* buildsym.c (finish_block): Update.
	* cli/cli-dump.c (restore_section_callback): Update.
	* fbsd-nat.c (fbsd_find_memory_regions): Update.
	* frame.c (frame_unwind_register_value): Update.
	* gcore.c (gcore_create_callback): Update.
	* hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update.
	* i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm,
	i386_record_lea_modrm_addr, i386_record_lea_modrm,
	i386_process_record): Update.
	* ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id,
	ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id,
	ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update.
	* infrun.c (displaced_step_prepare, displaced_step_fixup,
	handle_inferior_event, insert_step_resume_breakpoint_at_sal,
	insert_longjmp_resume_breakpoint): Update.
	* linux-nat.c (linux_nat_find_memory_regions): Update.
	* linux-record.c (record_linux_system_call): Update.
	* mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call,
	mips_n32n64_push_dummy_call, mips_o32_push_dummy_call,
	mips_o64_push_dummy_call): Update.
	* monitor.c (monitor_error, monitor_remove_breakpoint): Update.
	* record.c (record_arch_list_add_mem, record_wait,
	record_xfer_partial): Update.
	* remote-mips.c (mips_fetch_word, mips_check_lsi_error,
	mips_common_breakpoint): Update.
	* remote-sim.c (gdbsim_xfer_inferior_memory): Update.
	* rs6000-tdep.c (ppc_displaced_step_fixup): Update.
	* solib-som.c (som_current_sos): Update.
	* symfile.c (load_progress, generic_load): Update.
	* symfile-mem.c (add_vsyscall_page): Update.
	* valops.c (value_fetch_lazy): Update.
	* windows-tdep.c (windows_xfer_shared_library): Update.

	Update callers of paddr_nz to use paddress instead (changing
	user-visible output to make it more correct):
	* dwarf2loc.c (locexpr_describe_location): Update.
	* ia64-tdep.c (ia64_memory_insert_breakpoint,
	ia64_memory_remove_breakpoint): Update.
	* jv-valprint.c (java_value_print): Update.
	* m32c-tdep.c (m32c_m16c_address_to_pointer): Update.
	* monitor.c (monitor_read_memory): Update.

	Update callers of paddr to use paddress instead (changing
	user-visible output to make it more correct):
	* arm-tdep.c (arm_push_dummy_call): Update.
	* breakpoint.c (insert_bp_location, create_thread_event_breakpoint,
	create_breakpoint): Update.
	* darwin-nat-info.c (darwin_debug_regions): Update.
	* dcache.c (dcache_info): Update.
	* dsrec.c (load_srec, make_srec): Update.
	* dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program,
	dwarf2_frame_cache): Update.
	* gcore.c (gcore_copy_callback): Update.
	* gnu-nat.c (gnu_xfer_memory): Update.
	* mips-linux-nat.c (mips_show_dr): Update.
	* monitor.c (monitor_write_memory, monitor_insert_breakpoint,
	monitor_remove_breakpoint): Update.
	* remote.c (compare_sections_command): Update.
	* remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint,
	m32r_remove_breakpoint, m32r_insert_watchpoint,
	m32r_remove_watchpoint): Update.
	* sol-thread.c (info_cb): Update.
	* symfile.c (load_progress): Update.

	Update callers of paddress or paddr_nz to use hex_string instead
	(changes output of internal/error/debug messages only):
	* dwarf2read.c (dump_die_shallow): Update.
	* frame.c (fprint_field, fprint_frame, frame_pc_unwind,
	get_frame_func, create_new_frame): Update.
	* hppa-tdep.c (find_unwind_entry, unwind_command): Update.
	* ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x,
	ia64_get_dyn_info_list): Update.
	* maint.c (maintenance_translate_address): Update.
	* mi/mi-cmd-var.c (mi_cmd_var_create): Update.
	* target.c (target_flash_erase): Update.

	Update callers of paddr/paddr_nz to use phex/phex_nz instead,
	using an appropriate address size.  Remove use of strlen_paddr.
	* exec.c (exec_files_info): Update.
	* i386-nat.c (i386_show_dr): Update.
	* remote.c (remote_flash_erase): Update.
	* m32r-rom.c (m32r_load_section): Update.
	* monitor.c (monitor_vsprintf, monitor_store_register): Update.
	* remote.c (remote_check_symbols, remote_search_memory): Update.
	* remote-mips.c (mips_request, mips_common_breakpoint): Update.
	* scm-valprint.c (scm_ipruk, scm_scmval_print): Update.
	* sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update.
	* sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs,
	sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs,
	sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs,
	sh_dsp_show_regs): Update.
	* xcoffsolib.c (sharedlibrary_command): Update.


	* maint.c (maint_print_section_info): Add ADDR_SIZE parameter.
	Use hex_string_custom instead of paddr.
	(print_bfd_section_info): Pass address size.
	(print_objfile_section_info): Likewise.

	* annotate.h (annotate_source): Add GDBARCH parameter.
	(annotate_frame_begin): Likewise.
	* annotate.c (annotate_source): Add GDBARCH parameter.
	(annotate_frame_begin): Likewise.
	* source.c (identify_source_line): Update call to annotate_source.
	* stack.c (print_frame_info, print_frame): Update call to
	annotate_frame_begin.

	* breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter.
	(create_breakpoint, create_ada_exception_breakpoint): Update call.

	* stack.c (print_block_frame_labels): Add GDBARCH parameter.
	(print_frame_label_vars): Update call.

	* symmisc.c (print_partial_symbols): Add GDBARCH parameter.
	(dump_psymtab): Update call to print_partial_symbols.
	(struct print_symbol_args): Add GDBARCH member.
	(dump_symtab_1): Set print_symbol_args architecture member.
	(print_symbol): Use it.

	* windows-tdep.h (windows_xfer_shared_library): Add GDBARCH
	parameter.
	* windows-tdep.c (windows_xfer_shared_library): Likewise.
	* i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member.
	(core_process_module_section): Pass architecture from cpms_data to
	windows_xfer_shared_library.
	(windows_core_xfer_shared_libraries): Initialize cmps_data
	architecture member.
	* windows-nat.c (windows_xfer_shared_libraries): Pass architecture
	to windows_xfer_shared_library.

	* defs.h (print_address): Add GDBARCH parameter.
	* printcmd.c (print_address): Add GDBARCH parameter.
	(print_scalar_formatted, do_examine): Update call.
	* findcmd.c (find_command): Update call.
	* tracepoint.c: Include "arch-utils.h".
	(trace_find_line_command): Update call.
	* tui/tui-disasm.c (tui_disassemble): Update call.

	* value.h (print_address_demangle): Add GDBARCH parameter.
	* printcmd.c (print_address_demangle): Add GDBARCH parameter.
	* c-valprint.c (print_function_pointer_address, c_val_print):
	Update call.
	* f-valprint.c (f_val_print): Update call.
	* gnu-v3-abi.c (gnuv3_print_method_ptr): Update call.
	* jv-valprint.c (java_val_print): Update call.
	* m2-valprint.c (print_function_pointer_address, m2_val_print):
	Update call.
	* p-valprint.c (pascal_val_print): Update call.

	* disasm.c (gdb_disassemble_info): Install architecture into
	di.application_data field.

testsuite/ChangeLog:

	* gdb.threads/tls-shared.exp: Update to locexpr_describe_location
	change to prefix TLS offset in hex with 0x.

doc/ChangeLog:

	* gdbint.texinfo (Item Output Functions): Update signature
	for ui_out_field_core_addr.
2009-07-02 17:21:10 +00:00
Daniel Jacobowitz edb3359dff gdb/
* NEWS: Document inlined function support.
	* Makefile.in (SFILES): Add inline-frame.c.
	(COMMON_OBS): Add inline-frame.o.
	* block.c (contained_in): Rewrite to use lexical nesting.
	(block_linkage_function): Skip inlined function blocks.
	(block_inlined_p): New.
	* block.h (struct block): Update comment.
	(block_inlined_p): New prototype.
	* blockframe.c (get_frame_block): Handle inlined functions.
	(get_frame_function): Do not use block_linkage_function.
	(block_innermost_frame): Use get_frame_block and contained_in.
	* breakpoint.c (watchpoint_check): Remove extra reinit_frame_cache.
	Skip over inlined functions.  Simplify epilogue check.
	(bpstat_check_breakpoint_conditions): Use get_stack_frame_id.
	Update comments.
	(set_momentary_breakpoint): Only accept non-inlined frames.
	(watch_command_1): Use frame_unwind_caller_pc and
	frame_unwind_caller_id instead of get_prev_frame.
	(until_break_command): Likewise.  Use get_stack_frame_id.
	* buildsym.c (end_symtab): Set SYMBOL_SYMTAB for block functions.
	* dwarf2loc.c (dwarf_expr_frame_base): Use block_linkage_function.
	* dwarf2read.c (process_die): Handle DW_TAG_inlined_subroutine.
	(read_func_scope, new_symbol): Likewise.  Handle arguments specially
	for inlined functions without call site information.
	(inherit_abstract_dies): Allow tag mismatch for inlined subroutines.
	(die_specification): Treat DW_AT_abstract_origin as a specification.
	(read_type_die): Handle DW_TAG_inlined_subroutine.
	* frame-unwind.c (frame_unwind_init): Add inline_frame_unwind.
	* frame.c (fprint_frame_id): Print inline depth.
	(fprint_frame_type): Handle INLINE_FRAME and SENTINEL_FRAME.
	(skip_inlined_frames, get_stack_frame_id): New.
	(frame_unwind_caller_id): Use skip_inlined_frames.
	(frame_id_inlined_p): New.
	(frame_id_eq): Make the logic match the comments.  Add inline_depth
	check.
	(frame_id_inner): Handle inlined functions.
	(frame_unwind_pc): New function, copied from frame_unwind_caller_pc.
	(frame_unwind_caller_pc): Use skip_inlined_frames and frame_unwind_pc.
	(get_prev_frame_1): Check for inline frames.  Split out frame
	allocation to get_prev_frame_raw.
	(get_prev_frame_raw): New function.
	(get_prev_frame): Handle inline frames.
	(get_frame_pc): Use frame_unwind_pc.
	(get_frame_address_in_block): Skip inlined frames on both sides.
	(pc_notcurrent): Delete.
	(find_frame_sal): Rewrite to handle inline call sites.  Use
	get_frame_address_in_block.
	(deprecated_update_frame_pc_hack): Make static.
	* frame.h: Update comments.
	(struct frame_id): Add inline_depth.
	(enum frame_type): Add INLINE_FRAME.
	(frame_id_inlined_p, get_stack_frame_id): New prototypes.
	* gdbthread.h (struct thread_info): Add step_stack_frame_id field.
	* infcmd.c (set_step_frame): New function.
	(step_once): Use set_step_frame.  Handle inlined functions.
	(until_next_command): Use set_step_frame.
	(finish_backward), finish_forward): Use get_stack_frame_id.
	(finish_command): Support inlined functions.
	* inferior.h (set_step_info): New prototype.
	* infrun.c (RESUME_ALL): Use minus_one_ptid.
	(clear_proceed_status): Clear step_stack_frame_id.
	(init_wait_for_inferior): Call clear_inline_frame_state.
	(init_execution_control_state): Make static.
	(set_step_info): New function.
	(init_thread_stepping_state): Do not set the symtab or line here.
	(stepped_in_from): New function.
	(handle_inferior_event): Handle inlined functions.  Use set_step_info.
	(insert_step_resume_breakpoint_at_frame): Use get_stack_frame_id.
	(struct inferior_status): Add step_stack_frame_id.
	(save_inferior_status, restore_inferior_status): Save and restore
	step_stack_frame_id.
	* inline-frame.c, inline-frame.h: New files.
	* minsyms.c (prim_record_minimal_symbol_and_info): Use XCALLOC.
	* regcache.c (regcache_write_pc): Call reinit_frame_cache.
	* s390-tdep.c (s390_prologue_frame_unwind_cache): Handle INLINE_FRAME.
	* stack.c (frame_show_address): New.
	(print_frame_info, print_frame): Use it.
	(find_frame_funname): Use get_frame_function.  Handle inlined blocks.
	(frame_info): Mark inlined functions.
	(backtrace_command_1): Use get_current_user_frame.
	(print_frame_local_vars, print_frame_label_vars): Update comments.
	(return_command): Refuse inlined functions.
	* symtab.c (lookup_symbol_aux_local): Stop at inlined function
	boundaries.
	(find_function_start_sal): Avoid inlined functions.
	(completion_list_add_fields): New function.
	(default_make_symbol_completion_list): Use it.  Use block_static_block
	and block_global_block.  Check for inlined functions.
	(skip_prologue_using_sal): Avoid line number comparison across
	inlining.
	* symtab.h (struct symbol): Add is_inlined.
	(SYMBOL_INLINED): New.
	* target.c (target_resume): Call clear_inline_frame_state.
	* valops.c (value_of_variable): Check block_inlined_p.

	gdb/doc/
	* gdb.texinfo (Debugging Optimized Code): New chapter.
	(Compiling for Debugging): Reference it.  Move some
	text to the new section.

	gdb/testsuite/
	* gdb.base/break.exp: Add an XFAIL for gcc/36748.
	* gdb.cp/annota2.exp: Accept frames-invalid in more places.
	* gdb.opt/Makefile.in (EXECUTABLES): Update.
	* gdb.opt/clobbered-registers-O2.exp: Update to GPL v3.
	* gdb.opt/inline-bt.c, gdb.opt/inline-bt.exp,
	gdb.opt/inline-cmds.c, gdb.opt/inline-cmds.exp,
	gdb.opt/inline-locals.c, gdb.opt/inline-locals.exp,
	gdb.opt/inline-markers.c: New files.
	* lib/gdb.exp (skip_inline_frame_tests): New function.
	(skip_inline_var_tests): New function.
2009-06-28 00:20:24 +00:00
Ulrich Weigand 505e835dc0 * ax-gdb.c (gen_bitfield_ref): Add EXP argument, use expression
architecture instead of current_gdbarch.
	(gen_struct_ref): Add EXP argument, pass to get_bitfield_ref.
	(gen_expr): Pass expression to get_struct_ref.

	* symtab.h (struct symbol_ops): Add GDBARCH parameter to
	tracepoint_var_ref callback.
	* ax-gdb.c (gen_var_ref): Pass architecture to tracepoint_var_ref
	symbol operation callback.
	* dwarf2loc.c (dwarf2_tracepoint_var_ref): Add GDBARCH parameter.
	Use it instead of current_gdbarch.
	(locexpr_tracepoint_var_ref): Add GDBARCH parameter.  Pass it to
	dwarf2_tracepoint_var_ref.
	(loclist_tracepoint_var_ref): Likewise.
2009-06-17 18:40:53 +00:00
Ulrich Weigand 768a979c31 * 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 12:28:39 +00:00
Tom Tromey 42ae523077 2009-05-27 Tom Tromey <tromey@redhat.com>
Paul Pluzhnikov  <ppluzhnikov@google.com>

	* mi/mi-main.c (mi_cmd_data_evaluate_expression): Use
	value_address.
	* cli/cli-dump.c (dump_value_to_file): Use value_address.
	* valprint.c (common_val_print): Likewise.
	* v850-tdep.c (v850_push_dummy_call): Use value_address.
	* tracepoint.c (encode_actions): Use value_address.
	* printcmd.c (print_formatted): Use value_address.
	(x_command): Likewise.
	* p-valprint.c (pascal_object_print_static_field): Use
	value_address.
	* mn10300-tdep.c (mn10300_push_dummy_call): Use value_address.
	* mips-tdep.c (mips_eabi_push_dummy_call): Use value_address.
	* m32r-tdep.c (m32r_push_dummy_call): Use value_address.
	* jv-valprint.c (java_value_print): Use value_address.
	* infcall.c (find_function_addr): Use value_address.
	* gnu-v3-abi.c (gnuv3_rtti_type): Use value_address.
	* gnu-v2-abi.c (gnuv2_value_rtti_type): Use value_address.
	* frv-tdep.c (frv_push_dummy_call): Use value_address.
	* frame.c (frame_register_unwind): Use value_address.
	(frame_unwind_register_value): Likewise.
	* darwin-nat-info.c (info_mach_region_command): Use
	value_address.
	* cp-valprint.c (cp_print_static_field): Use value_address.
	* c-valprint.c (c_value_print): Use value_address.
	* breakpoint.c (update_watchpoint): Use value_address.
	(can_use_hardware_watchpoint): Likewise.
	* ada-valprint.c (ada_val_print_1): Use value_address.
	(ada_value_print): Likewise.
	* ada-tasks.c (read_fat_string_value): Use value_address.
	* jv-lang.c (java_link_class_type): Use set_value_address.
	(java_link_class_type): Likewise.
	(get_java_utf8_name): Use value_address.
	(type_from_class): Likewise.
	(java_link_class_type): Likewise.
	* findvar.c (value_of_register): Use set_value_address.
	(read_var_value): Likewise.
	(read_var_value): Likewise.
	* eval.c (evaluate_subexp_standard): Use set_value_address.
	(evaluate_subexp_standard): Use value_address.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc): Use set_value_address.
	* ada-lang.c (coerce_unspec_val_to_type): Use set_value_address.
	(ada_value_primitive_packed_val): Likewise.
	(ensure_lval): Likewise.
	(thin_data_pntr): Use value_address.
	(desc_bounds): Likewise.
	(ada_value_primitive_packed_val): Likewise.
	(value_assign_to_component): Likewise.
	(ensure_lval): Likewise.
	(make_array_descriptor): Likewise.
	(ada_to_fixed_value): Likewise.
	(unwrap_value): Likewise.
	* value.c (deprecated_value_address_hack): Remove.
	(value_address): New function.
	(value_raw_address): Likewise.
	(set_value_address): Likewise.
	(value_fn_field): Use set_value_address.
	(value_from_contents_and_address): Likewise.
	(value_fn_field): Likewise.
	(allocate_value_lazy): Don't use VALUE_ADDRESS.
	(value_as_address): Use value_address.
	(value_static_field): Likewise.
	* valops.c (search_struct_field): Use set_value_address.
	(value_at): Likewise.
	(value_at_lazy): Likewise.
	(value_repeat): Likewise.
	(value_cast_structs): Use value_address.
	(value_cast): Likewise.
	(value_fetch_lazy): Likewise.
	(value_assign): Likewise.
	(value_repeat): Likewise.
	(address_of_variable): Likewise.
	(value_coerce_array): Likewise.
	(value_coerce_function): Likewise.
	(value_addr): Likewise.
	(search_struct_field): Likewise.
	(search_struct_method): Likewise.
	(find_method_list): Likewise.
	(value_struct_elt_for_reference): Likewise.
	(value_full_object): Likewise.
	* jv-valprint.c (java_value_print): Use set_value_address.
	* value.h (deprecated_value_address_hack): Remove.
	(VALUE_ADDRESS): Remove.
	(value_address): Declare.
	(value_raw_address): Declare.
	(set_value_address): Declare.
2009-05-28 00:53:52 +00:00
Ulrich Weigand 77a732d97f * dwarf2loc.c (dwarf2_evaluate_loc_desc): Do not call get_frame_arch
for NULL frame pointers.
2009-01-13 18:01:49 +00:00
Joel Brobecker 0fb0cc7590 Updated copyright notices for most files. 2009-01-03 05:58:08 +00:00
Ulrich Weigand f7fd47281b * dwarf2expr.h (dwarf2_read_address): Add gdbarch argument.
* dwarf2expr.c (dwarf2_read_address): Add gdbarch argument.
	Call gdbarch_integer_to_address directly instead of converting
	to value and back.  Update comment.
	(execute_stack_op): Update call site.
	* dwarf2loc.c (find_location_expression): Likewise.
	(locexpr_describe_location): Update

	* dwarf2expr.h (struct dwarf_expr_context): Add gdbarch member.
	* dwarf2-frame.c (execute_stack_op): Initialize ctx->gdbarch.
	* dwarf2loc. (dwarf2_evaluate_loc_desc): Likewise.
	(dwarf2_loc_desc_needs_frame): Likewise.
2008-09-05 11:40:53 +00:00
Jan Kratochvil ebd3bcc132 * dwarf2loc.c (dwarf_expr_frame_base): Error out on missing
SYMBOL_LOCATION_BATON.
2008-05-04 12:44:16 +00:00
Ulrich Weigand 5e2b427df3 * objfiles.h (struct objfile): New GDBARCH member.
(get_objfile_arch): Add prototype.
	* objfiles.c: Include "arch-utils.h".
	(allocate_objfile): Look up gdbarch associated with bfd.
	(get_objfile_arch): New function.
	* Makefile (objfiles.o): Update dependencies.

	* dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch
	by objfile arch.
	* dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch
	by frame arch.
	(locexpr_describe_location): Replace current_gdbarch by
	objfile arch.
	* dwarf2read.c (die_type): Replace current_gdbarch by objfile arch.
	(dwarf2_add_field): Likewise.
	(read_tag_pointer_type): Likewise.
	(read_base_type): Likewise.
	(new_symbol): Likewise.

	* coffread.c (decode_type): Add OBJFILE argument.  Update callers.
	(decode_base_type, decode_function_type): Likewise.
	(coff_read_struct_type, coff_read_enum_type): Likewise.
	(coff_symtab_read): Replace current_gdbarch by objfile arch.
	(decode_base_type): Likewise.
	(coff_read_enum_type): Likewise.
	(coff_read_struct_type): Replace current_objfile by OBJFILE argument.
	(coff_read_enum_type): Likewise.

	* dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch.
	(end_psymtab): Likewise.
	(process_one_symbol): Likewise.

	* mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch.
	(parse_procedure): Likewise.
	(parse_partial_symbols): Likewise.

	* somread.c (som_symtab_read): Replace current_gdbarch by objfile arch.

	* stabsread.c (define_symbol): Replace current_gdbarch by objfile arch.
	Replace static pcc_promotion_type and pcc_unsigned_promotion_type by
	built-in types.
	(read_range_type): Replace current_gdbarch by objfile arch.  Replace
	static range_index_type by built-in type.
	(read_one_struct_field): Replace current_gdbarch by objfile arch.
	(read_enum_type): Likewise.

	* xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by
	objfile arch.
2008-03-26 14:53:28 +00:00
Ulrich Weigand ae0d2f24fd 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 19:40:47 +00:00
Daniel Jacobowitz 9b254dd1ce Updated copyright notices for most files. 2008-01-01 22:53:26 +00:00
Ulrich Weigand ad010def89 2007-10-08 Markus Deuling <deuling@de.ibm.com>
* dwarf2-frame.c (read_reg, execute_cfa_program, dwarf2_frame_cache)
	(dwarf2_frame_default_init_reg, dwarf2_frame_prev_register): Replace
	current_gdbarch by gdbarch.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc): Likewise.
2007-10-08 12:46:09 +00:00
Jerome Guitton eff4f95e29 * dwarf2loc.c (dwarf_expr_frame_base): Guard against NULL.
* Makefile.in (dwarf2loc.o): Depend on gdb_assert.h.
2007-09-17 14:53:05 +00:00
Joel Brobecker a9762ec78a Switch the license of all .c files to GPLv3.
Switch the license of all .h files to GPLv3.
        Switch the license of all .cc files to GPLv3.
2007-08-23 18:08:50 +00:00
Ulrich Weigand 17a912b682 2007-06-13 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (TARGET_ADDR_BIT): Replace by gdbarch_addr_bit.
	* valops.c (value_cast): Likewise.
	* utils.c (strlen_paddr, paddr, paddr_nz, paddress): Likewise.
	* ui-out.c (ui_out_field_core_addr): Likewise.
	* tracepoint.c (tracepoints_info): Likewise.
	* symtab.c (print_msymbol_info): Likewise.
	* solib-irix.c (irix_current_sos)
	(irix_open_symbol_file_object): Likewise.
	* remote.c (build_remote_gdbarch_data): Likewise.
	* prologue-value.c (make_pv_area): Likewise.
	* procfs.c (info_mappings_callback): Likewise.
	* printcmd.c (print_scalar_formatted)
	(deprecated_print_address_numeric): Likewise.
	* memattr.c (mem_info_command): Likewise.
	* linux-nat.c (linux_nat_info_proc_cmd): Likewise.
	* gdbtypes.c (build_flt, gdbtypes_post_init): Likewise.
	* exec.c (print_section_info): Likewise.
	* dwarf2read.c (read_subrange_type): Likewise.
	* dwarf2loc.c (find_location_expression): Likewise.
	* dwarf2expr.c (dwarf2_read_address, unsigned_address_type)
	(signed_address_type, execute_stack_op): Likewise.
	* breakpoint.c (print_one_breakpoint, breakpoint_1): Likewise.
	* gdbarch.c, gdbarch.h: Regenerate.
2007-06-13 17:59:51 +00:00
Ulrich Weigand 055d23b8ab 2007-06-12 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (STAB_REG_TO_REGNUM): Replace by
	gdbarch_stab_reg_to_regnum.
	* stabsread.c (define_symbol): Likewise.
	* gdbarch.sh (ECOFF_REG_TO_REGNUM): Replace by
	gdbarch_ecoff_reg_to_regnum.
	* mdebugread.c (parse_symbol): Likewise.
	* i386-tdep.c (i386_gdbarch_init): Likewise (comment).
	* gdbarch.sh (DWARF_REG_TO_REGNUM): Replace by
	gdbarch_dwarf_reg_to_regnum.
	* gdbarch.sh (SDB_REG_TO_REGNUM): Replace by gdbarch_sdb_reg_to_regnum.
	* coffread.c (process_coff_symbol): Likewise.
	* gdbarch.sh (DWARF2_REG_TO_REGNUM): Replace by
	gdbarch_dwarf2_reg_to_regnum.
	* dwarf2loc.c (dwarf_expr_read_reg,dwarf2_evaluate_loc_desc)
	(locexpr_describe_location): Likewise.
	* dwarf2-frame.c (read_reg,execute_cfa_program,dwarf2_frame_cache)
	(dwarf2_frame_prev_register,dwarf2_signal_frame_this_id): Likewise.
	* dwarf2loc.c (DWARF2_REG_TO_REGNUM): Remove macro.
	* dwarf2read.c (DWARF2_REG_TO_REGNUM): Remove macro.
	* gdbarch.c, gdbarch.h: Regenerate.
2007-06-12 16:59:43 +00:00
Ulrich Weigand c7bb205ca9 2007-06-12 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (TARGET_VIRTUAL_FRAME_POINTER): Replace by
	gdbarch_virtual_frame_pointer.
	* tracepoint.c (encode_actions): Likewise.
	* dwarf2loc.c (dwarf2_loc_desc_needs_frame): Likewise.
	* ax-gdb.c (gen_frame_args_address, gen_frame_locals_address): Likewise.
	* gdbarch.c, gdbarch.h: Regenerate.
2007-06-12 16:43:39 +00:00
Ulrich Weigand c9f4d5725d 2007-06-09 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (REGISTER_NAME): Replace by gdbarch_register_name.
	* tracepoint.c (scope_info): Likewise.
	* target.c (debug_print_register): Likewise.
	* stack.c (frame_info): Likewise.
	* sh-tdep.c (sh_register_reggroup_p): Likewise.
	* sh64-tdep.c (sh64_do_fp_register, sh64_do_register)
	(sh64_media_print_registers_info)
	(sh64_compact_print_registers_info): Likewise.
	* rs6000-tdep.c (rs6000_register_reggroup_p): Likewise.
	* remote-sim.c (gdbsim_fetch_register): Likewise.
	* remote.c (packet_reg): Likewise (comment).
	* reggroups.c (default_register_reggroup_p): Likewise.
	* regcache.c (regcache_dump): Likewise.
	* printcmd.c (address_info): Likewise.
	* ppc-linux-nat.c (fetch_register, store_register): Likewise.
	* mt-dep.c (mt_registers_info): Likewise.
	* mn10300-tdep.c (mn10300_dwarf2_reg_to_regnum): Likewise (comment).
	* mips-tdep.c (mips_register_reggroup_p, mips_read_fp_register_single)
	(mips_read_fp_register_double, mips_print_fp_register)
	(mips_print_register, print_gp_register_row, mips_print_registers_info)
	(mips_register_sim_regno): Likewise.
	* m68klinux-nat.c (regmap, fetch_register, store_register): Likewise.
	* inf-ptrace.c (inf_ptrace_fetch_register)
	(inf_ptrace_store_register): Likewise.
	* infcmd.c (default_print_registers_info): Likewise.
	* ia64-linux-nat.c (ia64_linux_fetch_register)
	(ia64_linux_store_register): Likewise.
	* i386-linux-nat.c (fetch_register, store_register): Likewise.
	* i386gnu-nat.c (gnu_fetch_registers, gnu_store_registers): Likewise.
	* hppa-linux-nat.c (fetch_register, store_register): Likewise.
	* hppa-hpux-nat.c (hppa_hpux_fetch_register)
	(hppa_hpux_store_register): Likewise.
	* findvar.c (locate_var_value): Likewise.
	* dwarf2loc.c (locexpr_describe_location): Likewise.
	* dwarf2-frame.c (execute_cfa_program): Likewise.
	* arm-tdep.c (arm_push_dummy_call): Likewise.
	* arch-utils.c (legacy_register_sim_regno): Likewise.
	* alpha-tdep.c (alpha_register_reggroup_p): Likewise.
	* alpha-nat.c (fetch_osf_core_registers): Likewise.
	* mi/mi-main.c (mi_cmd_data_list_register_names)
	(mi_cmd_data_list_changed_registers, mi_cmd_data_list_register_values)
	(mi_cmd_data_write_register_values): Likewise.
	* gdbarch.c, gdbarch.h: Regenerate.
2007-06-09 13:42:16 +00:00
Caroline Tice 42be36b328 Add ability to report when a variable's value is uninitialized,
based on information provided by the compiler.  Also add new
DWARF OP, DW_OP_GNU_uninit, for this purpose.
2007-05-18 19:42:42 +00:00
Jim Blandy 10fb19b6ab 2007-01-24 Jim Blandy <jimb@codesourcery.com>
* dwarf2loc.c (dwarf2_evaluate_loc_desc): When the location
	expression is empty, bother to return the 'optimized out' value we
	construct.  (Thanks to Carl Burch.)
2007-01-24 22:04:48 +00:00
Daniel Jacobowitz 6aba47ca06 Copyright updates for 2007. 2007-01-09 17:59:20 +00:00
Ulrich Weigand 0b2b0195d1 * findvar.c (address_from_register): New function.
* value.h (address_from_register): Add prototype.
	* dwarf2loc.c (dwarf_expr_read_reg): Use address_from_register.
2006-11-22 13:44:45 +00:00
Jim Blandy e5192dd81c 2006-11-06 Jim Blandy <jimb@codesourcery.com>
* (dwarf_expr_read_reg): Use frame_register_read, not frame_register.
	* dwarf2loc.c (dwarf_expr_read_reg): Use frame_register_read
	instead of frame_register.  Doc fix.
2006-11-06 23:20:12 +00:00
Jim Blandy 4bc9efe119 2006-11-03 Jim Blandy <jimb@codesourcery.com>
* dwarf2loc.c (dwarf_expr_read_reg): Use frame_unwind_register
        instead of frame_register.  Doc fix.
2006-11-03 22:09:28 +00:00
Daniel Jacobowitz 9e35dae425 2006-10-09 Jan Kratochvil <jan.kratochvil@redhat.com>
Daniel Jacobowitz  <dan@codesourcery.com>

	* Makefile.in (expprint.o, parse.o, target.o): Update.
	* dwarf2loc.c (dwarf_expr_tls_address): Move body to
	target_translate_tls_address.  Call it.
	* eval.c (evaluate_subexp_standard): Handle UNOP_MEMVAL_TLS.
	* expprint.c (print_subexp_standard): Likewise.
	(op_name_standard, dump_subexp_body_standard): Likewise.
	* expression.h (enum exp_opcode): Add UNOP_MEMVAL_TLS.
	(union exp_element): Add objfile.
	* parse.c (write_exp_elt_objfile): New function.
	(msym_tls_symbol_type): New.
	(write_exp_msymbol): Handle TLS.
	(operator_length_standard): Handle UNOP_MEMVAL_TLS.
	(build_parse): Initialize msym_tls_symbol_type.
	* parser-defs.h (write_exp_elt_objfile): New prototype.
	* target.c (target_translate_tls_address): New.
	* target.h (target_translate_tls_address): Add prototype.

2006-10-09  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.threads/tls-nodebug.c, gdb.threads/tls-nodebug.exp: New test.
2006-10-10 03:17:53 +00:00
Eli Zaretskii 197e01b6dc * breakpoint.c:
* arm-tdep.c:
	* ia64-tdep.c:
	* i386-tdep.c:
	* hpread.c:
	* hppa-tdep.c:
	* hppa-hpux-tdep.c:
	* gnu-nat.c:
	* gdbtypes.c:
	* gdbarch.h:
	* gdbarch.c:
	* eval.c:
	* dwarf2read.c:
	* dbxread.c:
	* copying:
	* symfile.c:
	* stabsread.c:
	* sh64-tdep.c:
	* sh-tdep.c:
	* s390-tdep.c:
	* rs6000-tdep.c:
	* remote.c:
	* remote-mips.c:
	* mips-tdep.c:
	* mdebugread.c:
	* linux-nat.c:
	* infrun.c:
	* xcoffread.c:
	* win32-nat.c:
	* valops.c:
	* utils.c:
	* tracepoint.c:
	* target.c:
	* symtab.c:
	* c-exp.y:
	* ada-valprint.c:
	* ada-typeprint.c:
	* ada-lex.l:
	* ada-lang.h:
	* ada-lang.c:
	* ada-exp.y:
	* alphafbsd-tdep.c:
	* alphabsd-tdep.h:
	* alphabsd-tdep.c:
	* alphabsd-nat.c:
	* alpha-tdep.h:
	* alpha-tdep.c:
	* alpha-osf1-tdep.c:
	* alpha-nat.c:
	* alpha-mdebug-tdep.c:
	* alpha-linux-tdep.c:
	* alpha-linux-nat.c:
	* aix-thread.c:
	* abug-rom.c:
	* arch-utils.c:
	* annotate.h:
	* annotate.c:
	* amd64obsd-tdep.c:
	* amd64obsd-nat.c:
	* amd64nbsd-tdep.c:
	* amd64nbsd-nat.c:
	* amd64fbsd-tdep.c:
	* amd64fbsd-nat.c:
	* amd64bsd-nat.c:
	* amd64-tdep.h:
	* amd64-tdep.c:
	* amd64-sol2-tdep.c:
	* amd64-nat.h:
	* amd64-nat.c:
	* amd64-linux-tdep.c:
	* amd64-linux-nat.c:
	* alphanbsd-tdep.c:
	* block.h:
	* block.c:
	* bfd-target.h:
	* bfd-target.c:
	* bcache.h:
	* bcache.c:
	* ax.h:
	* ax-general.c:
	* ax-gdb.h:
	* ax-gdb.c:
	* avr-tdep.c:
	* auxv.h:
	* auxv.c:
	* armnbsd-tdep.c:
	* armnbsd-nat.c:
	* arm-tdep.h:
	* arm-linux-nat.c:
	* arch-utils.h:
	* charset.c:
	* call-cmds.h:
	* c-valprint.c:
	* c-typeprint.c:
	* c-lang.h:
	* c-lang.c:
	* buildsym.h:
	* buildsym.c:
	* bsd-uthread.h:
	* bsd-uthread.c:
	* bsd-kvm.h:
	* bsd-kvm.c:
	* breakpoint.h:
	* core-regset.c:
	* core-aout.c:
	* completer.h:
	* completer.c:
	* complaints.h:
	* complaints.c:
	* command.h:
	* coffread.c:
	* coff-solib.h:
	* coff-solib.c:
	* coff-pe-read.h:
	* coff-pe-read.c:
	* cli-out.h:
	* cli-out.c:
	* charset.h:
	* dink32-rom.c:
	* dictionary.h:
	* dictionary.c:
	* demangle.c:
	* defs.h:
	* dcache.h:
	* dcache.c:
	* d10v-tdep.c:
	* cpu32bug-rom.c:
	* cp-valprint.c:
	* cp-support.h:
	* cp-support.c:
	* cp-namespace.c:
	* cp-abi.h:
	* cp-abi.c:
	* corelow.c:
	* corefile.c:
	* environ.c:
	* elfread.c:
	* dwarfread.c:
	* dwarf2loc.c:
	* dwarf2expr.h:
	* dwarf2expr.c:
	* dwarf2-frame.h:
	* dwarf2-frame.c:
	* dve3900-rom.c:
	* dummy-frame.h:
	* dummy-frame.c:
	* dsrec.c:
	* doublest.h:
	* doublest.c:
	* disasm.h:
	* disasm.c:
	* fork-child.c:
	* findvar.c:
	* fbsd-nat.h:
	* fbsd-nat.c:
	* f-valprint.c:
	* f-typeprint.c:
	* f-lang.h:
	* f-lang.c:
	* expression.h:
	* expprint.c:
	* exec.h:
	* exec.c:
	* exceptions.h:
	* exceptions.c:
	* event-top.h:
	* event-top.c:
	* event-loop.h:
	* event-loop.c:
	* gdb.c:
	* gdb-stabs.h:
	* gdb-events.h:
	* gdb-events.c:
	* gcore.c:
	* frv-tdep.h:
	* frv-tdep.c:
	* frv-linux-tdep.c:
	* frame.h:
	* frame.c:
	* frame-unwind.h:
	* frame-unwind.c:
	* frame-base.h:
	* frame-base.c:
	* gdb_vfork.h:
	* gdb_thread_db.h:
	* gdb_string.h:
	* gdb_stat.h:
	* gdb_regex.h:
	* gdb_ptrace.h:
	* gdb_proc_service.h:
	* gdb_obstack.h:
	* gdb_locale.h:
	* gdb_dirent.h:
	* gdb_curses.h:
	* gdb_assert.h:
	* gdbarch.sh:
	* gdb.h:
	* hpux-thread.c:
	* hppabsd-nat.c:
	* hppa-tdep.h:
	* hpacc-abi.c:
	* h8300-tdep.c:
	* gregset.h:
	* go32-nat.c:
	* gnu-v3-abi.c:
	* gnu-v2-abi.h:
	* gnu-v2-abi.c:
	* gnu-nat.h:
	* glibc-tdep.c:
	* gdbtypes.h:
	* gdbcore.h:
	* gdbcmd.h:
	* i386nbsd-tdep.c:
	* i386nbsd-nat.c:
	* i386gnu-tdep.c:
	* i386gnu-nat.c:
	* i386fbsd-tdep.c:
	* i386fbsd-nat.c:
	* i386bsd-tdep.c:
	* i386bsd-nat.h:
	* i386bsd-nat.c:
	* i386-tdep.h:
	* i386-sol2-nat.c:
	* i386-nto-tdep.c:
	* i386-nat.c:
	* i386-linux-tdep.h:
	* i386-linux-tdep.c:
	* i386-linux-nat.c:
	* i386-cygwin-tdep.c:
	* inf-ttrace.c:
	* inf-ptrace.h:
	* inf-ptrace.c:
	* inf-loop.h:
	* inf-loop.c:
	* inf-child.h:
	* inf-child.c:
	* ia64-tdep.h:
	* ia64-linux-nat.c:
	* i387-tdep.h:
	* i387-tdep.c:
	* i386v4-nat.c:
	* i386v-nat.c:
	* i386obsd-tdep.c:
	* i386obsd-nat.c:
	* kod.c:
	* jv-valprint.c:
	* jv-typeprint.c:
	* jv-lang.h:
	* jv-lang.c:
	* irix5-nat.c:
	* iq2000-tdep.c:
	* interps.h:
	* interps.c:
	* inftarg.c:
	* inflow.h:
	* inflow.c:
	* inferior.h:
	* infcmd.c:
	* infcall.h:
	* infcall.c:
	* inf-ttrace.h:
	* m32r-tdep.h:
	* m32r-tdep.c:
	* m32r-rom.c:
	* m32r-linux-tdep.c:
	* m32r-linux-nat.c:
	* m2-valprint.c:
	* m2-typeprint.c:
	* m2-lang.h:
	* m2-lang.c:
	* lynx-nat.c:
	* linux-thread-db.c:
	* linux-nat.h:
	* linespec.c:
	* libunwind-frame.h:
	* libunwind-frame.c:
	* language.h:
	* language.c:
	* macroexp.c:
	* macrocmd.c:
	* m88kbsd-nat.c:
	* m88k-tdep.h:
	* m88k-tdep.c:
	* m68klinux-tdep.c:
	* m68klinux-nat.c:
	* m68kbsd-tdep.c:
	* m68kbsd-nat.c:
	* m68k-tdep.h:
	* m68k-tdep.c:
	* mips-linux-nat.c:
	* mips-irix-tdep.c:
	* minsyms.c:
	* memattr.h:
	* memattr.c:
	* mem-break.c:
	* mdebugread.h:
	* main.h:
	* main.c:
	* macrotab.h:
	* macrotab.c:
	* macroscope.h:
	* macroscope.c:
	* macroexp.h:
	* nbsd-tdep.c:
	* mt-tdep.c:
	* monitor.h:
	* monitor.c:
	* mn10300-tdep.h:
	* mn10300-tdep.c:
	* mn10300-linux-tdep.c:
	* mipsv4-nat.c:
	* mipsread.c:
	* mipsnbsd-tdep.h:
	* mipsnbsd-tdep.c:
	* mipsnbsd-nat.c:
	* mips64obsd-tdep.c:
	* mips64obsd-nat.c:
	* mips-tdep.h:
	* mips-mdebug-tdep.c:
	* mips-linux-tdep.c:
	* osabi.h:
	* osabi.c:
	* ocd.h:
	* ocd.c:
	* observer.c:
	* objfiles.h:
	* objfiles.c:
	* objc-lang.h:
	* objc-lang.c:
	* objc-exp.y:
	* nto-tdep.h:
	* nto-tdep.c:
	* nto-procfs.c:
	* nlmread.c:
	* nbsd-tdep.h:
	* ppcobsd-tdep.c:
	* ppcobsd-nat.c:
	* ppcnbsd-tdep.h:
	* ppcnbsd-tdep.c:
	* ppcnbsd-nat.c:
	* ppcbug-rom.c:
	* ppc-tdep.h:
	* ppc-sysv-tdep.c:
	* ppc-linux-tdep.c:
	* ppc-linux-nat.c:
	* ppc-bdm.c:
	* parser-defs.h:
	* parse.c:
	* p-valprint.c:
	* p-typeprint.c:
	* p-lang.h:
	* p-lang.c:
	* remote-fileio.h:
	* remote-fileio.c:
	* remote-est.c:
	* remote-e7000.c:
	* regset.h:
	* regset.c:
	* reggroups.h:
	* reggroups.c:
	* regcache.h:
	* regcache.c:
	* proc-why.c:
	* proc-service.c:
	* proc-events.c:
	* printcmd.c:
	* ppcobsd-tdep.h:
	* sentinel-frame.h:
	* sentinel-frame.c:
	* scm-valprint.c:
	* scm-tags.h:
	* scm-lang.h:
	* scm-lang.c:
	* scm-exp.c:
	* s390-tdep.h:
	* rom68k-rom.c:
	* remote.h:
	* remote-utils.c:
	* remote-st.c:
	* remote-sim.c:
	* remote-sds.c:
	* remote-rdp.c:
	* remote-rdi.c:
	* remote-hms.c:
	* sim-regno.h:
	* shnbsd-tdep.h:
	* shnbsd-tdep.c:
	* shnbsd-nat.c:
	* sh-tdep.h:
	* serial.h:
	* serial.c:
	* ser-unix.h:
	* ser-unix.c:
	* ser-tcp.c:
	* ser-pipe.c:
	* ser-go32.c:
	* ser-e7kpc.c:
	* ser-base.h:
	* ser-base.c:
	* solib.c:
	* solib-svr4.h:
	* solib-svr4.c:
	* solib-sunos.c:
	* solib-som.h:
	* solib-som.c:
	* solib-pa64.h:
	* solib-pa64.c:
	* solib-osf.c:
	* solib-null.c:
	* solib-legacy.c:
	* solib-irix.c:
	* solib-frv.c:
	* solib-aix5.c:
	* sol-thread.c:
	* sparc64-linux-tdep.c:
	* sparc64-linux-nat.c:
	* sparc-tdep.h:
	* sparc-tdep.c:
	* sparc-sol2-tdep.c:
	* sparc-sol2-nat.c:
	* sparc-nat.h:
	* sparc-nat.c:
	* sparc-linux-tdep.c:
	* sparc-linux-nat.c:
	* source.h:
	* source.c:
	* somread.c:
	* solist.h:
	* solib.h:
	* std-regs.c:
	* stack.h:
	* stack.c:
	* stabsread.h:
	* sparcobsd-tdep.c:
	* sparcnbsd-tdep.c:
	* sparcnbsd-nat.c:
	* sparc64obsd-tdep.c:
	* sparc64nbsd-tdep.c:
	* sparc64nbsd-nat.c:
	* sparc64fbsd-tdep.c:
	* sparc64fbsd-nat.c:
	* sparc64-tdep.h:
	* sparc64-tdep.c:
	* sparc64-sol2-tdep.c:
	* sparc64-nat.c:
	* ui-file.c:
	* typeprint.h:
	* typeprint.c:
	* tramp-frame.h:
	* tramp-frame.c:
	* trad-frame.h:
	* trad-frame.c:
	* tracepoint.h:
	* top.c:
	* tobs.inc:
	* thread.c:
	* terminal.h:
	* target.h:
	* symfile.h:
	* stop-gdb.c:
	* vaxbsd-nat.c:
	* vax-tdep.h:
	* vax-tdep.c:
	* vax-nat.c:
	* varobj.h:
	* varobj.c:
	* value.h:
	* value.c:
	* valprint.h:
	* valprint.c:
	* v850-tdep.c:
	* uw-thread.c:
	* user-regs.c:
	* ui-out.h:
	* ui-out.c:
	* ui-file.h:
	* xcoffsolib.h:
	* xcoffsolib.c:
	* wrapper.c:
	* wince.c:
	* wince-stub.h:
	* wince-stub.c:
	* vaxobsd-tdep.c:
	* vaxnbsd-tdep.c:
	* gdb_gcore.sh:
	* copying.c:
	* configure.ac:
	* aclocal.m4:
	* acinclude.m4:
	* reply_mig_hack.awk:
	* observer.sh:
	* gdb_mbuild.sh:
	* arm-linux-tdep.c:
	* blockframe.c:
	* dbug-rom.c:
	* environ.h:
	* dwarf2loc.h:
	* gdb-events.sh:
	* glibc-tdep.h:
	* gdb_wait.h:
	* gdbthread.h:
	* i386-sol2-tdep.c:
	* hppabsd-tdep.c:
	* hppa-linux-nat.c:
	* hppa-hpux-nat.c:
	* ia64-linux-tdep.c:
	* infptrace.c:
	* linespec.h:
	* maint.c:
	* mips-mdebug-tdep.h:
	* remote-m32r-sdi.c:
	* s390-nat.c:
	* rs6000-nat.c:
	* remote-utils.h:
	* sh3-rom.c:
	* sh-linux-tdep.c:
	* top.h:
	* symtab.h:
	* symmisc.c:
	* symfile-mem.c:
	* srec.h:
	* user-regs.h:
	* version.h:
	* valarith.c:
	* xstormy16-tdep.c:
	* wrapper.h:
	* Makefile.in:
	* f-exp.y:
	* cris-tdep.c:
	* cp-name-parser.y:
	* procfs.c:
	* proc-utils.h:
	* proc-flags.c:
	* proc-api.c:
	* p-exp.y:
	* m68hc11-tdep.c:
	* m2-exp.y:
	* kod.h:
	* kod-cisco.c:
	* jv-exp.y:
	* hppa-linux-tdep.c: Add (c) after Copyright.  Update the FSF
	address.
2005-12-17 22:34:03 +00:00
Randolph Chung 9c23835799 2005-11-19 Randolph Chung <tausq@debian.org>
* dwarf2loc.c (dwarf2_tracepoint_var_ref): Remove extra add for
	DW_OP_fbreg.  Handle DW_OP_breg0 through DW_OP_breg31.  Print
	DWARF opcode for unsupported case.
2005-11-19 13:43:35 +00:00
Jim Wilson 22c6cabacd Fix gcc bug 24490, location list query failed due to out-of-range address.
PR 2024
* dwarf2loc.c (dwarf_expr_frame_base): Use get_frame_address_in_block
instead of get_frame_pc.
(loclist_read_variable): Likewise.
2005-11-14 22:25:16 +00:00
Elena Zannoni 23572ecadc 2005-11-03 Andrew Cagney <cagney@gnu.org>
Checked in by Elena Zannoni  <ezannoni@redhat.com>

       * dwarf2loc.c (dwarf2_evaluate_loc_desc): Handle DW_OP_piece
       reads.
2005-11-04 02:42:34 +00:00
Mark Kettenis 852483bc79 * 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 13:06:54 +00:00
Andrew Cagney 109c3e397e 2005-04-26 Andrew Cagney <cagney@gnu.org>
* remote.c (remote_open_1): Move "ex"'s declaration to where it is
	used.
	(remote_get_thread_local_address): Use throw_error, include a
	printed string.
	* linux-thread-db.c (thread_db_get_thread_local_address): Ditto.
	* dwarf2loc.c (dwarf_expr_tls_address): Ditto.
	* cli/cli-script.c (script_from_file): Mark up throw_error message.
	* linespec.c (symtab_from_filename, decode_variable): Ditto.
2005-04-26 14:57:22 +00:00
Andrew Cagney 71fff37b08 2005-04-26 Andrew Cagney <cagney@gnu.org>
Rename 'struct exception' to 'struct gdb_exception'.
	* wrapper.c: Update.
	* varobj.c: Update.
	* tui/tui-interp.c: Update.
	* remote.c: Update.
	* mi/mi-main.c: Update.
	* mi/mi-interp.c: Update.
	* linux-thread-db.c: Update.
	* interps.h: Update.
	* interps.c: Update.
	* exceptions.h: Update.
	* exceptions.c: Update.
	* dwarf2loc.c: Update.
	* cli/cli-interp.c: Update.
	* cli/cli-script.c: Update.
	* breakpoint.c: Update.
2005-04-26 05:03:41 +00:00
Kevin Buettner b275693032 * gdbarch.sh (fetch_tls_load_module_address): New architecture method.
* gdbarch.c, gdbarch.h: Regenerate.
	* dwarf2loc.c (dwarf_expr_tls_address): Fetch TLS load module
	address and pass this address, instead of the objfile address, to
	target_get_thread_local_address().
	* linux-thread-db.c (thread_db_get_thread_local_address): Change
	second parameter from type ``struct objfile *'' to CORE_ADDR.  Do
	not call svr4_fetch_objfile_link_map() to fetch the load module
	address.
	* target.h (struct target_ops): Change second parameter of
	``to_get_thread_local_address'' from ``struct objfile *'' to
	``CORE_ADDR''.
	* alpha-linux-tdep.c (solib-svr4.h): Include.
	(alpha_linux_init_abi): Register TLS load module fetcher.
	* amd64-linux-tdep.c (amd64_linux_init_abi): Likewise.
	* hppa-linux-tdep.c (hppa_linux_init_abi): Likewise.
	* i386-linux-tdep.c (i386_linux_init_abi): Likewise.
	* ia64-linux-tdep.c (solib-svr4.h): Include.
	(ia64_linux_init_abi): Register TLS load module fetcher.
	* m32r-linux-tdep.c (m32r_linux_init_abi): Likewise.
	* m68klinux-tdep.c (m68k_linux_init_abi): Likewise.
	* mips-linux-tdep.c (mips_linux_init_abi): Likewise.
	* s390-tdep.c (s390_gdbarch_init): Likewise.
	* sparc-linux-tdep.c (sparc32_linux_init_abi): Likewise.
	* sparc64-linux-tdep.c (solib-svr4.h): Include.
	(sparc64_linux_init_abi): Register TLS load module fetcher.
	* Makefile.in (alpha-linux-tdep.o, ia64-linux-tdep.o)
	(sparc-linux-tdep.o): Update dependencies.
2005-03-31 19:58:26 +00:00
Mark Kettenis 4dd0443396 * dwarf2loc.c (dwarf_expr_tls_address): Mark addr as volatile.
* varobj.c (my_value_equal): Mark val2 as volatile.
2005-03-20 20:30:35 +00:00
Daniel Jacobowitz 96ce45cadb * dwarf2loc.c (dwarf_expr_tls_address): Initialize ADDR.
* gnu-v3-abi.c (gnuv3_baseclass_offset): Update type of
	VALADDR.
2005-03-19 19:44:10 +00:00
Kevin Buettner 93ad78a72d Move printing of TLS related error messages to dwarf2loc.c. 2005-03-18 21:03:39 +00:00
Daniel Jacobowitz 806048c68a * dwarf2loc.c (loclist_read_variable): Set optimized_out
instead of reporting an error.
	* valprint.c (value_check_printable): New function.
	(common_val_print): New function.  Use value_check_printable.
	(value_print): Use value_check_printable.
	* value.h (common_val_print): Add prototype.

	* c-valprint.c (c_val_print): Use common_val_print.
	* cp-valprint.c (cp_print_value_fields): Likewise.
	(cp_print_hpacc_virtual_table_entries): Likewise.
	* f-valprint.c (f_val_print): Likewise.
	* jv-valprint.c (java_value_print, java_print_value_fields):
	Likewise.
	* scm-valprint.c (scm_value_print): Likewise.
	* stack.c (print_frame_args): Likewise.
	* varobj.c (c_value_of_variable): Likewise.
	* p-valprint.c (pascal_val_print, pascal_value_print): Likewise.
	(pascal_object_print_value_fields): Likewise.  Update call to
	pascal_object_print_static_field.
	(pascal_object_print_static_field): Remove TYPE argument.  Use
	common_val_print.
2005-02-28 17:00:49 +00:00
Andrew Cagney 8a3fe4f86c 2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
	* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
	* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
	* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
	* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
	* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
	* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
	* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
	* event-top.c, exec.c, expprint.c, f-lang.c: Update.
	* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
	* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
	* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
	* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
	* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
	* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
	* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
	* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
	* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
	* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
	* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
	* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
	* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
	* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
	* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
	* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
	* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
	* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
	* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
	* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
	* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
	* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
	* remote-rdp.c, remote-sim.c, remote-st.c: Update.
	* remote-utils.c, remote-utils.h, remote.c: Update.
	* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
	* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
	* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
	* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
	* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
	* somread.c, somsolib.c, source.c, stabsread.c: Update.
	* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
	* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
	* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
	* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
	* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
	* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
	* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
	* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
	* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
	* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
	* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
	* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
Andrew Cagney dfa52d88e7 2005-02-07 Andrew Cagney <cagney@gnu.org>
* value.h (VALUE_LAZY): Delete
	(set_value_lazy): Declare.
	* value.c (set_value_lazy): Define.
	* valops.c, valarith.c, jv-valprint.c, jv-lang.c: Update.
	* gnu-v2-abi.c, findvar.c, dwarf2loc.c, ada-lang.c: Update.
2005-02-07 15:04:43 +00:00
Andrew Cagney feb13ab03f 2005-02-06 Andrew Cagney <cagney@gnu.org>
* value.h (VALUE_OPTIMIZED_OUT): Delete.
	(value_optimized_out, set_value_optimized_out): Declare.
	* value.c (set_value_optimized_out, value_optimized_out): Define.
	* valprint.c, findvar.c, dwarf2loc.c: Update.
2005-02-07 04:50:28 +00:00
Andrew Cagney 00a4c844d2 2004-11-09 Andrew Cagney <cagney@gnu.org>
* value.h (struct value): Delete field bfd_section.
	(VALUE_BFD_SECTION): Delete macro.
	(COERCE_REF): Update.
	(value_at, value_at_lazy): Delete asection parameter.
	* printcmd.c (print_formatted, x_command): Update.
	(do_examine): Delete asection parameter.
	(next_section): Delete variable.
	* valops.c (value_cast, value_at, value_at_lazy)
	(value_coerce_function, value_addr, value_ind, value_string)
	(find_rt_vbase_offset, value_full_object): Update.
	* hpacc-abi.c (hpacc_virtual_fn_field)
	(hpacc_value_rtti_type): Update.
	* gnu-v3-abi.c (gnuv3_rtti_type, gnuv3_virtual_fn_field)
	(gnuv3_baseclass_offset): Update.
	* f-valprint.c (f_val_print): Update.
	* c-valprint.c (c_val_print): Update.
	* p-valprint.c (pascal_val_print): Update.
	* jv-valprint.c (java_value_print): Update.
	* jv-lang.c (java_class_from_object, evaluate_subexp_java): Update.
	* ada-lang.c (ada_value_primitive_packed_val)
	(ada_evaluate_subexp): Update.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc): Update.
	* expprint.c (print_subexp_standard): Update.
	* infcall.c (call_function_by_hand): Update.
	* valarith.c (value_add): Update.
	* eval.c (evaluate_subexp_standard): Update.
	* values.c (allocate_value, value_copy, value_static_field): Update.
	* findvar.c (read_var_value, locate_var_value): Update.
2004-11-09 14:43:27 +00:00
Jim Blandy 87808bd699 * dwarf2expr.h (struct dwarf_expr_context): New members
'num_pieces' and 'pieces', for returning the result of an
expression that uses DW_OP_piece.
(struct dwarf_expr_piece): New struct type.
* dwarf2expr.c (new_dwarf_expr_context): Initialize num_pieces and
pieces.
(free_dwarf_expr_context): Free pieces, if any.
(add_piece): New function.
(execute_stack_op): Implement DW_OP_piece.
* dwarf2loc.c (dwarf2_evaluate_loc_desc): If the result of the
expression is a list of pieces, print an error message.
(dwarf2_loc_desc_needs_frame): If the expression yields
pieces, and any piece is in a register, then we need a frame.
2004-08-24 21:01:49 +00:00
Jim Blandy 5ca2e3275d * dwarf2loc.c (dwarf2_evaluate_loc_desc): Wait to fetch the top of
the stack until we've decided what sort of result the evaluation
has produced.  Use separate variables, with more specific names.
2004-08-24 17:31:49 +00:00
Bryce McKinlay 8edfa9268a 2004-05-13 Bryce McKinlay <mckinlay@redhat.com>
* dwarf2loc.c (find_location_expression): Use ANOFFSET to adjust
	base_address for shared libraries.
2004-05-13 17:30:41 +00:00
Andrew Cagney a67af2b9de 2004-01-26 Andrew Cagney <cagney@redhat.com>
* dwarf2loc.c (dwarf_expr_frame_base): Use SYMBOL_OPS instead of
	SYMBOL_LOCATION_FUNCS
	(dwarf2_loclist_funcs, dwarf2_locexpr_funcs): Change type to
	"struct symbol_ops".
	* dwarf2loc.h (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Change
	type to "struct symbol_ops".
	* symtab.h (struct symbol_ops): Rename "struct location_funcs".
	(struct symbol): Replace ".aux_value.loc.funcs" and
	".aux_value.loc.baton" with ".ops" and ".aux_value.ptr".
	(SYMBOL_OBJFILE): Delete macro.
	(SYMBOL_LOCATION_FUNCS): Delete macro.
	(SYMBOL_LOCATION_BATON): Update.
	* dwarf2read.c (dwarf2_symbol_mark_computed): Set SYMBOL_OPS
	intead of SYMBOL_LOCATION_FUNCS.
	* ax-gdb.c (gen_var_ref): Ditto.
	* printcmd.c (address_info): Ditto.
	* findvar.c (read_var_value): Ditto.
	(symbol_read_needs_frame): Ditto.
2004-01-26 20:36:32 +00:00
Daniel Jacobowitz f630a401b4 * dwarf2loc.c (dwarf2_loc_desc_needs_frame): Variables in a
register do need a frame.
2003-09-11 15:02:51 +00:00
Elena Zannoni 32ffcbeda5 2003-07-22 Elena Zannoni <ezannoni@redhat.com>
* dwarf2loc.c (locexpr_describe_location): Fix typos.
2003-07-22 18:24:42 +00:00
Elena Zannoni c193f044f3 2003-07-22 Elena Zannoni <ezannoni@redhat.com>
dwarf2loc.c (locexpr_describe_location): Fix typo.
2003-07-22 18:16:05 +00:00
Elena Zannoni c3228f1238 2003-07-22 Elena Zannoni <ezannoni@redhat.com>
* findvar.c (read_var_value): Remove case for thread local storage
	variables.  It is now entirely handled by the dwarf2 location
	expression code.
	* printcmd.c (address_info): Ditto.
	* symtab.h (address_class): Remove LOC_THREAD_LOCAL_STATIC
	enumeration value.
	(struct symbol): Remove objfile field, which was used by
	LOC_THREAD_LOCAL_STATIC only.
	* dwarf2read.c (decode_locdesc): Remove is_thread_local variable.
	* dwarf2loc.h (struct dwarf2_loclist_baton): Add comment about
	usage of objfile pointer.
	* dwarf2loc.c (locexpr_describe_location): Add case to handle
	thread local variables.
	Add include of objfiles.h.
	* dwarf2expr.c (execute_stack_op): Add comments about thread local
	storage variables.
	* Makefile.in (dwarf2loc.o): Update dependencies.
2003-07-22 15:41:59 +00:00
Andrew Cagney af1342ab7f 2003-05-22 Andrew Cagney <cagney@redhat.com>
* stack.c (frame_info): Inline extract_address, replacing it with
	extract_unsigned_integer.
	* findvar.c (unsigned_pointer_to_address): Ditto.
	* dwarf2loc.c (dwarf_expr_read_reg): Ditto.
	* dwarf2expr.c (dwarf2_read_address): Ditto.
	* frame.c (frame_pc_unwind): Update comment.
	* dummy-frame.c (deprecated_read_register_dummy): Update comment.
2003-05-22 18:37:05 +00:00
Mark Kettenis b6b08ebfbf * dwarf2loc.c (find_location_expression): Change type of second
argument to `size_t *'.
(loclist_read_variable, loclist_tracepoint_var_ref): Use size_t
for size variable.
2003-05-18 15:49:51 +00:00
Kevin Buettner 051caad9cb * dwarf2loc.c (dwarf2_evaluate_loc_desc): Invoke DWARF2_REG_TO_REGNUM
on the DWARF2 register number prior to fetching a register.
2003-04-22 23:18:26 +00:00
Daniel Jacobowitz 61fbb938d6 * dwarf2expr.h (struct dwarf_expr_context): Remove extra arguments
to read_reg and update its comment.  Remove regnum member.
	* dwarf2expr.c (execute_stack_op): Remove memaddr and expr_lval.
	Don't call read_reg when setting in_reg.  Call read_reg to get
	the frame base if it's in a register.  Return the register number
	on the stack instead of in the context.  Remove extra arguments
	to read_reg.
	* dwarf2loc.c (dwarf_expr_read_reg): Remove extra arguments.
	(dwarf2_evaluate_loc_desc): Call value_from_register.  Expect
	the register number on the expression stack.
	(needs_frame_read_reg): Remove extra arguments.
2003-04-13 15:53:44 +00:00