📄 dwarfout.c
字号:
static inline void dienum_pop PROTO((void));static inline tree member_declared_type PROTO((tree));static char *function_start_label PROTO((tree));static void output_array_type_die PROTO((void *));static void output_set_type_die PROTO((void *));static void output_entry_point_die PROTO((void *));static void output_inlined_enumeration_type_die PROTO((void *));static void output_inlined_structure_type_die PROTO((void *));static void output_inlined_union_type_die PROTO((void *));static void output_enumeration_type_die PROTO((void *));static void output_formal_parameter_die PROTO((void *));static void output_global_subroutine_die PROTO((void *));static void output_global_variable_die PROTO((void *));static void output_label_die PROTO((void *));static void output_lexical_block_die PROTO((void *));static void output_inlined_subroutine_die PROTO((void *));static void output_local_variable_die PROTO((void *));static void output_member_die PROTO((void *));static void output_pointer_type_die PROTO((void *));static void output_reference_type_die PROTO((void *));static void output_ptr_to_mbr_type_die PROTO((void *));static void output_compile_unit_die PROTO((void *));static void output_string_type_die PROTO((void *));static void output_structure_type_die PROTO((void *));static void output_local_subroutine_die PROTO((void *));static void output_subroutine_type_die PROTO((void *));static void output_typedef_die PROTO((void *));static void output_union_type_die PROTO((void *));static void output_unspecified_parameters_die PROTO((void *));static void output_padded_null_die PROTO((void *));static void output_die PROTO((void (*) (), void *));static void end_sibling_chain PROTO((void));static void output_formal_types PROTO((tree));static void pend_type PROTO((tree));static inline int type_of_for_scope PROTO((tree, tree));static void output_pending_types_for_scope PROTO((tree));static void output_type PROTO((tree, tree));static void output_tagged_type_instantiation PROTO((tree));static void output_block PROTO((tree, int));static void output_decls_for_scope PROTO((tree, int));static void output_decl PROTO((tree, tree));static void shuffle_filename_entry PROTO((filename_entry *));static void generate_new_sfname_entry PROTO((void));static unsigned lookup_filename PROTO((char *));static void generate_srcinfo_entry PROTO((unsigned, unsigned));static void generate_macinfo_entry PROTO((char *, char *));/* Definitions of defaults for assembler-dependent names of various pseudo-ops and section names. Theses may be overridden in your tm.h file (if necessary) for your particular assembler. The default values provided here correspond to what is expected by "standard" AT&T System V.4 assemblers. */#ifndef FILE_ASM_OP#define FILE_ASM_OP ".file"#endif#ifndef VERSION_ASM_OP#define VERSION_ASM_OP ".version"#endif#ifndef UNALIGNED_SHORT_ASM_OP#define UNALIGNED_SHORT_ASM_OP ".2byte"#endif#ifndef UNALIGNED_INT_ASM_OP#define UNALIGNED_INT_ASM_OP ".4byte"#endif#ifndef ASM_BYTE_OP#define ASM_BYTE_OP ".byte"#endif#ifndef SET_ASM_OP#define SET_ASM_OP ".set"#endif/* Pseudo-ops for pushing the current section onto the section stack (and simultaneously changing to a new section) and for poping back to the section we were in immediately before this one. Note that most svr4 assemblers only maintain a one level stack... you can push all the sections you want, but you can only pop out one level. (The sparc svr4 assembler is an exception to this general rule.) That's OK because we only use at most one level of the section stack herein. */#ifndef PUSHSECTION_ASM_OP#define PUSHSECTION_ASM_OP ".section"#endif#ifndef POPSECTION_ASM_OP#define POPSECTION_ASM_OP ".previous"#endif/* The default format used by the ASM_OUTPUT_PUSH_SECTION macro (see below) to print the PUSHSECTION_ASM_OP and the section name. The default here works for almost all svr4 assemblers, except for the sparc, where the section name must be enclosed in double quotes. (See sparcv4.h.) */#ifndef PUSHSECTION_FORMAT#define PUSHSECTION_FORMAT "\t%s\t%s\n"#endif#ifndef DEBUG_SECTION#define DEBUG_SECTION ".debug"#endif#ifndef LINE_SECTION#define LINE_SECTION ".line"#endif#ifndef SFNAMES_SECTION#define SFNAMES_SECTION ".debug_sfnames"#endif#ifndef SRCINFO_SECTION#define SRCINFO_SECTION ".debug_srcinfo"#endif#ifndef MACINFO_SECTION#define MACINFO_SECTION ".debug_macinfo"#endif#ifndef PUBNAMES_SECTION#define PUBNAMES_SECTION ".debug_pubnames"#endif#ifndef ARANGES_SECTION#define ARANGES_SECTION ".debug_aranges"#endif#ifndef TEXT_SECTION#define TEXT_SECTION ".text"#endif#ifndef DATA_SECTION#define DATA_SECTION ".data"#endif#ifndef DATA1_SECTION#define DATA1_SECTION ".data1"#endif#ifndef RODATA_SECTION#define RODATA_SECTION ".rodata"#endif#ifndef RODATA1_SECTION#define RODATA1_SECTION ".rodata1"#endif#ifndef BSS_SECTION#define BSS_SECTION ".bss"#endif/* Definitions of defaults for formats and names of various special (artificial) labels which may be generated within this file (when the -g options is used and DWARF_DEBUGGING_INFO is in effect. If necessary, these may be overridden from within your tm.h file, but typically, you should never need to override these. These labels have been hacked (temporarily) so that they all begin with a `.L' sequence so as to appease the stock sparc/svr4 assembler and the stock m88k/svr4 assembler, both of which need to see .L at the start of a label in order to prevent that label from going into the linker symbol table). When I get time, I'll have to fix this the right way so that we will use ASM_GENERATE_INTERNAL_LABEL and ASM_OUTPUT_INTERNAL_LABEL herein, but that will require a rather massive set of changes. For the moment, the following definitions out to produce the right results for all svr4 and svr3 assemblers. -- rfg*/#ifndef TEXT_BEGIN_LABEL#define TEXT_BEGIN_LABEL "*.L_text_b"#endif#ifndef TEXT_END_LABEL#define TEXT_END_LABEL "*.L_text_e"#endif#ifndef DATA_BEGIN_LABEL#define DATA_BEGIN_LABEL "*.L_data_b"#endif#ifndef DATA_END_LABEL#define DATA_END_LABEL "*.L_data_e"#endif#ifndef DATA1_BEGIN_LABEL#define DATA1_BEGIN_LABEL "*.L_data1_b"#endif#ifndef DATA1_END_LABEL#define DATA1_END_LABEL "*.L_data1_e"#endif#ifndef RODATA_BEGIN_LABEL#define RODATA_BEGIN_LABEL "*.L_rodata_b"#endif#ifndef RODATA_END_LABEL#define RODATA_END_LABEL "*.L_rodata_e"#endif#ifndef RODATA1_BEGIN_LABEL#define RODATA1_BEGIN_LABEL "*.L_rodata1_b"#endif#ifndef RODATA1_END_LABEL#define RODATA1_END_LABEL "*.L_rodata1_e"#endif#ifndef BSS_BEGIN_LABEL#define BSS_BEGIN_LABEL "*.L_bss_b"#endif#ifndef BSS_END_LABEL#define BSS_END_LABEL "*.L_bss_e"#endif#ifndef LINE_BEGIN_LABEL#define LINE_BEGIN_LABEL "*.L_line_b"#endif#ifndef LINE_LAST_ENTRY_LABEL#define LINE_LAST_ENTRY_LABEL "*.L_line_last"#endif#ifndef LINE_END_LABEL#define LINE_END_LABEL "*.L_line_e"#endif#ifndef DEBUG_BEGIN_LABEL#define DEBUG_BEGIN_LABEL "*.L_debug_b"#endif#ifndef SFNAMES_BEGIN_LABEL#define SFNAMES_BEGIN_LABEL "*.L_sfnames_b"#endif#ifndef SRCINFO_BEGIN_LABEL#define SRCINFO_BEGIN_LABEL "*.L_srcinfo_b"#endif#ifndef MACINFO_BEGIN_LABEL#define MACINFO_BEGIN_LABEL "*.L_macinfo_b"#endif#ifndef DIE_BEGIN_LABEL_FMT#define DIE_BEGIN_LABEL_FMT "*.L_D%u"#endif#ifndef DIE_END_LABEL_FMT#define DIE_END_LABEL_FMT "*.L_D%u_e"#endif#ifndef PUB_DIE_LABEL_FMT#define PUB_DIE_LABEL_FMT "*.L_P%u"#endif#ifndef INSN_LABEL_FMT#define INSN_LABEL_FMT "*.L_I%u_%u"#endif#ifndef BLOCK_BEGIN_LABEL_FMT#define BLOCK_BEGIN_LABEL_FMT "*.L_B%u"#endif#ifndef BLOCK_END_LABEL_FMT#define BLOCK_END_LABEL_FMT "*.L_B%u_e"#endif#ifndef SS_BEGIN_LABEL_FMT#define SS_BEGIN_LABEL_FMT "*.L_s%u"#endif#ifndef SS_END_LABEL_FMT#define SS_END_LABEL_FMT "*.L_s%u_e"#endif#ifndef EE_BEGIN_LABEL_FMT#define EE_BEGIN_LABEL_FMT "*.L_e%u"#endif#ifndef EE_END_LABEL_FMT#define EE_END_LABEL_FMT "*.L_e%u_e"#endif#ifndef MT_BEGIN_LABEL_FMT#define MT_BEGIN_LABEL_FMT "*.L_t%u"#endif#ifndef MT_END_LABEL_FMT#define MT_END_LABEL_FMT "*.L_t%u_e"#endif#ifndef LOC_BEGIN_LABEL_FMT#define LOC_BEGIN_LABEL_FMT "*.L_l%u"#endif#ifndef LOC_END_LABEL_FMT#define LOC_END_LABEL_FMT "*.L_l%u_e"#endif#ifndef BOUND_BEGIN_LABEL_FMT#define BOUND_BEGIN_LABEL_FMT "*.L_b%u_%u_%c"#endif#ifndef BOUND_END_LABEL_FMT#define BOUND_END_LABEL_FMT "*.L_b%u_%u_%c_e"#endif#ifndef DERIV_BEGIN_LABEL_FMT#define DERIV_BEGIN_LABEL_FMT "*.L_d%u"#endif#ifndef DERIV_END_LABEL_FMT#define DERIV_END_LABEL_FMT "*.L_d%u_e"#endif#ifndef SL_BEGIN_LABEL_FMT#define SL_BEGIN_LABEL_FMT "*.L_sl%u"#endif#ifndef SL_END_LABEL_FMT#define SL_END_LABEL_FMT "*.L_sl%u_e"#endif#ifndef BODY_BEGIN_LABEL_FMT#define BODY_BEGIN_LABEL_FMT "*.L_b%u"#endif#ifndef BODY_END_LABEL_FMT#define BODY_END_LABEL_FMT "*.L_b%u_e"#endif#ifndef FUNC_END_LABEL_FMT#define FUNC_END_LABEL_FMT "*.L_f%u_e"#endif#ifndef TYPE_NAME_FMT#define TYPE_NAME_FMT "*.L_T%u"#endif#ifndef DECL_NAME_FMT#define DECL_NAME_FMT "*.L_E%u"#endif#ifndef LINE_CODE_LABEL_FMT#define LINE_CODE_LABEL_FMT "*.L_LC%u"#endif#ifndef SFNAMES_ENTRY_LABEL_FMT#define SFNAMES_ENTRY_LABEL_FMT "*.L_F%u"#endif#ifndef LINE_ENTRY_LABEL_FMT#define LINE_ENTRY_LABEL_FMT "*.L_LE%u"#endif/* Definitions of defaults for various types of primitive assembly language output operations. If necessary, these may be overridden from within your tm.h file, but typically, you shouldn't need to override these. */#ifndef ASM_OUTPUT_PUSH_SECTION#define ASM_OUTPUT_PUSH_SECTION(FILE, SECTION) \ fprintf ((FILE), PUSHSECTION_FORMAT, PUSHSECTION_ASM_OP, SECTION)#endif#ifndef ASM_OUTPUT_POP_SECTION#define ASM_OUTPUT_POP_SECTION(FILE) \ fprintf ((FILE), "\t%s\n", POPSECTION_ASM_OP)#endif#ifndef ASM_OUTPUT_DWARF_DELTA2#define ASM_OUTPUT_DWARF_DELTA2(FILE,LABEL1,LABEL2) \ do { fprintf ((FILE), "\t%s\t", UNALIGNED_SHORT_ASM_OP); \ assemble_name (FILE, LABEL1); \ fprintf (FILE, "-"); \ assemble_name (FILE, LABEL2); \ fprintf (FILE, "\n"); \ } while (0)#endif#ifndef ASM_OUTPUT_DWARF_DELTA4#define ASM_OUTPUT_DWARF_DELTA4(FILE,LABEL1,LABEL2) \ do { fprintf ((FILE), "\t%s\t", UNALIGNED_INT_ASM_OP); \ assemble_name (FILE, LABEL1); \ fprintf (FILE, "-"); \ assemble_name (FILE, LABEL2); \ fprintf (FILE, "\n"); \ } while (0)#endif#ifndef ASM_OUTPUT_DWARF_TAG#define ASM_OUTPUT_DWARF_TAG(FILE,TAG) \ do { \ fprintf ((FILE), "\t%s\t0x%x", \ UNALIGNED_SHORT_ASM_OP, (unsigned) TAG); \ if (flag_debug_asm) \ fprintf ((FILE), "\t%s %s", \ ASM_COMMENT_START, dwarf_tag_name (TAG)); \ fputc ('\n', (FILE)); \ } while (0)#endif#ifndef ASM_OUTPUT_DWARF_ATTRIBUTE#define ASM_OUTPUT_DWARF_ATTRIBUTE(FILE,ATTR) \ do { \ fprintf ((FILE), "\t%s\t0x%x", \ UNALIGNED_SHORT_ASM_OP, (unsigned) ATTR); \ if (flag_debug_asm) \ fprintf ((FILE), "\t%s %s", \ ASM_COMMENT_START, dwarf_attr_name (ATTR)); \ fputc ('\n', (FILE)); \ } while (0)#endif#ifndef ASM_OUTPUT_DWARF_STACK_OP#define ASM_OUTPUT_DWARF_STACK_OP(FILE,OP) \ do { \ fprintf ((FILE), "\t%s\t0x%x", ASM_BYTE_OP, (unsigned) OP); \ if (flag_debug_asm) \ fprintf ((FILE), "\t%s %s", \ ASM_COMMENT_START, dwarf_stack_op_name (OP)); \ fputc ('\n', (FILE)); \ } while (0)#endif#ifndef ASM_OUTPUT_DWARF_FUND_TYPE#define ASM_OUTPUT_DWARF_FUND_TYPE(FILE,FT) \ do { \ fprintf ((FILE), "\t%s\t0x%x", \ UNALIGNED_SHORT_ASM_OP, (unsigned) FT); \ if (flag_debug_asm) \ fprintf ((FILE), "\t%s %s", \ ASM_COMMENT_START, dwarf_fund_type_name (FT)); \ fputc ('\n', (FILE)); \ } while (0)#endif#ifndef ASM_OUTPUT_DWARF_FMT_BYTE#define ASM_OUTPUT_DWARF_FMT_BYTE(FILE,FMT) \ do { \ fprintf ((FILE), "\t%s\t0x%x", ASM_BYTE_OP, (unsigned) FMT); \ if (flag_debug_asm) \ fprintf ((FILE), "\t%s %s", \ ASM_COMMENT_START, dwarf_fmt_byte_name (FMT)); \ fputc ('\n', (FILE)); \ } while (0)#endif#ifndef ASM_OUTPUT_DWARF_TYPE_MODIFIER
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -