Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#include <stdio.h>
#include <elf.h>
#include <libelf.h>
#include "defs.h"
#include "erglob.h"
#include "srcpos.h"
#include "em_elf.h"
#include "em_dwarf.h"
#include "config_elf_targ.h"
#include "targ_em_dwarf.h"
Go to the source code of this file.
#define EXT_OP | ( | v | ) | (DW_CFA_extended | v) |
#define MAX_DWARF_SECTIONS 20 |
Definition at line 60 of file em_dwarf.cxx.
Referenced by setup_new_section_for_dwarf().
#define USE_STANDARD_TYPES 1 |
Definition at line 45 of file em_dwarf.cxx.
static int advance_to_next_stream_buffer | ( | const Dwarf_Signed | scndx | ) | [static] |
Definition at line 318 of file em_dwarf.cxx.
References current_scn, exit(), find_indexed_section(), fprintf(), and section_count.
Referenced by Em_Dwarf_Write_Scns().
static Dwarf_Unsigned another_identity_function | ( | Elf64_Word | x | ) | [static] |
Definition at line 92 of file em_dwarf.cxx.
Referenced by Em_Dwarf_Begin().
void Em_Dwarf_Add_File | ( | UINT16 | file_idx, |
char * | name, | ||
UINT16 | incl_idx, | ||
Dwarf_Unsigned | modification_time, | ||
Dwarf_Unsigned | file_size | ||
) |
Definition at line 224 of file em_dwarf.cxx.
References dw_dbg, dw_error, dwarf_add_file_decl(), FNAME::dwarf_idx, FNAME::filename, FNAME::incl_idx, Increase_File_Table_Size(), and name.
void Em_Dwarf_Add_Include | ( | UINT16 | incl_idx, |
char * | name | ||
) |
Definition at line 189 of file em_dwarf.cxx.
References dw_dbg, dw_error, dwarf_add_directory_decl(), INCL::dwarf_idx, Increase_Incl_Table_Size(), name, and INCL::path.
void Em_Dwarf_Add_Line_Entry | ( | INT | code_address, |
SRCPOS | srcpos | ||
) |
Definition at line 478 of file em_dwarf.cxx.
References dw_dbg, dw_error, dwarf_add_line_entry(), USRCPOS_bb_begin, USRCPOS_column, USRCPOS_filenum, USRCPOS_linenum, USRCPOS_srcpos, and USRCPOS_stmt_begin.
Dwarf_P_Debug Em_Dwarf_Begin | ( | BOOL | is_64bit, |
BOOL | dwarf_trace, | ||
BOOL | is_cplus, | ||
symbol_index_recorder | record_symidx | ||
) |
Definition at line 248 of file em_dwarf.cxx.
References another_identity_function(), cie_index, data_alignment_factor, DW_CIE_AUGMENTER_STRING_V0, dw_dbg, DW_DLC_SIZE_32, DW_DLC_SIZE_64, DW_DLC_SYMBOLIC_RELOCATIONS, DW_DLC_WRITE, dw_error, DW_FRAME_RA_COL, dwarf_add_frame_cie(), dwarf_producer_init_b(), DWARF_TARGET_FLAG, Increase_File_Table_Size(), Increase_Incl_Table_Size(), NULL, Record_Symidx, setup_new_section_for_dwarf(), and TARG_INIT_BYTES.
Referenced by Em_Dwarf_Begin().
Dwarf_P_Debug Em_Dwarf_Begin | ( | BOOL | is_64bit, |
BOOL | dwarf_trace, | ||
BOOL | is_cplus | ||
) |
Definition at line 286 of file em_dwarf.cxx.
References Em_Dwarf_Begin(), and NULL.
void Em_Dwarf_End | ( | void | ) |
Definition at line 471 of file em_dwarf.cxx.
References dw_dbg, dw_error, and dwarf_producer_finish().
void Em_Dwarf_End_Text_Arange | ( | pSCNINFO | scninfo, |
INT | end_offset | ||
) |
Definition at line 543 of file em_dwarf.cxx.
References dw_dbg, dw_error, dwarf_add_arange(), Em_Create_Section_Symbol(), and Text_Start_Offset.
Referenced by Em_Dwarf_End_Text_Region().
void Em_Dwarf_End_Text_Arange_Symbolic | ( | Dwarf_Unsigned | last_label, |
Dwarf_Addr | offset_from_last_label | ||
) |
Definition at line 552 of file em_dwarf.cxx.
References dw_dbg, dw_error, dwarf_add_arange_b(), Offset_From_Text_Start_Label, and Text_Start_Label.
Referenced by Em_Dwarf_End_Text_Region_Semi_Symbolic().
void Em_Dwarf_End_Text_Lines | ( | pSCNINFO | scninfo, |
INT | end_offset | ||
) |
Definition at line 537 of file em_dwarf.cxx.
References dw_dbg, dw_error, and dwarf_lne_end_sequence().
Referenced by Em_Dwarf_End_Text_Region(), and Em_Dwarf_End_Text_Region_Semi_Symbolic().
void Em_Dwarf_End_Text_Region | ( | pSCNINFO | scninfo, |
INT | end_offset | ||
) |
Definition at line 565 of file em_dwarf.cxx.
References Em_Dwarf_End_Text_Arange(), and Em_Dwarf_End_Text_Lines().
void Em_Dwarf_End_Text_Region_Semi_Symbolic | ( | pSCNINFO | scninfo, |
INT | end_offset, | ||
Dwarf_Unsigned | last_label, | ||
Dwarf_Addr | offset_from_last_label | ||
) |
Definition at line 572 of file em_dwarf.cxx.
References Em_Dwarf_End_Text_Arange_Symbolic(), and Em_Dwarf_End_Text_Lines().
pSCNINFO Em_Dwarf_Find_Dwarf_Scn | ( | size_t | scndx | ) |
Definition at line 141 of file em_dwarf.cxx.
References Em_Get_Section_Index(), NULL, and num_dwarf_scns.
Referenced by Em_Dwarf_Write_Scns().
pSCNINFO Em_Dwarf_Find_Dwarf_Scn_By_Name | ( | char * | name | ) |
Definition at line 152 of file em_dwarf.cxx.
References Em_Get_Section_Name(), NULL, and num_dwarf_scns.
INT Em_Dwarf_Prepare_Output | ( | void | ) |
Definition at line 460 of file em_dwarf.cxx.
References dw_dbg, DW_DLV_NOCOUNT, dw_error, dwarf_transform_to_disk_form(), exit(), fprintf(), and section_count.
void Em_Dwarf_Process_PU | ( | Dwarf_Unsigned | begin_label, |
Dwarf_Unsigned | end_label, | ||
INT32 | begin_offset, | ||
INT32 | end_offset, | ||
Dwarf_P_Die | PU_die, | ||
Dwarf_P_Fde | fde, | ||
Elf64_Word | eh_symindex, | ||
INT | eh_offset | ||
) |
Definition at line 582 of file em_dwarf.cxx.
References cie_index, DW_AT_high_pc, DW_AT_low_pc, dw_dbg, DW_DLX_NO_EH_OFFSET, dw_error, dwarf_add_AT_targ_address_b(), dwarf_add_frame_fde_b(), dwarf_add_frame_info_b(), and NULL.
void Em_Dwarf_Start_Text_Lines | ( | pSCNINFO | scninfo, |
INT | start_offset | ||
) |
Definition at line 512 of file em_dwarf.cxx.
References dw_dbg, dw_error, dwarf_lne_set_address(), Em_Create_Section_Symbol(), and Text_Start_Offset.
Referenced by Em_Dwarf_Start_Text_Region().
void Em_Dwarf_Start_Text_Region | ( | pSCNINFO | scninfo, |
INT | start_offset | ||
) |
Definition at line 520 of file em_dwarf.cxx.
References Em_Dwarf_Start_Text_Lines().
void Em_Dwarf_Start_Text_Region_Semi_Symbolic | ( | pSCNINFO | scninfo, |
INT | start_offset, | ||
Dwarf_Unsigned | first_label, | ||
Dwarf_Addr | offset_from_first_label | ||
) |
Definition at line 526 of file em_dwarf.cxx.
References Offset_From_Text_Start_Label, Text_Start_Label, and Text_Start_Offset.
void Em_Dwarf_Write_Scns | ( | Cg_Dwarf_Sym_To_Elfsym_Ofst | translate_dwarf_sym | ) |
Definition at line 342 of file em_dwarf.cxx.
References advance_to_next_stream_buffer(), index_to_buffer_map_entry::buffer, index_to_buffer_map_entry::bufsize, current_scn, index_to_buffer_map_entry::cursection, data_alignment_factor, dw_dbg, DW_DLV_OK, dw_error, dwarf_get_relocation_info(), dwarf_get_relocation_info_count(), dwarf_get_section_bytes(), dwarf_reset_section_bytes(), Em_Add_Bytes_To_Scn(), Em_Dwarf_Find_Dwarf_Scn(), Em_Dwarf_Symbolic_Relocs_To_Elf(), Em_End_Section(), Em_Get_Section_Name(), exit(), find_indexed_section(), fprintf(), free(), get_current_buffer(), get_current_bufsize(), identity_function(), NULL, num_dwarf_scns, relocation_section_count, result, index_to_buffer_map_entry::scndx, and section_count.
Referenced by Em_Dwarf_Write_Scns().
void Em_Dwarf_Write_Scns | ( | void | ) |
Definition at line 454 of file em_dwarf.cxx.
References Em_Dwarf_Write_Scns(), and NULL.
static int find_indexed_section | ( | int | i, |
const Dwarf_Signed | scn | ||
) | [inline, static] |
Definition at line 304 of file em_dwarf.cxx.
References section_count.
Referenced by advance_to_next_stream_buffer(), and Em_Dwarf_Write_Scns().
static Dwarf_Ptr get_current_buffer | ( | void | ) | [static] |
Definition at line 330 of file em_dwarf.cxx.
References index_to_buffer_map_entry::buffer, and current_scn.
Referenced by Em_Dwarf_Write_Scns().
static Dwarf_Unsigned get_current_bufsize | ( | void | ) | [static] |
Definition at line 336 of file em_dwarf.cxx.
References index_to_buffer_map_entry::bufsize, and current_scn.
Referenced by Em_Dwarf_Write_Scns().
static void identity_function | ( | Dwarf_Unsigned | symidx, |
Dwarf_Unsigned * | elf_symidx, | ||
Dwarf_Unsigned * | elf_symoff | ||
) | [static] |
Definition at line 83 of file em_dwarf.cxx.
Referenced by Em_Dwarf_Write_Scns().
static void Increase_File_Table_Size | ( | UINT16 | file_idx | ) | [static] |
Definition at line 201 of file em_dwarf.cxx.
References bzero(), EC_No_Mem, ErrMsg(), file_table_size, and NULL.
Referenced by Em_Dwarf_Add_File(), and Em_Dwarf_Begin().
static void Increase_Incl_Table_Size | ( | UINT16 | incl_idx | ) | [static] |
Definition at line 167 of file em_dwarf.cxx.
References bzero(), EC_No_Mem, ErrMsg(), incl_table_size, and NULL.
Referenced by Em_Dwarf_Add_Include(), and Em_Dwarf_Begin().
static int setup_new_section_for_dwarf | ( | char * | name, |
int | is_64bit, | ||
Dwarf_Unsigned | type, | ||
Dwarf_Unsigned | flags, | ||
Dwarf_Unsigned | link, | ||
Dwarf_Unsigned | info, | ||
Dwarf_Unsigned * | name_idx, | ||
int * | error | ||
) | [static] |
Definition at line 100 of file em_dwarf.cxx.
References ELF32_FSZ_WORD, ELF64_FSZ_XWORD, Em_Create_Section_Symbol(), Em_Get_Section_Index(), Em_New_Section(), Em_Set_sh_info(), Em_Set_sh_link(), exit(), fprintf(), MAX_DWARF_SECTIONS, num_dwarf_scns, Record_Symidx, SHT_REL, SHT_RELA, and Symtab_Info.
Referenced by Em_Dwarf_Begin().
Dwarf_Unsigned cie_index [static] |
Definition at line 64 of file em_dwarf.cxx.
Referenced by Em_Dwarf_Begin(), and Em_Dwarf_Process_PU().
int current_scn [static] |
Definition at line 315 of file em_dwarf.cxx.
Referenced by advance_to_next_stream_buffer(), Em_Dwarf_Write_Scns(), get_current_buffer(), and get_current_bufsize().
Definition at line 55 of file em_dwarf.cxx.
Referenced by Em_Dwarf_Begin(), and Em_Dwarf_Write_Scns().
Dwarf_P_Debug dw_dbg [static] |
Definition at line 57 of file em_dwarf.cxx.
Referenced by Em_Dwarf_Add_File(), Em_Dwarf_Add_Include(), Em_Dwarf_Add_Line_Entry(), Em_Dwarf_Begin(), Em_Dwarf_End(), Em_Dwarf_End_Text_Arange(), Em_Dwarf_End_Text_Arange_Symbolic(), Em_Dwarf_End_Text_Lines(), Em_Dwarf_Prepare_Output(), Em_Dwarf_Process_PU(), Em_Dwarf_Start_Text_Lines(), and Em_Dwarf_Write_Scns().
Dwarf_Error dw_error [static] |
Definition at line 58 of file em_dwarf.cxx.
Referenced by Em_Dwarf_Add_File(), Em_Dwarf_Add_Include(), Em_Dwarf_Add_Line_Entry(), Em_Dwarf_Begin(), Em_Dwarf_End(), Em_Dwarf_End_Text_Arange(), Em_Dwarf_End_Text_Arange_Symbolic(), Em_Dwarf_End_Text_Lines(), Em_Dwarf_Prepare_Output(), Em_Dwarf_Process_PU(), Em_Dwarf_Start_Text_Lines(), and Em_Dwarf_Write_Scns().
pSCNINFO dwarf_scn[MAX_DWARF_SECTIONS] [static] |
Definition at line 61 of file em_dwarf.cxx.
FNAME* file_table [static] |
Definition at line 79 of file em_dwarf.cxx.
INT file_table_size [static] |
Definition at line 80 of file em_dwarf.cxx.
Referenced by Gen_File_Table(), Increase_File_Table_Size(), and ir_print_filename().
INCL* incl_table [static] |
Definition at line 77 of file em_dwarf.cxx.
INT incl_table_size [static] |
Definition at line 78 of file em_dwarf.cxx.
Referenced by Gen_File_Table(), Increase_Incl_Table_Size(), and IR_Dwarf_Gen_File_Table().
Definition at line 301 of file em_dwarf.cxx.
size_t num_dwarf_scns = 0 [static] |
Definition at line 62 of file em_dwarf.cxx.
Referenced by Em_Dwarf_Find_Dwarf_Scn(), Em_Dwarf_Find_Dwarf_Scn_By_Name(), Em_Dwarf_Write_Scns(), and setup_new_section_for_dwarf().
Dwarf_Addr Offset_From_Text_Start_Label [static] |
Definition at line 509 of file em_dwarf.cxx.
Referenced by Em_Dwarf_End_Text_Arange_Symbolic(), and Em_Dwarf_Start_Text_Region_Semi_Symbolic().
symbol_index_recorder Record_Symidx [static] |
Definition at line 97 of file em_dwarf.cxx.
Referenced by Em_Dwarf_Begin(), and setup_new_section_for_dwarf().
Dwarf_Unsigned relocation_section_count = DW_DLV_NOCOUNT [static] |
Definition at line 292 of file em_dwarf.cxx.
Referenced by Em_Dwarf_Write_Scns().
Dwarf_Signed section_count = DW_DLV_NOCOUNT [static] |
Definition at line 291 of file em_dwarf.cxx.
Referenced by advance_to_next_stream_buffer(), Em_Dwarf_Prepare_Output(), Em_Dwarf_Write_Scns(), and find_indexed_section().
Dwarf_Unsigned Text_Start_Label [static] |
Definition at line 508 of file em_dwarf.cxx.
Referenced by Em_Dwarf_End_Text_Arange_Symbolic(), and Em_Dwarf_Start_Text_Region_Semi_Symbolic().
INT Text_Start_Offset [static] |
Definition at line 507 of file em_dwarf.cxx.
Referenced by Em_Dwarf_End_Text_Arange(), Em_Dwarf_Start_Text_Lines(), and Em_Dwarf_Start_Text_Region_Semi_Symbolic().