#include <stdio.h>#include <stdlib.h>#include "libelf/libelf.h"#include <sys/unwindP.h>#include <list>#include "elf_stuff.h"#include <elfaccess.h>#include "dwarf.h"#include "defs.h"#include "erglob.h"#include "glob.h"#include "flags.h"#include "tracing.h"#include "em_elf.h"#include "em_dwarf.h"#include "config.h"#include "config_asm.h"#include "cgir.h"#include "register.h"#include "cgtarget.h"#include "calls.h"#include "stblock.h"#include "data_layout.h"#include "cg_spill.h"#include "cgdwarf.h"#include "cgdwarf_targ.h"#include "dwarf_incl.h"#include "pro_opaque.h"#include "pro_frame.h"#include "be_util.h"

Go to the source code of this file.
| #define AS_1BYTE ".byte" |
Definition at line 134 of file cgdwarf_targ.cxx.
| #define AS_4BYTE ".4byte" |
Definition at line 133 of file cgdwarf_targ.cxx.
| #define AS_ASCII ".ascii" |
Definition at line 135 of file cgdwarf_targ.cxx.
| #define AS_SLEBW ".sleb128" |
Definition at line 137 of file cgdwarf_targ.cxx.
| #define AS_ULEBW ".uleb128" |
Definition at line 136 of file cgdwarf_targ.cxx.
| #define ENTRY_STATE | ( | bb | ) | (entry_state[BB_id(bb)]) |
Definition at line 516 of file cgdwarf_targ.cxx.
| #define EXIT_STATE | ( | bb | ) | (exit_state[BB_id(bb)]) |
Definition at line 517 of file cgdwarf_targ.cxx.
| #define FD_CFA 28 |
Definition at line 77 of file cgdwarf_targ.cxx.
| #define FD_FIRST FD_R0 |
Definition at line 82 of file cgdwarf_targ.cxx.
| #define FD_LAST 32 |
Definition at line 83 of file cgdwarf_targ.cxx.
| #define FD_R0 0 |
Definition at line 47 of file cgdwarf_targ.cxx.
| #define FD_R1 1 |
Definition at line 49 of file cgdwarf_targ.cxx.
| #define FD_R10 10 |
Definition at line 59 of file cgdwarf_targ.cxx.
| #define FD_R11 11 |
Definition at line 60 of file cgdwarf_targ.cxx.
| #define FD_R12 12 |
Definition at line 61 of file cgdwarf_targ.cxx.
| #define FD_R13 13 |
Definition at line 62 of file cgdwarf_targ.cxx.
| #define FD_R14 14 |
Definition at line 63 of file cgdwarf_targ.cxx.
| #define FD_R15 15 |
Definition at line 64 of file cgdwarf_targ.cxx.
| #define FD_R16 16 |
Definition at line 65 of file cgdwarf_targ.cxx.
| #define FD_R17 17 |
Definition at line 66 of file cgdwarf_targ.cxx.
| #define FD_R18 18 |
Definition at line 67 of file cgdwarf_targ.cxx.
| #define FD_R19 19 |
Definition at line 68 of file cgdwarf_targ.cxx.
| #define FD_R2 2 |
Definition at line 50 of file cgdwarf_targ.cxx.
| #define FD_R20 20 |
Definition at line 69 of file cgdwarf_targ.cxx.
| #define FD_R21 21 |
Definition at line 70 of file cgdwarf_targ.cxx.
| #define FD_R22 22 |
Definition at line 71 of file cgdwarf_targ.cxx.
| #define FD_R23 23 |
Definition at line 72 of file cgdwarf_targ.cxx.
| #define FD_R24 24 |
Definition at line 73 of file cgdwarf_targ.cxx.
| #define FD_R25 25 |
Definition at line 74 of file cgdwarf_targ.cxx.
| #define FD_R26 26 |
Definition at line 75 of file cgdwarf_targ.cxx.
| #define FD_R27 27 |
Definition at line 76 of file cgdwarf_targ.cxx.
| #define FD_R29 29 |
Definition at line 78 of file cgdwarf_targ.cxx.
| #define FD_R3 3 |
Definition at line 52 of file cgdwarf_targ.cxx.
| #define FD_R30 30 |
Definition at line 79 of file cgdwarf_targ.cxx.
| #define FD_R31 31 |
Definition at line 81 of file cgdwarf_targ.cxx.
| #define FD_R4 4 |
Definition at line 53 of file cgdwarf_targ.cxx.
| #define FD_R5 5 |
Definition at line 54 of file cgdwarf_targ.cxx.
| #define FD_R6 6 |
Definition at line 55 of file cgdwarf_targ.cxx.
| #define FD_R7 7 |
Definition at line 56 of file cgdwarf_targ.cxx.
| #define FD_R8 8 |
Definition at line 57 of file cgdwarf_targ.cxx.
| #define FD_R9 9 |
Definition at line 58 of file cgdwarf_targ.cxx.
| #define FD_RA FD_R0 |
Definition at line 48 of file cgdwarf_targ.cxx.
| #define FD_S8 FD_R30 |
Definition at line 80 of file cgdwarf_targ.cxx.
| #define FD_SL FD_R2 |
Definition at line 51 of file cgdwarf_targ.cxx.
| #define LOCAL_STATE | ( | bb | ) | (local_state[BB_id(bb)]) |
Definition at line 515 of file cgdwarf_targ.cxx.
Definition at line 85 of file cgdwarf_targ.cxx.
| enum CGD_STATES |
| DS_In_Register | |
| DS_In_Memory | |
| DS_CFA_Is_SP | |
| DS_CFA_Is_Adj_SP | |
| DS_CFA_Is_FP | |
| DS_CFA_Last | |
| DS_In_Register | |
| DS_In_Memory | |
| DS_CFA_Is_SP | |
| DS_CFA_Is_Adj_SP | |
| DS_CFA_Is_FP | |
| DS_CFA_Last |
Definition at line 115 of file cgdwarf_targ.cxx.
| static Dwarf_P_Fde Add_Fde_Inst | ( | Dwarf_P_Fde | fde, | |
| Dwarf_Small | dw_op, | |||
| Dwarf_Unsigned | op1, | |||
| Dwarf_Unsigned | op2 | |||
| ) | [static] |
Definition at line 264 of file cgdwarf_targ.cxx.
References Assembly, CFA_dump2asm(), curloc, DW_CFA_advance_loc, DW_CFA_advance_loc4, DW_CFA_high_user, dwarf_add_fde_inst(), fprintf(), lastloc, TFile, and Trace_Dwarf.
| Dwarf_P_Fde Build_Fde_For_Proc | ( | Dwarf_P_Debug | dw_dbg, | |
| BB * | firstbb, | |||
| LABEL_IDX | begin_label, | |||
| LABEL_IDX | end_label, | |||
| INT | end_offset, | |||
| INT | low_pc, | |||
| INT | high_pc | |||
| ) |
Definition at line 731 of file cgdwarf_targ.cxx.
References Add_Fde_Inst(), AS_SECTION, Asm_File, Assembly, BB_entry, BB_entry_sp_adj_op(), BB_exit, BB_exit_sp_adj_op(), BB_first_op, BB_handler, BB_id, BB_last_op, BB_next, BB_unreachable, BOOL, CGSPILL_Is_Spill_Op(), CIE_dump2asm(), CIE_end_dump2asm(), Compute_Reg_State(), curloc, Current_PU_Stack_Model, current_state, CURRENT_SYMTAB, data_alignment_factor, Dwarf_P_Debug_s::de_last_cie, DevWarn, DS_CFA_Is_Adj_SP, DS_CFA_Is_FP, DS_CFA_Is_SP, DS_In_Memory, DS_In_Register, DW_CFA_def_cfa, DW_CFA_offset, DW_CFA_register, DW_FRAME_REG29, DW_FRAME_STATIC_LINK, dwarf_new_fde(), ENTRY_STATE, FALSE, FD_CFA, FD_FIRST, FD_LAST, FD_RA, FD_SL, fd_to_dwarf, fd_to_track, FDE_dump2asm(), FDE_end_dump2asm(), Find_Slink_Symbol(), FP_TN, fprintf(), Get_Current_PU, Has_Matching_Load_In_BB(), Has_Matching_Store_In_BB(), i, INT, Is_True, lastloc, Machine_Reg_To_FD(), NULL, Offset_from_FP(), OP_code, OP_copy, OP_Defs_Reg(), OP_Defs_TN(), OP_dummy, OP_has_result, OP_Inst_Size(), OP_load, OP_next, OP_noop, OP_opnd, OP_opnds, OP_result, OP_results, OP_store, PU_is_nested_func(), RA_TN, REGISTER_CLASS_callee_saves, REGISTER_CLASS_sp, REGISTER_machine_id, REGISTER_SET_EMPTY_SET, REGISTER_SET_MemberP(), REGISTER_sp, Save_TN_to_fd(), SMODEL_SMALL, TFile, TN_is_ra_reg, TN_is_register, TN_is_save_reg, TN_is_static_link_reg, TN_is_symbol, TN_register, TN_register_class, TN_spill, TN_to_fd(), TN_var, Trace_Dwarf, TRUE, and update_state().
| static INT CFA_dump2asm | ( | Dwarf_Small | dw_op, | |
| Dwarf_Unsigned | op1, | |||
| Dwarf_Unsigned | op2 | |||
| ) | [static] |
Definition at line 207 of file cgdwarf_targ.cxx.
References AS_1BYTE, AS_4BYTE, AS_ULEBW, Asm_File, DW_CFA_advance_loc, DW_CFA_advance_loc4, DW_CFA_def_cfa, DW_CFA_def_cfa_offset, DW_CFA_def_cfa_register, DW_CFA_high_user, DW_CFA_low_user, DW_CFA_offset, DW_CFA_register, DW_CFA_same_value, fmt_string, fprintf(), and Is_True.
| void Check_Dwarf_Rel | ( | Elf64_AltRel const & | current_reloc | ) |
Definition at line 1102 of file cgdwarf_targ.cxx.
References FmtAssert, R_IA_64_DIR64MSB, and REL64_type.
Definition at line 1094 of file cgdwarf_targ.cxx.
References FmtAssert, R_IA_64_DIR32MSB, and REL32_type.
| void Check_Dwarf_Rela | ( | const Elf32_Rela & | current_reloc | ) |
| void Check_Dwarf_Rela | ( | const Elf64_AltRela & | current_reloc | ) |
| static void CIE_dump2asm | ( | Dwarf_P_Cie | cie | ) | [static] |
Definition at line 142 of file cgdwarf_targ.cxx.
References AS_1BYTE, AS_4BYTE, AS_ASCII, AS_BYTE, AS_SECTION, AS_SLEBW, AS_ULEBW, Asm_File, Dwarf_P_Cie_s::cie_aug, Dwarf_P_Cie_s::cie_code_align, Dwarf_P_Cie_s::cie_data_align, Dwarf_P_Cie_s::cie_inst, Dwarf_P_Cie_s::cie_next, Dwarf_P_Cie_s::cie_personality, Dwarf_P_Cie_s::cie_ret_reg, Dwarf_P_Cie_s::cie_version, Current_PU_Count(), fmt_string, fprintf(), Is_True, and unw_info_pu_start_count.
Definition at line 191 of file cgdwarf_targ.cxx.
References Asm_File, Current_PU_Count(), and fprintf().
Definition at line 528 of file cgdwarf_targ.cxx.
References BB_entry, BB_first_op, BB_handler, BB_id, BB_Mark_Unreachable_Blocks(), BB_next, BB_preds, BB_unreachable, BBLIST_item, BOOL, changes, Current_PU_Stack_Model, CURRENT_SYMTAB, ENTRY_STATE, EXIT_STATE, FALSE, FD_S8, FD_SL, Find_Slink_Symbol(), FOR_ALL_BB_PREDS, fprintf(), Get_Current_PU, i, INT, LOCAL_STATE, memset, NULL, OP_next, OP_opnd, OP_store, PU_BB_Count, PU_is_nested_func(), Save_TN_to_fd(), SMODEL_SMALL, TFile, TN_is_register, TN_is_save_reg, TN_is_static_link_reg, TN_is_symbol, TN_var, Trace_Dwarf, TRUE, and TYPE_PU_ALLOC_N.
Definition at line 1089 of file cgdwarf_targ.cxx.
Definition at line 175 of file cgdwarf_targ.cxx.
References AS_4BYTE, AS_SECTION, Asm_File, Cur_PU_Name, Current_PU_Count(), fmt_string, fprintf(), Is_True, TFile, Trace_Dwarf, and unw_info_pu_start_count.
Definition at line 199 of file cgdwarf_targ.cxx.
References Asm_File, Current_PU_Count(), and fprintf().
Definition at line 1083 of file cgdwarf_targ.cxx.
Definition at line 610 of file cgdwarf_targ.cxx.
References BB_first_op, CLASS_REG_PAIR_EqualP, FALSE, OP_has_result, OP_load, OP_next, OP_opnd, OP_result, TN_class_reg, and TRUE.
Definition at line 626 of file cgdwarf_targ.cxx.
References BB_first_op, CLASS_REG_PAIR_EqualP, FALSE, OP_next, OP_opnd, OP_store, TN_class_reg, and TRUE.
Definition at line 1051 of file cgdwarf_targ.cxx.
References Compute_Region_Sizes(), Do_Control_Flow_Analysis_Of_Unwind_Info(), FALSE, fprintf(), has_asm, has_create, Is_Unwind_Simple(), last_label, next_when, proc_region, simple_unwind, TFile, Trace_Unwind, TRUE, and UNDEFINED_UREGION.
| BOOL Is_Dwarf_Section_To_Emit | ( | const char * | name | ) |
| static FD_REG Machine_Reg_To_FD | ( | TN * | tn, | |
| UINT32 | mc_id, | |||
| ISA_REGISTER_CLASS | c | |||
| ) | [static] |
Definition at line 428 of file cgdwarf_targ.cxx.
References FD_F20, FD_GP, FD_JA, FD_RA, FD_S0, FD_S8, Is_True, TN_is_float, TN_save_rclass, and TN_save_reg.
Definition at line 715 of file cgdwarf_targ.cxx.
References INT, INT32, OP_code, OP_Real_Ops(), op::opr, Simulated_Op_Real_Inst_Words(), and size.
Referenced by Build_Fde_For_Proc().
Definition at line 480 of file cgdwarf_targ.cxx.
References Is_True, Machine_Reg_To_FD(), NULL, REGISTER_machine_id, TN_is_ra_reg, TN_is_save_reg, TN_save_rclass, TN_save_reg, TN_spill, and UINT32.
Definition at line 499 of file cgdwarf_targ.cxx.
References Machine_Reg_To_FD(), NULL, TN_register, TN_register_class, TN_spill, and UINT32.
| static Dwarf_P_Fde update_state | ( | Dwarf_P_Fde | fde, | |
| FD_REG | fd_reg, | |||
| CGD_STATES * | current_state, | |||
| CGD_STATES | new_state | |||
| ) | [static] |
Definition at line 301 of file cgdwarf_targ.cxx.
References Add_Fde_Inst(), CGD_Name, curloc, data_alignment_factor, DevWarn, DS_CFA_Is_Adj_SP, DS_CFA_Is_FP, DS_CFA_Is_SP, DS_In_Memory, DS_In_Register, DW_CFA_def_cfa_offset, DW_CFA_def_cfa_register, DW_CFA_offset, DW_CFA_register, DW_FRAME_RA_COL, DW_FRAME_REG29, DW_FRAME_REG30, DW_FRAME_STATIC_LINK, EC_Misc_Int, ErrMsg(), FD_CFA, FD_RA, FD_SL, fd_to_dwarf, fd_to_track, fprintf(), Frame_Len, INT, Is_True, lastloc, Offset_from_FP(), TFile, and Trace_Dwarf.
const char* CGD_Name[DS_CFA_Last] [static] |
Initial value:
{
"DS_In_Register",
"DS_In_Memory",
"DS_CFA_Is_SP",
"DS_CFA_Is_Adj_SP",
"DS_CFA_Is_FP"
}
Definition at line 124 of file cgdwarf_targ.cxx.
Definition at line 258 of file cgdwarf_targ.cxx.
char* drop_these[] [static] |
Initial value:
{
".debug_line",
".debug_weaknames",
".debug_varnames",
".debug_typenames",
".debug_funcnames",
".debug_frame",
0
}
Definition at line 1125 of file cgdwarf_targ.cxx.
Dwarf_Error dw_error [static] |
Definition at line 33 of file cgdwarf_targ.cxx.
INT * entry_state [static] |
Definition at line 513 of file cgdwarf_targ.cxx.
INT * exit_state [static] |
Definition at line 513 of file cgdwarf_targ.cxx.
const UINT32 fd_to_dwarf[FD_LAST] [static] |
Initial value:
{
DW_FRAME_REG35, DW_FRAME_REG1, DW_FRAME_REG2, DW_FRAME_REG3,
DW_FRAME_REG4, DW_FRAME_REG5, DW_FRAME_REG6, DW_FRAME_REG7,
DW_FRAME_REG8, DW_FRAME_REG9, DW_FRAME_REG10, DW_FRAME_REG11,
DW_FRAME_REG12, DW_FRAME_REG13, DW_FRAME_REG14, DW_FRAME_REG15,
DW_FRAME_REG16, DW_FRAME_REG17, DW_FRAME_REG18, DW_FRAME_REG19,
DW_FRAME_REG20, DW_FRAME_REG21, DW_FRAME_REG22, DW_FRAME_REG23,
DW_FRAME_REG24, DW_FRAME_REG25, DW_FRAME_REG26, DW_FRAME_REG27,
0, DW_FRAME_REG29, DW_FRAME_REG30, DW_FRAME_REG31,
}
Definition at line 96 of file cgdwarf_targ.cxx.
ST* fd_to_spill_loc[FD_LAST] [static] |
Definition at line 109 of file cgdwarf_targ.cxx.
const UINT32 fd_to_track[FD_LAST] [static] |
Initial value:
{
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0,
}
Definition at line 87 of file cgdwarf_targ.cxx.
char* fmt_string = "\t%s\t0x%x\n" [static] |
Definition at line 132 of file cgdwarf_targ.cxx.
Definition at line 37 of file cgdwarf_targ.cxx.
BOOL has_create = FALSE [static] |
Definition at line 39 of file cgdwarf_targ.cxx.
UINT last_label = 0 [static] |
Definition at line 38 of file cgdwarf_targ.cxx.
Definition at line 35 of file cgdwarf_targ.cxx.
Definition at line 258 of file cgdwarf_targ.cxx.
INT* local_state [static] |
Definition at line 513 of file cgdwarf_targ.cxx.
ST* prev_fd_to_spill_loc[FD_LAST] [static] |
Definition at line 111 of file cgdwarf_targ.cxx.
BOOL simple_unwind = FALSE [static] |
Definition at line 36 of file cgdwarf_targ.cxx.
BOOL Trace_Unwind = TRUE [static] |
Definition at line 34 of file cgdwarf_targ.cxx.
INT unw_info_pu_start_count [static] |
Definition at line 139 of file cgdwarf_targ.cxx.
1.5.6