Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
em_dwarf.cxx File Reference
#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"
Include dependency graph for em_dwarf.cxx:

Go to the source code of this file.

Classes

struct  INCL
struct  FNAME
struct  index_to_buffer_map_entry

Defines

#define USE_STANDARD_TYPES   1
#define MAX_DWARF_SECTIONS   20
#define EXT_OP(v)   (DW_CFA_extended | v)

Functions

static void identity_function (Dwarf_Unsigned symidx, Dwarf_Unsigned *elf_symidx, Dwarf_Unsigned *elf_symoff)
static Dwarf_Unsigned another_identity_function (Elf64_Word x)
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)
pSCNINFO Em_Dwarf_Find_Dwarf_Scn (size_t scndx)
pSCNINFO Em_Dwarf_Find_Dwarf_Scn_By_Name (char *name)
static void Increase_Incl_Table_Size (UINT16 incl_idx)
void Em_Dwarf_Add_Include (UINT16 incl_idx, char *name)
static void Increase_File_Table_Size (UINT16 file_idx)
void Em_Dwarf_Add_File (UINT16 file_idx, char *name, UINT16 incl_idx, Dwarf_Unsigned modification_time, Dwarf_Unsigned file_size)
Dwarf_P_Debug Em_Dwarf_Begin (BOOL is_64bit, BOOL dwarf_trace, BOOL is_cplus, symbol_index_recorder record_symidx)
Dwarf_P_Debug Em_Dwarf_Begin (BOOL is_64bit, BOOL dwarf_trace, BOOL is_cplus)
static int find_indexed_section (int i, const Dwarf_Signed scn)
static int advance_to_next_stream_buffer (const Dwarf_Signed scndx)
static Dwarf_Ptr get_current_buffer (void)
static Dwarf_Unsigned get_current_bufsize (void)
void Em_Dwarf_Write_Scns (Cg_Dwarf_Sym_To_Elfsym_Ofst translate_dwarf_sym)
void Em_Dwarf_Write_Scns (void)
INT Em_Dwarf_Prepare_Output (void)
void Em_Dwarf_End (void)
void Em_Dwarf_Add_Line_Entry (INT code_address, SRCPOS srcpos)
void Em_Dwarf_Start_Text_Lines (pSCNINFO scninfo, INT start_offset)
void Em_Dwarf_Start_Text_Region (pSCNINFO scninfo, INT start_offset)
void Em_Dwarf_Start_Text_Region_Semi_Symbolic (pSCNINFO scninfo, INT start_offset, Dwarf_Unsigned first_label, Dwarf_Addr offset_from_first_label)
void Em_Dwarf_End_Text_Lines (pSCNINFO scninfo, INT end_offset)
void Em_Dwarf_End_Text_Arange (pSCNINFO scninfo, INT end_offset)
void Em_Dwarf_End_Text_Arange_Symbolic (Dwarf_Unsigned last_label, Dwarf_Addr offset_from_last_label)
void Em_Dwarf_End_Text_Region (pSCNINFO scninfo, INT end_offset)
void Em_Dwarf_End_Text_Region_Semi_Symbolic (pSCNINFO scninfo, INT end_offset, Dwarf_Unsigned last_label, Dwarf_Addr offset_from_last_label)
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)

Variables

INT data_alignment_factor
static Dwarf_P_Debug dw_dbg
static Dwarf_Error dw_error
static pSCNINFO dwarf_scn [MAX_DWARF_SECTIONS]
static size_t num_dwarf_scns = 0
static Dwarf_Unsigned cie_index
static INCLincl_table
static INT incl_table_size
static FNAMEfile_table
static INT file_table_size
static symbol_index_recorder Record_Symidx
static Dwarf_Signed section_count = DW_DLV_NOCOUNT
static Dwarf_Unsigned relocation_section_count = DW_DLV_NOCOUNT
index_to_buffer_map_entryindex_to_buffer_map
static int current_scn
static INT Text_Start_Offset
static Dwarf_Unsigned Text_Start_Label
static Dwarf_Addr Offset_From_Text_Start_Label

Define Documentation

#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.


Function Documentation

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().

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

void Em_Dwarf_End ( void  )

Definition at line 471 of file em_dwarf.cxx.

References dw_dbg, dw_error, and dwarf_producer_finish().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Definition at line 152 of file em_dwarf.cxx.

References Em_Get_Section_Name(), NULL, and num_dwarf_scns.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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 ( void  )

Definition at line 454 of file em_dwarf.cxx.

References Em_Dwarf_Write_Scns(), and NULL.

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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]

Variable Documentation

Definition at line 64 of file em_dwarf.cxx.

Referenced by Em_Dwarf_Begin(), and Em_Dwarf_Process_PU().

Definition at line 55 of file em_dwarf.cxx.

Referenced by Em_Dwarf_Begin(), and Em_Dwarf_Write_Scns().

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 97 of file em_dwarf.cxx.

Referenced by Em_Dwarf_Begin(), and setup_new_section_for_dwarf().

Definition at line 292 of file em_dwarf.cxx.

Referenced by Em_Dwarf_Write_Scns().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines