aboutsummaryrefslogtreecommitdiff
path: root/gcc/debug.h
AgeCommit message (Collapse)AuthorFilesLines
2017-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r243994
2016-09-20debug.h (gcc_debug_hooks): Add filename parameter to early_finish hook.Richard Biener1-1/+1
2016-09-20 Richard Biener <rguenther@suse.de> * debug.h (gcc_debug_hooks): Add filename parameter to early_finish hook. * debug.c (do_nothing_debug_hooks): Adjust. * dbxout.c (dbx_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * dwarf2out.c (dwarf2_lineno_debug_hooks): Likewise. (dwarf2out_finish): Move producer, filename and path annotation ... (dwarf2out_early_finish): ... here. Remove in_lto_p special-casing. * cgraphunit.c (symbol_table::finalize_compilation_unit): Adjust. lto/ * lto.c (lto_main): Call early_finish with "<artificial>" as filename. From-SVN: r240255
2016-01-04Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r232055
2015-12-17DWARF: handle variable-length records and variant partsPierre-Marie de Rodat1-0/+5
Enhance the DWARF back-end to emit proper descriptions for variable-length records as well as variant parts in records. In order to achieve this, generate DWARF expressions ("location descriptions" in dwarf2out's parlance) for size and data member location attributes. Also match QUAL_UNION_TYPE data types as variant parts, assuming the formers appear only to implement the latters (which is the case at the moment: only the Ada front-end emits them). Note that very few debuggers can handle these descriptions (GDB does not yet), so in order to ease the the transition enable these only when -fgnat-encodings=minimal. gcc/ada/ChangeLog: * gcc-interface/decl.c (gnat_to_gnu_entity): Disable ___XVS GNAT encodings when -fgnat-encodings=minimal. (components_to_record): Disable ___XVE, ___XVN, ___XVU and ___XVZ GNAT encodings when -fgnat-encodings=minimal. * gcc-interface/utils.c (maybe_pad_type): Disable __XVS GNAT encodings when -fgnat-encodings=minimal. gcc/ChangeLog: * debug.h (struct gcc_debug_hooks): Add a new size_function hook. * debug.c (do_nothing_debug_hooks): Set the size_function field to no-op. * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * stor-layout.c (finalize_size_functions): Let the debug info back-end know about the implementation of size functions. * dwarf2out.h (dw_discr_list_ref): New typedef. (enum dw_val_class): Add value classes for discriminant values and discriminant lists. (struct dw_discr_value): New structure. (struct dw_val_node): Add discriminant values and discriminant lists to the union. (struct dw_loc_descr_node): Add frame_offset_rel and dw_loc_frame_offset (only for checking) fields to handle DWARF procedures generation. (struct dw_discr_list_node): New structure. * dwarf2out.c (dwarf2out_size_function): New. (dwarf2_debug_hooks): Set the size_function field to dwarf2out_size_function. (dwarf2_lineno_debug_hooks): Set the size_function field to no-op. (new_loc_descr): Initialize the dw_loc_frame_offset field. (dwarf_proc_stack_usage_map): New. (dw_val_equal_p): Handle discriminants. (size_of_discr_value): New. (size_of_discr_list): New. (size_of_die): Handle discriminants. (add_loc_descr_to_each): New. (add_loc_list): New. (print_discr_value): New. (print_dw_val): Handle discriminants. (value_format): Handle discriminants. (output_discr_value): New. (output_die): Handle discriminants. (output_loc_operands): Handle DW_OP_call2 and DW_OP_call4. (uint_loc_descriptor): New. (uint_comparison_loc_list): New. (loc_list_from_uint_comparison): New. (add_discr_value): New. (add_discr_list): New. (AT_discr_list): New. (loc_descr_to_next_no_op): New. (free_loc_descr): New. (loc_descr_without_nops): New. (struct loc_descr_context): Add a dpi field. (struct dwarf_procedure_info): New helper structure. (new_dwarf_proc_die): New. (is_handled_procedure_type): New. (resolve_args_picking_1): New. (resolve_args_picking): New. (function_to_dwarf_procedure): New. (copy_dwarf_procedure): New. (copy_dwarf_procs_ref_in_attrs): New. (copy_dwarf_procs_ref_in_dies): New. (break_out_comdat_types): Copy DWARF procedures along with the types that reference them. (loc_list_from_tree): Rename into loc_list_from_tree_1. Handle CALL_EXPR in the cases suitable for DWARF procedures. Handle for PARM_DECL when generating a location description for a DWARF procedure. Handle big unsigned INTEGER_CST nodes. Handle NON_LVALUE_EXPR, EXACT_DIV_EXPR and all unsigned comparison operators. Add a wrapper for loc_list_from_tree that strips DW_OP_nop operations from the result. (type_byte_size): New. (struct vlr_context): New helper structure. (field_byte_offset): Change signature to return either a constant offset or a location description for dynamic ones. Handle dynamic byte offsets with constant bit offsets and handle fields in variant parts. (add_data_member_location): Change signature to handle dynamic member offsets and fields in variant parts. Update call to field_byte_offset. Handle location lists. Emit a variable data member location only when -fgnat-encodings=minimal. (add_bound_info): Emit self-referential bounds only when -fgnat-encodings=minimal. (add_byte_size_attribute): Use type_byte_size in order to handle dynamic type sizes. Emit variable byte size only when -fgnat-encodings=minimal and when the target DWARF version allows them. (add_bit_offset_attribute): Change signature to handle variable-length records. Update call to field_byte_offset. (gen_descr_array_type_die): Update call to gen_field_die. Update loc_descr_context literal. (gen_type_die_for_member): Likewise. (gen_subprogram_die): Update calls to get_decl_die. (gen_field_die): Change signature to handle variable-length records. Update calls to add_bit_offset_attribute and add_data_member_location_attribute. (gen_inheritance_die): Update call to add_data_member_location_attribute. (gen_decl_die): Change signature to handle variable-length records. Update call to gen_field_die. (gen_inheritance_die): Change signature to handle variable-length records. Update call to add_data_member_location_attribute. (is_variant_part): New. (analyze_discr_in_predicate): New. (get_discr_value): New. (analyze_variants_discr): New. (gen_variant_part): New. (gen_member_die): Update calls to gen_decl_die. Call instead gen_variant_part for variant parts. (gen_type_die_with_usage): Update calls to gen_decl_die. (process_scope_var): Likewise. (force_decl_die): Likewise. (declare_in_namespace): Likewise. (dwarf2out_decl): Likewise. (prune_unused_types_walk_loc_descr): New. (prune_unused_types_walk_attribs): Mark DIEs referenced by location descriptions and loc. descr. lists. (prune_unused_types_walk): Don't mark DWARF procedures by default. Mark variant parts since nothing is supposed to reference them. (dwarf2out_init): Allocate dwarf_proc_stack_usage_map. (dwarf2out_c_finalize): Deallocate and reset dwarf_proc_stack_usage_map. gcc/testsuite/ChangeLog: * gnat.dg/specs/debug1.ads: Update the expected number of DW_AT_artificial attribute in compiler output. From-SVN: r231762
2015-08-14Add DWARF2_LINENO_DEBUGGING_INFO, and use it for nvptxThomas Schwinge1-0/+1
gcc/ * config/nvptx/nvptx.c (nvptx_option_override): Don't override debug options. * config/nvptx/nvptx.h (DWARF2_LINENO_DEBUGGING_INFO): Define. (DWARF2_DEBUGGING_INFO): Don't define. * debug.h (dwarf2_lineno_debug_hooks): Declare. * toplev.c (process_options): Add a case for it. * dwarf2out.c (dwarf2_lineno_debug_hooks): New variable. (dwarf2out_init): Skip most initializations if DWARF2_LINENO_DEBUGGING_INFO, but set cur_line_info_table in that case. * defaults.h (PREFERRED_DEBUGGING_TYPE): Also use DWARF2_DEBUG if DWARF2_LINENO_DEBUGGING_INFO. * opts.c (set_debug_level): Likewise. Co-Authored-By: Bernd Schmidt <bernds@codesourcery.com> From-SVN: r226890
2015-06-11Restore DW_AT_abstract_origin for cross-unit call sitesPierre-Marie de Rodat1-0/+4
PR debug/66503 gcc/ChangeLog: * debug.h (struct gcc_debug_hooks): Add a register_main_translation_unit hook. * debug.c (do_nothing_debug_hooks): Provide a function for this new hook. * dbxout.c (dbx_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * dwarf2out.c (main_translation_unit): New global variable. (dwarf2out_register_main_translation_unit): New function implementing the new hook. (dwarf2_debug_hooks): Assign dwarf2out_register_main_translation_unit to this new hook. (dwarf2out_init): Associate any main translation unit to comp_unit_die (). * c/c-decl.c (pop_scope): Register the main translation unit through the new debug hook. * cp/decl.c (cxx_init_decl_processing): Likewise. gcc/ada/ChangeLog: * gcc-interface/utils.c (get_global_context): Register the main translation unit through the new debug hook. gcc/fortran/ChangeLog: * f95-lang.c (gfc_create_decls): Register the main translation unit through the new debug hook. From-SVN: r224371
2015-06-05Merge debug-early branch into mainline.Aldy Hernandez1-4/+38
* dwarf2out.c: Remove deferred_locations*. (dwarf2_debug_hooks): Add early_finish hook. Remove global_decl hook. Add early_global_decl and late_global_decl hook. New global early_dwarf. New structure set_early_dwarf. (output_die): Indicate whether a DIE was generated early when generating assembly with -dA. (struct limbo_die_struct): Document created_for field. Remove file_table_last_lookup. (remove_AT): Return TRUE if successful. (remove_child_TAG): Clear die_parent. (reparent_child): New function abstracted from... (splice_child_die): ...here. (new_die): ICE if a DIE ends up in limbo too late. (check_die): New. (defer_location): Remove. (add_subscript_info): Reuse DW_TAG_subrange_type if available. (fill_variable_array_bounds): New. (decl_start_label): Call fill_variable_array_bounds. (gen_formal_parameter_die): Rewrite to reuse previously generated DIEs. (gen_subprogram_die): Same. (gen_variable_die): Same. (gen_const_die): Same. (gen_label_die): Same. (gen_lexical_block_die): Same. (decl_will_get_specification_p): New. (local_function_static): New. (gen_struct_or_union_type_die): Fill in variable-length fields. (gen_typedef_die): Fill in variable-length typedefs. (gen_tagged_type_die): Gracefully return on error_mark_node. Handle re-entrancy. (gen_type_die_with_usage): Handle variable-length types. Remove duplicate code for ARRAY_TYPE case. (process_scope_var): Only process imported modules during early dwarf. (dwarf2out_early_global_decl): New. (dwarf2out_late_global_decl): Rename from dwarf2out_global_decl. (dwarf2out_type_decl): Set early_dwarf while calling dwarf2out_decl. (dwarf2out_decl): Verify that we did not recreate a previously generated DIE. Do not return on DECL_EXTERNALs in VAR_DECLs. Abstract some code to local_function_static. (lookup_filename): Remove use of file_table_last_lookup. Gracefully exit on missing file_name. (dwarf2out_finish): Verify limbo list. Remove deferred_locations_list use. Move deferred_asm_name and limbo flushing to... (dwarf2out_early_finish): ...here. New. (dwarf2out_c_finalize): Remove set of deferred_location_list, deferred_asm_name, and file_table_last_lookup. * cgraph.h (referred_to_p): Add default argument. * cgraphunit.c (referred_to_p): Add and handle include_self argument. (analyze_functions): Add first_time argument. Call check_global_declaration for all symbols. Call late_global_decl for nodes for moribund nodes. (finalize_compilation_unit): Add new argument to analyze_functions. Call early_global_decl for functions. Call early_finish debug hook. * dbxout.c (dbxout_early_global_decl): New. (dbxout_late_global_decl): New. Adapted from dbxout_global_decl. (dbx_debug_hooks): Add new hooks. (xcoff_debug_hooks): Same. * debug.c (do_nothing_debug_hooks): Add early_finish field. Add early and late debug hooks. Remove global_decl hook. * debug.h (struct gcc_debug_hooks): Add early_finish, early_global_decl, and late_global_decl fields. Remove global_decl field. Document gcc_debug_hooks. * gengtype.c (output_typename): Remove. * godump.c (go_early_global_decl): New. (go_late_global_decl): New. (go_global_decl): Remove. (dump_go_spec_init): Remove global_decl. Add {early,late}_global_decl. * langhooks-def.h (LANG_HOOKS_WRITE_GLOBALS): Remove. (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): New. * langhooks.c (lhd_warn_unused_global_decl): Adjust comment. (write_global_declarations): Remove. (global_decl_processing): New. * langhooks.h (struct lang_hooks_for_decls): Remove final_write_globals field. Add post_compilation_parsing_cleanups field. * passes.c (rest_of_decl_compilation): Call early_global_decl. * sdbout.c: Add early and late_global_decl hooks. Remove sdbout_global_decl hook. Add early_finish field for sdb_debug_hooks. (sdbout_global_decl): Remove. (sdbout_early_global_decl): New. (sdbout_late_global_decl): New. * timevar.def (TV_PHASE_LATE_PARSING_CLEANUPS): New. * toplev.c (check_global_declaration): Rename from check_global_declaration_1. Adapt to use symtab infrastructure. (check_global_declarations): Remove. (emit_debug_global_declarations): Remove. (compile_file): Remove call to final_write_globals langhook. Run the actual compilation process. Perform any post compilation parser cleanups. Generate late debug info. * toplev.h (check_global_declaration): New. (check_global_declaration_1): Remove. (check_global_declarations): Remove. (write_global_declarations): Remove. (emit_debug_global_declarations): Remove. (global_decl_processing): New. * tree-core.h (struct tree_block): Add DIE field. * tree.h (BLOCK_DIE): New. * vmsdbgout.c (vmsdbgout_global_decl): Remove function and its use throughout. (vmsdbgout_early_global_decl): New. (vmsdbgout_late_global_decl): New. Add early_finish debug hook field to vmsdbg_debug_hooks. Remove vmsdbgout_decl to vmsdbgout_function_decl. Add early and late_global_decl debug hooks. From-SVN: r224161
2015-01-05Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r219188
2014-09-04Revert incorrect merging of debug-early branch.Aldy Hernandez1-8/+2
From-SVN: r214914
2014-09-04+ * c/c-decl.c (write_global_declarations_1): Call global_decl() + with ↵Aldy Hernandez1-2/+6
early=true. + * c/c-decl.c (write_global_declarations_1): Call global_decl() + with early=true. + (write_global_declarations_2): Call global_decl() with + early=false. + * dbxout.c (dbxout_global_decl): New argument. + * debug.c (do_nothing_debug_hooks): Use debug_nothing_tree_bool + for global_decl hook. + (debug_nothing_tree_bool): New. + (struct gcc_debug_hooks): New argument to global_decl. + * dwarf2out.c (output_die): Add misc debugging information. + (gen_variable_die): Do not reparent children. + (dwarf2out_global_decl): Add new documentation. Add EARLY + argument. + (dwarf2out_decl): Make sure we don't generate new DIEs if we + already have a DIE. + * cp/name-lookup.c (do_namespace_alias): New argument to + global_decl debug hook. + * fortran/trans-decl.c (gfc_emit_parameter_debug_info): Same. + * godump.c (go_global_decl): Same. + * lto/lto-lang.c (lto_write_globals): Same. + * sdbout.c (sdbout_global_decl): Same. + * toplev.c (emit_debug_global_declarations): Same. + * vmsdbgout.c (vmsdbgout_global_decl): Same. + * tree.c (free_lang_data_in_decl): Do not call + dwarf2out_early_decl from here. From-SVN: r214911
2014-09-04dearly: Emit DIEs for decls early in the compilation process.Aldy Hernandez1-0/+2
This is the original patch from Michael Matz, ported to a more recent mainline. From-SVN: r214906
2014-08-21Debug hooks: use rtx_insn and rtx_code_labelDavid Malcolm1-4/+4
2014-08-21 David Malcolm <dmalcolm@redhat.com> * debug.h (struct gcc_debug_hooks): Strengthen param 1 of hook "label" from rtx to rtx_code_label *. Strengthen param 1 of "var_location" hook from rtx to rtx_insn *. (debug_nothing_rtx): Delete in favor of... (debug_nothing_rtx_code_label): New prototype. (debug_nothing_rtx_rtx): Delete unused prototype. (debug_nothing_rtx_insn): New prototype. * final.c (final_scan_insn): Add checked cast to rtx_insn * when invoking debug_hooks->var_location (in two places, one in a NOTE case of a switch statement, the other guarded by a CALL_P conditional. Add checked cast to rtx_code_label * when invoking debug_hooks->label (within CODE_LABEL case of switch statement). * dbxout.c (dbx_debug_hooks): Update "label" hook from debug_nothing_rtx to debug_nothing_rtx_code_label. Update "var_location" from debug_nothing_rtx to debug_nothing_rtx_insn. (xcoff_debug_hooks): Likewise. * debug.c (do_nothing_debug_hooks): Likewise. (debug_nothing_rtx): Delete in favor of... (debug_nothing_rtx_insn): New function. (debug_nothing_rtx_rtx): Delete unused function. (debug_nothing_rtx_code_label): New function. * dwarf2out.c (dwarf2_debug_hooks): Update "label" hook from debug_nothing_rtx to debug_nothing_rtx_code_label. (dwarf2out_var_location): Strengthen param "loc_note" from rtx to rtx_insn *. * sdbout.c (sdb_debug_hooks): Update "var_location" hook from debug_nothing_rtx to debug_nothing_rtx_insn. (sdbout_label): Strengthen param "insn" from rtx to rtx_code_label *. * vmsdbgout.c (vmsdbg_debug_hooks): Update "label" hook from debug_nothing_rtx to debug_nothing_rtx_code_label. Update "var_location" hook from debug_nothing_rtx to debug_nothing_rtx_insn. From-SVN: r214259
2014-01-02Update copyright years in gcc/Richard Sandiford1-1/+1
From-SVN: r206289
2013-01-10Update copyright years in gcc/Richard Sandiford1-2/+1
From-SVN: r195098
2011-07-07dwarf2: Extract cfi creation to a new pass.Richard Henderson1-3/+2
* tree-pass.h (pass_dwarf2_frame): Declare. * passes.c (init_optimization_passes): Add it. * dwarf2cfi.c (dwarf2out_frame_debug): Make static. (create_cfi_notes): Rename from dwarf2out_frame_debug_after_prologue; make static, do not call add_cfis_to_fde. (dwarf2out_frame_debug_init, dwarf2cfi_function_init, dwarf2out_frame_init): Merge into... (execute_dwarf2_frame): ... here. New function. (dwarf2out_do_frame, dwarf2out_do_cfi_asm): Make boolean. Change saved_do_cfi_asm to a tri-state variable. (gate_dwarf2_frame, pass_dwarf2_frame): New. * dwarf2out.c (dwarf2out_begin_prologue): Only allocate the fde if it has yet to be done. Don't call dwarf2cfi_function_init. * dwarf2out.h, debug.h: Update decls. * final.c (final_start_function): Don't call dwarf2out_frame_debug_init or dwarf2out_frame_debug_after_prologue. * lto-streamer-in.c (lto_init_eh): Don't call dwarf2out_frame_init. * toplev.c (lang_dependent_init): Likewise. From-SVN: r176019
2011-04-05debug.h (debug_flush_symbol_queue, [...]): Delete.Nathan Froyd1-6/+0
* debug.h (debug_flush_symbol_queue, debug_queue_symbol): Delete. (debug_free_queue, debug_nesting, symbol_queue_index): Delete. * final.c (debug_flush_symbol_queue, debug_queue_symbol): Move these... (debug_free_queue, debug_nesting, symbol_queue_index): ...and these... * dbxout.c: ...to here. Make static. From-SVN: r171981
2011-03-16emit-rtl.c (try_split): Don't call copy_call_info debug hook.Jakub Jelinek1-27/+1
* emit-rtl.c (try_split): Don't call copy_call_info debug hook. * calls.c: Remove debug.h include. (emit_call_1): Don't call virtual_call_token debug hook. * dwarf2out.c (debug_dcall_section, debug_vcall_section, dcall_entry, vcall_entry, dcall_table, vcall_table, vcall_insn, vcall_insn_table, DEBUG_DCALL_SECTION, DEBUG_VCALL_SECTION, size_of_dcall_table, output_dcall_table, size_of_vcall_table, output_vcall_table, dwarf2out_direct_call, vcall_insn_table_hash, vcall_insn_table_eq, store_vcall_insn, lookup_vcall_insn, dwarf2out_virtual_call_token, dwarf2out_copy_call_info, dwarf2out_virtual_call): Remove. (dwarf2_debug_hooks): Remove direct_call, virtual_call_token, copy_call_info and virtual_call hooks. (dwarf2out_init): Don't initialize vcall_insn_table, debug_dcall_section and debug_vcall_section. (prune_unused_types): Don't mark nodes from dcall_table. (dwarf2out_finish): Don't output dcall or vcall tables. * final.c (final_scan_insn): Don't call direct_call or virtual_call debug hooks. * debug.h (struct gcc_debug_hooks): Remove direct_call, virtual_call_token, copy_call_info and virtual_call hooks. (debug_nothing_uid): Remove prototype. * sdbout.c (sdb_debug_hooks): Remove direct_call, virtual_call_token, copy_call_info and virtual_call hooks. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Likewise. * debug.c (do_nothing_debug_hooks): Likewise. (debug_nothing_uid): Remove. * doc/invoke.texi (-fenable-icf-debug): Remove. * common.opt (-fenable-icf-debug): Likewise. * g++.dg/debug/dwarf2/icf.C: Adjust for -fenable-icf-debug removal. From-SVN: r171037
2010-11-15godump.c: New file.Ian Lance Taylor1-0/+9
gcc/: * godump.c: New file. * common.opt (fdump-go-spec=): New option. * tree.h: Add comments for TYPE_SYMTAB_ADDRESS and friends. (TYPE_SYMTAB_IS_ADDRESS, TYPE_SYMTAB_IS_POINTER): Define. (TYPE_SYMTAB_IS_DIE): Define. (struct tree_type): Change GTY for symtab field to use TYPE_SYMTAB_IS_ADDRESS and friends and to use a debug_hooks field to pick the union field. * debug.h (struct gcc_debug_hooks): Add tree_type_symtab_field. (dump_go_spec_init): Declare. * toplev.c (process_options): Handle flag_dump_go_spec. * debug.c: Include "tree.h". (do_nothing_debug_hooks): Set tree_type_symtab_field. * dwarf2out.c (dwarf2_debug_hooks): Likewise. * dbxout.c (dbx_debug_hooks): Likewise. (xcoff_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. Do not define if SDB_DEBUGGING_INFO is not defined. * doc/invoke.texi (Option Summary): Mention -fdump-go-spec. (Overall Options): Document -fdump-go-spec. * Makefile.in (OBJS-common): Add godump.o. (debug.o): Add dependency on $(TREE_H). (godump.o): New target. (GTFILES): Add $(srcdir)/godump.c. gcc/c-family/: * c-lex.c (init_c_lex): Set macro debug callbacks if flag_dump_go_spec is set. From-SVN: r166770
2010-06-16This patch adds the end prologue and begin epilogue markers in Dwarf2 Douglas B Rupp1-1/+6
that are needed by the VMS debugger on I64. * config/ia64/vms.h (ASM_OUTPUT_DWARF_DELTA_UNITS): Remove. (ASM_OUTPUT_DWARF_VMS_DELTA: Define new macro. * dbxout.c (gcc_debug_hooks): New entry begin_epilogue. * debug.c: Likewise. * sdbout.c: Likewise. * vmsdbgout.c: Likewise. * debug.h: Likewise. (dwarf2out_vms_{begin,end}_prologue): Declare. * doc/tm.texi (ASM_OUTPUT_DWARF_VMS_DELTA): Document. * dwarf2asm.c (dw2_asm_output_vms_delta): New function. (ASM_OUTPUT_DWARF_VMS_DELTA): Call it. * dwarf2asm.h (dw2_asm_output_vms_delta): Declare. * dwarf2out.c (dw_fde_struct): New fields dw_fde_vms_{end,begin}_prologue. (PROLOGUE_END_LABEL, EPILOGUE_BEGIN_LABEL): New macros. (dwarf2out_begin_prologue): Set dw_fde_struct defaults for above. (dwarf2out_vms_end_prologue): New function. (dwarf2out_vms_begin_epilogue): New function. (dw_val_struct): New value dw_val_class_vms_delta. (gcc_debug_hooks): New entry begin_epilogue. Set end_prologue, begin_epilogue for VMS. (AT_vms_delta1, AT_vms_delta2, add_AT_vms_delta): Declare new static functions. (dwarf_attr_name): New cases DW_AT_HP_{prologue,epilogue}. (AT_vms_delta1, AT_vms_delta2, add_AT_vms_delta): New static functions. (print_die): New case dw_val_class_vms_delta. (attr_checksum): Likewise. (same_dw_val_p: Likewise. (size_of_die): Likewise. (value_format): Likewise. (output_die): Likewise. (gen_subprogram_die): Call add_AT_vms_delta on VMS. (dwarf2out_begin_epilogue): Rename to dwarf2out_cfi_begin_epilogue * dwarf2out.h (dwarf2out_begin_epilogue): Rename to dwarf2out_cfi_begin_epilogue * final.c (final_scan_insn): Likewise. Call begin_epilogue. From-SVN: r160858
2009-10-29re PR debug/41700 (g++.dg/debug/dwarf2/icf.C)Cary Coutant1-0/+7
gcc/ChangeLog: PR debug/41700 * dwarf2out.c (dwarf2_debug_hooks): Add entries for new hook (two locations in the source). (store_vcall_insn): New function. (lookup_vcall_insn): New function. (dwarf2out_virtual_call_token): Use store_vcall_insn. (dwarf2out_copy_call_info): New function. (dwarf2out_virtual_call): Use lookup_vcall_insn. * emit-rtl.c (try_split): Call copy_call_info debug hook. * debug.h (struct gcc_debug_hooks): Add copy_call_info hook. * debug.c (do_nothing_debug_hooks): Add dummy entry for new hook. (debug_nothing_rtx_rtx): New dummy hook. * dbxout.c (dbx_debug_hooks): Add dummy entry for new hook. (xcoff_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. From-SVN: r153719
2009-10-17re PR debug/40521 (-g causes GCC to generate .eh_frame)Jakub Jelinek1-0/+4
PR debug/40521 * debug.h (struct gcc_debug_hooks): Add assembly_start hook. * cgraphunit.c (cgraph_optimize): Call it. * dwarf2out.c (dwarf2out_init): Move .cfi_sections printing into... (dwarf2out_assembly_start): ... here. New hook. (dwarf2out_debug_hooks): Add dwarf2out_assembly_start. * debug.c (do_nothing_debug_hooks): Do nothing for assembly_start hook. * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Add vmsdbgout_assembly_start. (vmsdbgout_assembly_start): New hook. From-SVN: r152930
2009-10-08Add support for debugging with ICF (Identical Code Folding).Cary Coutant1-0/+20
gcc/ChangeLog: Add support for debugging with ICF (Identical Code Folding). * calls.c (debug.h): New #include. (emit_call_1): Call virtual_call_token debug hook. * common.opt (-fenable-icf-debug): New option. * dwarf2out.c (dwarf2_debug_hooks): Add entries for new hooks (two locations in the source). (poc_label_num): New variable. (dcall_entry, vcall_entry): New typedefs. (dcall_table, vcall_table): New variables. (struct vcall_insn): New type. (vcall_insn_table): New variable. (DEBUG_DCALL_SECTION, DEBUG_VCALL_SECTION): New macros. (size_of_dcall_table): New function. (output_dcall_table): New function. (size_of_vcall_table): New function. (output_vcall_table): New function. (dwarf2out_direct_call): New function. (vcall_insn_table_hash): New function. (vcall_insn_table_eq): New function. (dwarf2out_virtual_call_token): New function. (dwarf2out_virtual_call): New function. (dwarf2out_init): Allocate new tables and sections. (prune_unused_types): Mark DIEs referenced from direct call table. (dwarf2out_finish): Output direct and virtual call tables. * final.c (final_scan_insn): Call direct_call and virtual_call debug hooks. * debug.h (struct gcc_debug_hooks): Add direct_call, virtual_call_token, virtual_call hooks. (debug_nothing_uid): New function. * debug.c (do_nothing_debug_hooks): Add dummy entries for new hooks. (debug_nothing_uid): New function. * dbxout.c (dbx_debug_hooks): Add dummy entries for new hooks. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * doc/invoke.texi (-fenable-icf-debug): New option. gcc/testsuite/ChangeLog: Add support for debugging with ICF (Identical Code Folding). * g++.dg/debug/dwarf2/icf.C: New test. From-SVN: r152577
2009-06-17dbxout.c (dbxout_source_line): Add is_stmt parameter.Cary Coutant1-4/+4
* dbxout.c (dbxout_source_line): Add is_stmt parameter. Change caller. * debug.c (struct gcc_debug_hooks): Change placeholder for source_line hook. (debug_nothing_int_charstar_int): Replaced by... (debug_nothing_int_charstar_int_bool): ...this. * debug.h (struct gcc_debug_hooks): Add is_stmt parameter to source_line prototype. (debug_nothing_int_charstar_int): Replaced by... (debug_nothing_int_charstar_int_bool): ...this. * defaults.h (SUPPORTS_DISCRIMINATOR): New constant. * dwarf2out.c (dwarf2out_source_line): Add is_stmt parameter. Output is_stmt operand when necessary. * final.c (last_is_stmt): New variable. (final_start_function): Initialize last_is_stmt. (final_scan_insn): Pass is_stmt to source_line debug hook. (notice_source_line): Add is_stmt parameter. * sdbout.c (sdbout_source_line): Add is_stmt parameter. * vmsdbgout.c (vmsdbgout_source_line): Add is_stmt parameter. Change callers. * xcoffout.c (xcoffout_source_line): Add is_stmt parameter. * xcoffout.h (xcoffout_source_line): Add is_stmt parameter. From-SVN: r148635
2009-06-04basic-block.h (struct basic_block_def): Add discriminator field.Cary Coutant1-2/+4
* basic-block.h (struct basic_block_def): Add discriminator field. * dbxout.c (dbxout_source_line): Add new parameter. Change all callers. * debug.c (do_nothing_debug_hooks): Add additional entry. (debug_nothing_int_charstar_int): New function. * debug.h (struct gcc_debug_hooks): Add parameter to source_line hook. (debug_nothing_int_charstar_int): New declaration. * dwarf2out.c (dwarf2out_source_line): Add new parameter. Write discriminator value in .loc directive. * final.c (last_discriminator): New variable. (discriminator): New variable. (final_start_function): Initialize above variables, pass current discriminator to debug hook. (notice_source_line): Check for discriminator change. * gimple-pretty-print.c (dump_bb_header): Print discriminator value. * sdbout.c (sdbout_source_line): New parameter. * tree-cfg.c (struct locus_discrim_map): New structure type. (discriminator_per_locus): New hash table. (build_gimple_cfg): Allocate and free discriminator hash table. (make_edges): Call assign_discriminator. (locus_map_hash): New function. (locus_map_eq): New function. (next_discriminator_for_locus): New function. (same_line_p): New function. (assign_discriminator): New function. (make_cond_expr_edges): Call assign_discriminator. (make_gimple_switch_edges): Likewise. (first_non_label_stmt): New function. * vmsdbgout.c (vmsdbgout_source_line): Add new parameter. Change all callers. * xcoffout.c (xcoffout_source_line): Add new parameter. * configure.ac (gcc_cv_as_discriminator): New configury check for gas support for discriminator. * configure: Regenerate. * config.in: Regenerate. From-SVN: r148191
2009-04-28debug.h (set_name): Add comment.Catherine Moore1-0/+2
2009-04-28 Catherine Moore <clm@codesourcery.com> * debug.h (set_name): Add comment. From-SVN: r146897
2009-04-15debug.h (set_name): Declare.Catherine Moore1-0/+3
2009-04-15 Catherine Moore <clm@codesourcery.com> * debug.h (set_name): Declare. * dwarf2out.c (dwarf2out_set_name): Declare. (dwarf2_debug_hooks): Add set_name. (find_AT_string): New. (add_AT_string): Call find_AT_string. (dwarf2out_set_name): New. * cp/decl.c (grokdeclarator): Call set_name. * vmsdbgout.c (vmsdbg_debug_hooks): Add set_name_debug_nothing. * debug.c (do_nothing_debug_hooks): Likewise. * dbxout.c (dbx_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. From-SVN: r146137
2009-02-20Update Copyright years for files modified in 2008 and/or 2009.Jakub Jelinek1-1/+2
From-SVN: r144324
2008-08-29re PR fortran/29635 (debug info of modules)Jakub Jelinek1-2/+3
PR fortran/29635 PR fortran/23057 * debug.h (struct gcc_debug_hooks): Add NAME and CHILD arguments to imported_module_or_decl. (debug_nothing_tree_tree): Removed. (debug_nothing_tree_tree_tree_bool): New prototype. * debug.c (do_nothing_debug_hooks): Adjust. (debug_nothing_tree_tree): Removed. (debug_nothing_tree_tree_tree_bool): New function. * dwarf2out.c (is_symbol_die): Handle DW_TAG_module. (gen_variable_die): Put all common vars for the same COMMON block under one DW_TAG_common_block. (declare_in_namespace): Return new context_die, for Fortran return the module DIE instead of adding extra declarations into the namespace. (gen_type_die_with_usage): Adjust declare_in_namespace caller. (gen_namespace_die): If is_fortran (), generate DW_TAG_module instead of DW_TAG_namespace. If DECL_EXTERNAL is set, add DW_AT_declaration. (dwarf2out_global_decl): Don't skip Fortran global vars. (gen_decl_die): Likewise. Adjust declare_in_namespace callers. (dwarf2out_imported_module_or_decl): Add NAME and CHILD arguments. If NAME is non-NULL, add DW_AT_name. If CHILD is non-NULL, put DW_TAG_imported_declaration as child of previous DW_TAG_imported_module. * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Adjust. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * name-lookup.c (do_using_directive, cp_emit_debug_info_for_using): Adjust debug_hooks->imported_module_or_decl callers. * f95-lang.c (gfc_init_ts): New function. (LANG_HOOKS_INIT_TS): Define. * gfortran.h (gfc_use_rename): New type, moved from module.c. (gfc_get_use_rename): New macro, moved from module.c. (gfc_use_list): New type. (gfc_get_use_list): New macro. (gfc_namespace): Add use_stmts field. (gfc_free_use_stmts): New prototype. * Make-lang.in (fortran/trans-decl.o): Depend on debug.h. * module.c (gfc_use_rename, gfc_get_use_rename): Moved to gfortran.h. (gfc_use_module): Chain the USE statement info to ns->use_stmts. (gfc_free_use_stmts): New function. * symbol.c (gfc_free_namespace): Call gfc_free_use_stmts. * trans.h (struct module_htab_entry): New type. (gfc_find_module, gfc_module_add_decl): New functions. * trans.c (gfc_generate_module_code): Create NAMESPACE_DECL for the module, adjust DECL_CONTEXTs of module procedures and call gfc_module_add_decl for them. * trans-common.c (build_common_decl): Set DECL_IGNORED_P on the common variable. (create_common): Set DECL_IGNORED_P for use associated vars. * trans-decl.c: Include debug.h. (gfc_get_symbol_decl): Set DECL_IGNORED_P on use_assoc vars from modules. (build_function_decl): Allow current_function_decl's context to be a NAMESPACE_DECL. (module_htab, cur_module): New variables. (module_htab_do_hash, module_htab_eq, module_htab_decls_hash, module_htab_decls_eq, gfc_find_module, gfc_module_add_decl): New functions. (gfc_create_module_variable): Adjust DECL_CONTEXTs of module variables and types and call gfc_module_add_decl for them. (gfc_generate_module_vars): Temporarily set cur_module. (gfc_trans_use_stmts): New function. (gfc_generate_function_code): Call it. (gfc_generate_block_data): Set DECL_IGNORED_P on decl. * trans-types.c (gfc_get_derived_type): Adjust DECL_CONTEXT and TYPE_CONTEXT of module derived types. From-SVN: r139773
2008-08-07configure.ac (HAVE_GAS_CFI_PERSONALITY_DIRECTIVE): New.Richard Henderson1-0/+1
* configure.ac (HAVE_GAS_CFI_PERSONALITY_DIRECTIVE): New. * configure, config.in: Rebuild. * debug.h (dwarf2out_do_cfi_asm): Declare. * c-cppbuiltin.c (c_cpp_builtins): Use it. * dwarf2out.c (dwarf2out_do_cfi_asm): New. (dwarf2out_cfi_label, add_fde_cfi, output_call_frame_info, dwarf2out_begin_prologue, dwarf2out_end_epilogue): Use it. From-SVN: r138846
2008-01-16re PR debug/34249 (FAIL: gcc.dg/tree-prof/bb-reorg.c compilation, ↵Uros Bizjak1-0/+1
-fprofile-use -D_PROFILE_USE) PR debug/34249 * debug.h (dwarf2out_switch_text_section): Move declaration from ... * dwarf2out.c (dwarf2out_switch_text_section): ... here. Make function global. * final.c (final_scan_insn) [NOTE_INSN_SWITCH_TEXT_SECTIONS]: Depending on dwarf2out_do_frame, call dwarf2out_switch_text_section for DWARF2_UNWIND_INFO targets. From-SVN: r131570
2007-08-27alias.c (memory_modified_1, [...]): Constify.Kaveh R. Ghazi1-2/+2
* alias.c (memory_modified_1, memory_modified_in_insn_p): Constify. * basic-block.h (tree_predicted_by_p, rtl_predicted_by_p): Likewise. * bb-reorder.c (copy_bb_p): Likewise. * cfghooks.c (can_remove_branch_p, can_merge_blocks_p, predicted_by_p, can_duplicate_block_p, block_ends_with_call_p, block_ends_with_condjump_p): Likewise. * cfghooks.h (can_remove_branch_p, can_merge_blocks_p, predicted_by_p, can_duplicate_block_p, block_ends_with_call_p, block_ends_with_condjump_p): Likewise. * cfglayout.c (cfg_layout_can_duplicate_bb_p): Likewise. * cfgrtl.c (can_delete_note_p, can_delete_label_p, rtl_can_merge_blocks, cfg_layout_can_merge_blocks_p, rtl_block_ends_with_call_p, rtl_block_ends_with_condjump_p, need_fake_edge_p, rtl_can_remove_branch_p): Likewise. * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Use debug_true_const_tree instad of debug_true_tree. * debug.c (do_nothing_debug_hooks): Likewise. * debug.h (ignore_block, debug_true_const_tree): Constify. * dwarf2out.c (stack_adjust_offset, clobbers_queued_reg_save, dwarf2out_ignore_block, is_pseudo_reg, is_tagged_type, decl_ultimate_origin, block_ultimate_origin, lookup_decl_loc, same_dw_val_p, add_ranges, is_subrange_type, type_is_enum, dbx_reg_number, is_based_loc, field_type, simple_type_align_in_bits, simple_decl_align_in_bits, simple_type_size_in_bits, field_byte_offset, insert_float, type_tag, member_declared_type, is_redundant_typedef, secname_for_decl, is_inlined_entry_point): Likewise. * emit-rtl.c (const_next_insn, const_previous_insn, const_next_nonnote_insn, const_prev_nonnote_insn, const_next_real_insn, const_prev_real_insn, const_next_active_insn, const_prev_active_insn, const_next_label, const_prev_label): Likewise. * except.h (lookup_stmt_eh_region_fn, lookup_stmt_eh_region): Likewise. * haifa-sched.c (may_trap_exp, haifa_classify_insn, find_set_reg_weight, no_real_insns_p, find_set_reg_weight, sched_insn_is_legitimate_for_speculation_p): Likewise. * jump.c (reversed_comparison_code_parts, reversed_comparison_code, reversed_comparison, condjump_label): Likewise. * predict.c (rtl_predicted_by_p, tree_predicted_by_p): Likewise. * reg-stack.c (stack_regs_mentioned_p, stack_regs_mentioned): Likewise. * rtl.h (const_previous_insn, const_next_insn, const_prev_nonnote_insn, const_next_nonnote_insn, const_prev_real_insn, const_next_real_insn, const_prev_active_insn, const_next_active_insn, const_prev_label, const_next_label, modified_between_p, modified_in_p, const_note_storeskeep_with_call_p, condjump_label, reversed_comparison, reversed_comparison_code, reversed_comparison_code_parts, memory_modified_in_insn_p, stack_regs_mentioned): Likewise. * rtlanal.c (modified_between_p, modified_in_p, const_note_stores, keep_with_call_p): Likewise. * sched-deps.c (deps_may_trap_p, sched_get_condition, conditions_mutex_p, sched_insns_conditions_mutex_psd_next_list, sd_lists_size, sd_lists_empty_p): Likewise. * sched-int.h (sched_insns_conditions_mutex_p, haifa_classify_insn, no_real_insns_p, sched_insn_is_legitimate_for_speculation_p, sd_next_list, sd_lists_size, sd_lists_empty_p): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * tree-cfg.c (tree_can_merge_blocks_p, is_ctrl_altering_stmt, stmt_ends_bb_p, tree_can_remove_branch_p, tree_can_duplicate_bb_p, -tree_block_ends_with_call_p, tree_block_ends_with_condjump_p): Likewise. * tree-eh.c (lookup_stmt_eh_region_fn, lookup_stmt_eh_region, tree_can_throw_internal): Likewise. * tree-flow-inline.h (phi_nodes): Likewise. * tree-flow.h (phi_nodesstmt_ends_bb_p, is_ctrl_altering_stmt, tree_can_throw_internal, lookup_stmt_eh_region): Likewise. * tree-gimple.c (const_get_call_expr_in): Likewise. * tree-gimple.h (const_get_call_expr_in): Likewise. * tree.c (const_lookup_attribute, attribute_list_equal, attribute_list_contained): Likewise. * tree.h (attribute_list_equal, attribute_list_contained, const_lookup_attribute): Likewise. * vmsdbgout.c (vmsdbgout_ignore_block): Likewise. From-SVN: r127824
2007-08-18Makefile.tpl (DEBUG_PREFIX_CFLAGS_FOR_TARGET): New.Paul Brook1-0/+3
2007-08-18 Paul Brook <paul@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * Makefile.tpl (DEBUG_PREFIX_CFLAGS_FOR_TARGET): New. (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Include it. * Makefile.in: Regenerate. * configure.ac (--with-debug-prefix-map): New. * configure: Regenerate. config: 2007-08-18 Paul Brook <paul@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * mt-gnu (CXXFLAGS_FOR_TARGET): Add $(DEBUG_PREFIX_CFLAGS_FOR_TARGET). gcc: 2007-08-18 Paul Brook <paul@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * common.opt (-fdebug-prefix-map=): New option. * opts.c: Include debug.h. (common_handle_option): Handle -fdebug-prefix-map. * final.c: Include ggc.h. (struct debug_prefix_map, debug_prefix_maps, add_debug_prefix_map, remap_debug_filename): New. * Makefile.in (final.o, opts.o): Update dependencies. * debug.h (remap_debug_filename, add_debug_prefix_map): Declare. * configure.ac: Check for assembler --debug-prefix-map support. * configure, config.in: Regenerate. * gcc.c (ASM_MAP): Define conditional on HAVE_AS_DEBUG_PREFIX_MAP. (ASM_DEBUG_SPEC): Include ASM_MAP. * doc/install.texi (--with-debug-prefix-map): Document. * doc/invoke.texi (-fdebug-prefix-map): Document. * dbxout.c (dbxout_init, dbxout_start_source_file, dbxout_source_file): Call remap_debug_filename. * dwarf2out.c (add_comp_dir_attribute, maybe_emit_file, dwarf2out_start_source_file, dwarf2out_finish): Call remap_debug_filename. (file_table_relative_p): Do not check d->emitted_number. * toplev.c (output_file_directive): Call remap_debug_filename. * vmsdbgout.c (write_srccorr): Call remap_debug_filename. * xcoffout.c (xcoffout_source_file): Call remap_debug_filename. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> From-SVN: r127613
2007-07-26Change copyright header to refer to version 3 of the GNU General Public ↵Nick Clifton1-12/+12
License and to point readers at the COPYING3 file and the FSF's license web page. From-SVN: r126948
2005-06-25Update FSF address.Kelley Cook1-1/+1
From-SVN: r101317
2005-03-31Fix problems with hot/cold partitioning optimization.Caroline Tice1-0/+4
From-SVN: r97322
2005-03-29builtin-types.def, [...]: Update copyright.Kazu Hirata1-1/+1
* builtin-types.def, c-convert.c, c-format.c, ddg.c, debug.c, debug.h, et-forest.c, et-forest.h, gcov.c, rtl-profile.c, rtlhooks-def.h, rtlhooks.c, sdbout.c, tree-inline.h, tree-profile.c, tsystem.h, value-prof.h: Update copyright. From-SVN: r97209
2005-03-22c-opts.c (c_common_parse_file): Only start/end main source file if debug ↵Daniel Berlin1-0/+4
hooks says the writer wants it. 2005-03-22 Daniel Berlin <dberlin@dberlin.org> * c-opts.c (c_common_parse_file): Only start/end main source file if debug hooks says the writer wants it. * dbxout.c (dbx_debug_hooks): Add start_end_main_source_file member. (xcoff_debug_hooks): Ditto. * debug.c (do_nothing_hooks): Ditto. * debug.h (gcc_debug_hooks): Ditto. * dwarf2out.c (dwarf2_debug_hooks): Ditto. * sdbout.c (sdb_debug_hooks): Ditto. * vmsdbgout.c (vmsdbg_debug_hooks): Ditto. From-SVN: r96902
2004-02-12debug.h (struct gcc_debug_hooks): Add type_decl field.Zack Weinberg1-1/+9
* debug.h (struct gcc_debug_hooks): Add type_decl field. (debug_nothing_tree_int): Prototype. (dwarf_debug_hooks): Delete, unused. * debug.c (do_nothing_debug_hooks): Update. (debug_nothing_tree_int): New function. * langhooks.h (struct lang_hooks_for_decls): Remove builtin_type_decls field. * langhooks-def.h (LANG_HOOKS_BUILTIN_TYPE_DECLS): Delete. (LANG_HOOKS_DECLS): Update. * toplev.c (rest_of_decl_compilation, rest_of_type_compilation): Use debug_hooks->type_decl. * dbxout.c (preinit_symbols): New static. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_init): Don't call DBX_OUTPUT_STANDARD_TYPES or lang_hooks.decls.builtin_type_decls. Do scan preinit_symbols for symbols to output. (dbxout_type_decl): New function. (dbxout_symbol): If called before dbxout_init has run, queue the symbol for later. Apply DBX_ASSIGN_FUNDAMENTAL_TYPE_NUMBER to TYPE_DECLs before emitting them. * xcoffout.c (assign_type_number): Delete. (xcoff_type_numbers): New static table. (xcoff_assign_fundamental_type_number): New function. * xcoffout.h: Define DBX_ASSIGN_FUNDAMENTAL_TYPE_NUMBER, not DBX_OUTPUT_STANDARD_TYPES. Remove unnecessary #ifdefs. * sdbout.c: Include varray.h. (deferred_global_decls): New static. (sdb_debug_hooks): Update. (sdbout_global_decl): If we can't emit something right now, remember it in deferred_global_decls. (sdbout_finish): Just scan deferred_global_decls; don't call getdecls. (sdbout_init): Initialize deferred_global_decls. * Makefile.in: Update dependencies of sdbout.o. * dwarf2out.c (dwarf2out_type_decl): New function. (dwarf2_debug_hooks): Update. * vmsdbgout.c (vmsdbg_debug_hooks): Update. * c-decl.c (getdecls): Just return 0. (check_for_loop_decls): Don't use getdecls. (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL. * c-objc-common.c (c_objc_common_finish_file): Don't use getdecls. cp: * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS. * cp-tree.h: Don't declare cxx_builtin_type_decls. * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete. (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL. From-SVN: r77730
2004-02-06Josef Zlomek <zlomekj@suse.cz>Josef Zlomek1-0/+3
Josef Zlomek <zlomekj@suse.cz> * Makefile.in (var-tracking.o): New. * common.opt (fvar-tracking): New. * flags.h (flag_var_tracking): New. * gengtype.c (adjust_field_rtx_def): NOTE_INSN_VAR_LOCATION was added. * opts.c (common_handle_option): Add OPT_fvar_tracking. * print-rtl.c (print_rtx): NOTE_INSN_VAR_LOCATION was added. * rtl.c (note_insn_name): Likewise. * rtl.def (VAR_LOCATION): New. * rtl.h (NOTE_VAR_LOCATION): New. (NOTE_VAR_LOCATION_DECL): New. (NOTE_VAR_LOCATION_LOC): New. (enum insn_note): NOTE_INSN_VAR_LOCATION was added. (variable_tracking_main): New exported function. * timevar.def (TV_VAR_TRACKING): New. * toplev.c (enum dump_file_index): Added DFI_vartrack. (dump_file): "vartrack" was added (-dV). (flag_var_tracking): New. (f_options): "var-tracking" was added. (rest_of_handle_variable_tracking): New function. (rest_of_compilation): Run variable tracking. (process_options): If user has not specified flag_var_tracking set it according to optimize, debug_info_level and debug_hooks. * tree.h (frame_base_decl): New. * var-tracking.c: New file. * config/ia64/ia64.c (ia64_flag_var_tracking): New variable. (ia64_override_options): Set flags to run variable tracking in machine dependent reorg instead of toplev.c. (ia64_reorg): Run variable tracking if wanted. * doc/invoke.texi: Mention variable tracking in -dV, add and -fvar-tracking. * doc/passes.texi: Added variable tracking pass. Daniel Berlin <dberlin@dberlin.org> * debug.h (struct gcc_debug_hooks): Added var_location debug hook. * dbxout.c (dbx_debug_hooks): Likewise. (xcoff_debug): Likewise. * debug.c (do_nothing_debug_hooks): Likewise. * dwarf2out.c (dwarf2_debug_hooks): Likewise. * dwarfout.c (dwarf_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * final.c (final_scan_insn): Call var_location debug hook for each NOTE_INSN_VAR_LOCATION. Co-Authored-By: Daniel Berlin <dberlin@dberlin.org> From-SVN: r77418
2004-01-31alloc-pool.c, c-lex.c, c-pragma.h, c-semantics.c, cfghooks.c,Kazu Hirata1-1/+1
cfghooks.h, cfglayout.c, cfgloopmanip.c, debug.c, debug.h, flow.c, genextract.c, ggc-common.c, ggc-page.c, ggc.h, ifcvt.c, jump.c, loop-unswitch.c, timevar.c, timevar.def, tree-optimize.c, vmsdbgout.c, config/fp-bit.c, config/alpha/alpha.c, config/alpha/alpha.h, config/alpha/alpha.md, config/alpha/unicosmk.h, config/alpha/vms.h, config/arm/linux-elf.h, config/avr/avr.c, config/c4x/c4x-protos.h, config/c4x/c4x.md, config/d30v/d30v.h, config/frv/frv.md, config/frv/frvbegin.c, config/frv/frvend.c, config/i386/cygming.h, config/i386/djgpp.h, config/i386/emmintrin.h, config/i386/gthr-win32.c, config/i386/i386-interix.h, config/i386/i386-protos.h, config/i386/openbsd.h, config/i386/winnt.c, config/i386/xm-mingw32.h, config/i386/xmmintrin.h, config/ia64/ia64.md, config/iq2000/iq2000.md, config/m32r/m32r.md, config/m68k/m68k.md, config/mcore/mcore-elf.h, config/mcore/mcore.md, config/mips/elf.h, config/mips/elf64.h, config/mips/iris5gas.h, config/mips/iris6.h, config/mips/iris6gas.h, config/mips/linux.h, config/mips/mips.md, config/mips/netbsd.h, config/mips/openbsd.h, config/mips/windiss.h, config/pa/fptr.c, config/rs6000/aix.h, config/rs6000/altivec.h, config/rs6000/darwin.h, config/rs6000/xcoff.h, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/netbsd-elf.h, config/sh/sh.h, config/sh/vxworks.h, config/sparc/sol2.h: Update copyright. From-SVN: r77018
2004-01-27Makefile.in (dwarf2out.o): Depend on input.hDevang Patel1-0/+4
2004-01-27 Devang Patel <dpatel@apple.com> * Makefile.in (dwarf2out.o): Depend on input.h * dbxout.c (dbx_debug_hooks): Add new empty hook for imported_module_or_decl. (xcoff_debug_hooks): Same. * sdbout.c (sdb_debug_hooks): Same. * vmsdbgout.c (vmsdbg_debug_hooks): Same. * debug.c (do_nothing_debug_hooks): Same. (debug_nothing_tree_tree): New function. * debug.h (gcc_debug_hooks): New hook, imported_module_or_decl. * dwarf2out.c: Include input.h. (dwarf2_debug_hooks): Add new hook for imported_module_or_decl. (remove_child_TAG): New function. (dwarf_tag_name): Handle DW_TAG_imported_module. (gen_subprogram_die): Equate decl number to declaration die. Do not remove all children dies while reusing declaration die for definition. Instead, selectively remove only formal parameters. (gen_variable_die): Equate variable decl to declaration die. (gen_field_die): Equate field decl to line number. (force_namespace_die): Replace it with ... (force_decl_die): ... this. (force_type_die): New function. (setup_namespace_context): Replace use of force_namespace_die() with force_decl_die(). (gen_namespace_die): Same. (dwarf2out_imported_module_or_decl): New function. testsuite: * g++.dg/debug/namespace1.C: New test. cp: * name-lookup.c: Include "debug.h" (do_namespace_alias): Invoke debug_hooks to emit debug info for namespace alias. (do_local_using_decl): Invoke debug_hooks to emit debug info for using decl. (do_class_using_decl): Same. (do_toplevel_using_decl): Same. (do_using_directive): Same. (cp_emit_debug_info_for_using): New function. * Make-lang.in (cp/parser.o): Depend on debug.h (cp/name-lookup.o): Same. From-SVN: r76746
2003-07-06basic-block.h: Convert prototypes to ISO C90.Andreas Jaeger1-47/+39
* basic-block.h: Convert prototypes to ISO C90. * c-parse.in: Likewise. * c-pragma.h: Likewise. * c-typeck.c: Likewise. * cfghooks.h: Likewise. * cfgloopanal.c: Likewise. * dbxout.h: Likewise. * debug.h: Likewise. * dwarf2asm.h: Likewise. * gcov.c: Likewise. * gengtype-lex.l: Likewise. * sched-int.h: Likewise. * timevar.c: Likewise. From-SVN: r69010
2003-06-26final.c (debug_flush_symbol_queue): New function.Devang Patel1-0/+6
* final.c (debug_flush_symbol_queue): New function. (debug_queue_symbol): New function. (debug_free_queue): New function. (debug_nesting): New variable. (symbol_queue): New variable. (symbol_queue_index): Same. (symbol_queue_size): Same. * debug.h (debug_flush_symbol_queue): New. (debug_queue_symbol): New. (debug_free_queue): New. (debug_nesting): New. (symbol_queue_index): New. * dbxout.c (DBXOUT_DECR_NESTING): New macro. (DBXOUT_DECR_NESTING_AND_RETURN): New macro. (dbxout_init): Delay symbol output. (dbxout_global_decl): Save, set and reset TREE_USED bit around dbxout_symbol() call. (dbxout_begin_function): Same. (dbxout_finish): Free symbol queue. (dbxout_type): Put appropriate symbols in queue. (dbxout_symbol): Put info for symbol's type in queue. Decrement/Increment nesting counts flush symbol queue appropriately. (dbxout_parms): Increment dbxout nesting. (dbxout_reg_parms): Same. * flags.h (flag_debug_only_used_symbols): New. * toplev.c (flag_debug_only_used_symbols): New variable. (lang_independent_options): Add entries for new option -feliminate-unused-debug-symbols. * common.opt: Add entry for -feliminate-unused-debug-symbols. * opts.c (common_handle_options): Same. * config/rs6000/darwin.h (CC1_SPEC): Interpret -gused as -feliminate-unused-debug-symbols. * doc/invoke.texi (Debugging Options): Document -feliminate-unused-debug-symbols. From-SVN: r68556
2003-04-05dbxout.c (scope_labelno): Add GTY.Geoffrey Keating1-0/+4
2003-04-04 Geoffrey Keating <geoffk@apple.com> * dbxout.c (scope_labelno): Add GTY. (have_used_extensions): Add GTY. (source_label_number): Add GTY. (lastfile): Add GTY. (lastfile_is_base): New. (base_input_file): New. (dbxout_handle_pch): New. (dbx_debug_hooks): Add handle_pch. (xcoff_debug_hooks): Likewise. (dbxout_function_end): Remove scope_labelno. (dbxout_init): Set base_input_file. (dbxout_handle_pch): New. (dbxout_source_file): Honour lastfile_is_base. * dwarfout.c (dwarf_debug_hooks): Add dummy handle_pch. * sdbout.c (sdb_debug_hooks): Add dummy handle_pch. * vmsdbgout.c (vmsdbg_debug_hooks): Add dummy handle_pch. * dwarf2out.c (dwarf2_debug_hooks): Add dummy handle_pch. * debug.c (do_nothing_debug_hooks): Add dummy handle_pch. * debug.h (struct gcc_debug_hooks): Add handle_pch. * c-pch.c (pch_init): Don't call start_source_file, but do call handle_pch. (c_common_write_pch): Call handle_pch. (c_common_read_pch): Don't call start_source_file, or end_source_file. Index: gcc/testsuite/ChangeLog 2003-04-04 Geoffrey Keating <geoffk@apple.com> * gcc.dg/pch/static-3.c: New. * gcc.dg/pch/static-3.hs: New. * gcc.dg/pch/pch.exp: Test with -O0 -g too. From-SVN: r65266
2002-09-14ChangeLog: Follow spelling conventions.Kazu Hirata1-1/+1
* ChangeLog: Follow spelling conventions. * ChangeLog.0: Likewise. * ChangeLog.2: Likewise. * ChangeLog.3: Likewise. * ChangeLog.4: Likewise. * ChangeLog.5: Likewise. * ChangeLog.6: Likewise. * cppfiles.c: Likewise. * cppinit.c: Likewise. * cpplib.h: Likewise. * cse.c: Likewise. * debug.h: Likewise. * df.c: Likewise. * dominance.c: Likewise. * hashtable.c: Likewise. * hashtable.h: Likewise. * loop.c: Likewise. * config/arm/README-interworking: Likewise. * config/arm/arm.c: Likewise. * config/arm/arm.h: Likewise. * config/arm/arm.md: Likewise. * config/dsp16xx/dsp16xx.h: Likewise. * config/frv/frv.c: Likewise. * config/frv/frv.h: Likewise. * config/ip2k/ip2k.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/stormy16/stormy-abi: Likewise. * config/stormy16/stormy16.h: Likewise. * config/v850/v850.c: Likewise. From-SVN: r57146
2002-08-15dbxout.c (dbx_debug_hooks): Update end_prologue, end_epilogue.Douglas B Rupp1-9/+3
* dbxout.c (dbx_debug_hooks): Update end_prologue, end_epilogue. (xcoff_debug_hooks): Update end_prologue. * debug.c (do_nothing_debug_hooks): Update end_prologue, end_epilogue. * debug.h (end_prologue): Add file arg. (end_epilogue): Add line and file args. (dwarf2out_end_epilogue): Add line and file args. (vmsdbgout_after_prologue): Remove. * dwarf2out.c (dwarf2out_end_epilogue): Add line and file args. (dwarf2_debug_hooks): Update end_prologue. * dwarfout.c (dwarfout_end_epilogue): Add line and file args. (dwarfout_end_prologue): Add file arg. * final.c (vmsdbgout_after_prologue): Remove (final_end_function): Update end_epilogue call. (final_scan_insn): Update end_prologue call. * sdbout.c (sdbout_end_epilogue): Add line and file args. (sdbout_end_prologue): Add file arg. (sdb_debug_hooks): Update end_prologue. (sdb_begin_prologue): Update sdbout_end_prologue call. * vmsdbgout.c (vmsdbg_debug_hooks): Add vmsdbgout_end_prologue, vmsdbgout_end_function. (vmsdbgout_end_prologue): New function renamed from vmsdbgout_after_prologue. Call vmsdbgout_source_line. (vmsdbgout_end_function): New function. (vmsdbgout_end_epilogue): Add line and file args. Call vmsdbgout_source_line. (write_pclines): Write only valid line numbers. (write_srccorr): Don't write source correlation records if 0 lines. * xcoffout.c (xcoffout_end_epilogue): Add line and file args. From-SVN: r56356
2002-03-12Makefile.in (debug.o): Depend on debug.h.Kaveh R. Ghazi1-8/+8
* Makefile.in (debug.o): Depend on debug.h. * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Const-ify. * debug.c (do_nothing_debug_hooks): Likewise. * debug.h (debug_hooks, do_nothing_debug_hooks, dbx_debug_hooks, sdb_debug_hooks, xcoff_debug_hooks, dwarf_debug_hooks, dwarf2_debug_hooks, vmsdbg_debug_hooks): Likewise. * dwarf2out.c (dwarf2_debug_hooks): Likewise. * dwarfout.c (dwarf_debug_hooks): Likewise. * integrate.c (output_inline_function): Likewise. * objc/objc-act.c (synth_module_prologue): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * toplev.c (debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. From-SVN: r50635
2002-01-08* debug.h: Use "tree" and "rtx" throughout.Graham Stott1-14/+11
From-SVN: r48629
2001-12-02vms.h (VMS_DEBUGGING_INFO): New macro.Douglas B Rupp1-12/+12
* config/alpha/vms.h (VMS_DEBUGGING_INFO): New macro. (PREFERRED_DEBUGGING_TYPE): Define as VMS_AND_DWARF2_DEBUG. (ASM_SPEC): Don't redefine. (OPTIMIZATION_OPTIONS, OVERRIDE_OPTIONS, LINK_SPEC): Define. * config/alpha/t-vms (EXTRA_PARTS): Use; add rule for vms-dwarf2.asm. * config/alpha/vms-dwarf2.asm: New file. * Makefile.in (OBJS): Add vmsdbgout.c and its rule. * c-lex.c (init_c_lex): Test for VMS_AND_DWARF2_DEBUG. * debug.h (gcc_debug_hooks): Add vmsdbg_debug_hooks. (vmsdbgout_after_prologue): New declaration. * defaults.h (VMS_DEBUGGING_INFO): Add to PREFERRED_DEBUGGING_TYPE. * dwarf2.h (dwarf_attribute): New DW_AT_VMS_rtnbeg_pd_address. * dwarf2out.c (dwarf2out_do_frame): Test for VMS_AND_DWARF2_DEBUG. (dwarf2out_frame_finish): Test for VMS_AND_DWARF2_DEBUG. (dwarf_attr_name): Use DW_AT_VMS_rtnbeg_pd_address. (add_name_and_src_coords_attributes): Test VMS_DEBUGGING_INFO * final.c (final_start_function): Test for VMS_AND_DWARF2_DEBUG. Test VMS_DEBUGGING_INFO. (final_end_function): Test for VMS_AND_DWARF2_DEBUG. (final_scan_insn): Test for VMS_AND_DWARF2_DEBUG and VMS_DEBUG. * flags.h (debug_info_type): Add VMS_DEBUG and VMS_AND_DWARF2_DEBUG. * toplev.c (compile_file): Test VMS_DEBUGGING_INFO, VMS_DEBUG, and VMS_AND_DWARF2_DEBUG. (rest_of_type_compilation): Test for VMS_AND_DWARF2_DEBUG. (decode_g_option): Add "vms" to debug_type_names. (process_options): Set vmsdbg_debug_hooks if -gvms. (lang_independent_init): Emit line number for VMS unless -g0. * tree.c: (build_complex_type): Test for VMS_AND_DWARF2_DEBUG. * vmsdbg.h, vmsdbgout.c: New files. From-SVN: r47532
2001-07-19Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h.Neil Booth1-0/+29
* Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. (final.o): Don't depend on xcoffout.h, dbxout.h or sdbout.h. (toplev.o): Don't depend on xcoffout.h. * c-decl.c: Include debug.h (duplicate_decls): Use debug hook. * dbxout.c (dbxout_source_file, dbxout_args): Make static. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_types): Remove. * dbxout.h (dbxout_source_file, dbxout_types, dbxout_args): Remove. * debug.c (do_nothing_debug_hooks): Update. (debug_true_tree, debug_nothing_rtx): New. * debug.h (struct rtx_def): New. (struct gcc_debug_hooks): New hooks ignore_block, outlining_inline_function and label. (debug_true_tree, debug_nothing_rtx, dwarf2out_frame_init, dwarf2out_frame_finish): New. * dwarf2out.c (dwarf2out_ignore_block, dwarf2out_abstract_function): Make static, update prototype. (dwarf2_debug_hooks): Update. * dwarf2out.h (dwarf2out_ignore_block, dwarf2out_abstract_function, dwarf2out_frame_init, dwarf2out_frame_finish): Remove. * dwarfout.c (dwarf_debug_hooks): Update. * emit-rtl.c: Include debug.h. (remove_unnecessary_notes): Use debug hook. * final.c: Don't include dbxout.h, xcoffout.h or sdbout.h. (final_scan_insn): Use debug hook. * integrate.c (output_inline_function): Use debug hook. * sdbout.c (sdbout_toplevel_data, sdbout_label): Make static. (sdb_debug_hooks): Update. * sdbout.h (sdbout_label, sdbout_toplevel_data): Remove. * toplev.c: Don't include xcoffout.h. (note_outlining_of_inline_function, debug_ignore_block): Remove. * toplev.h (note_outlining_of_inline_function, debug_ignore_block): Remove. * tree.h (dwarf2out_do_frame): Remove. From-SVN: r44163