| 1 |
/* |
| 2 |
|
| 3 |
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved. |
| 4 |
Portions Copyright (C) 2017 David Anderson. All Rights Reserved. |
| 5 |
|
| 6 |
This program is free software; you can redistribute it |
| 7 |
and/or modify it under the terms of version 2.1 of the |
| 8 |
GNU Lesser General Public License as published by the Free |
| 9 |
Software Foundation. |
| 10 |
|
| 11 |
This program is distributed in the hope that it would be |
| 12 |
useful, but WITHOUT ANY WARRANTY; without even the implied |
| 13 |
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 |
PURPOSE. |
| 15 |
|
| 16 |
Further, this software is distributed without any warranty |
| 17 |
that it is free of the rightful claim of any third person |
| 18 |
regarding infringement or the like. Any license provided |
| 19 |
herein, whether implied or otherwise, applies only to this |
| 20 |
software file. Patent licenses, if any, provided herein |
| 21 |
do not apply to combinations of this program with other |
| 22 |
software, or any other product whatsoever. |
| 23 |
|
| 24 |
You should have received a copy of the GNU Lesser General |
| 25 |
Public License along with this program; if not, write the |
| 26 |
Free Software Foundation, Inc., 51 Franklin Street - Fifth |
| 27 |
Floor, Boston MA 02110-1301, USA. |
| 28 |
*/ |
| 29 |
|
| 30 |
/* |
| 31 |
Largest register value that can be coded into |
| 32 |
the opcode since there are only 6 bits in the |
| 33 |
register field. |
| 34 |
*/ |
| 35 |
#define MAX_6_BIT_VALUE 0x3f |
| 36 |
|
| 37 |
/* This struct holds debug_frame instructions */ |
| 38 |
typedef struct Dwarf_P_Frame_Pgm_s *Dwarf_P_Frame_Pgm; |
| 39 |
|
| 40 |
struct Dwarf_P_Frame_Pgm_s { |
| 41 |
Dwarf_Ubyte dfp_opcode; /* opcode - includes reg # */ |
| 42 |
char * dfp_args; /* operands */ |
| 43 |
Dwarf_Unsigned dfp_nbytes; /* number of bytes in args */ |
| 44 |
Dwarf_P_Frame_Pgm dfp_next; |
| 45 |
}; |
| 46 |
|
| 47 |
/* |
| 48 |
This struct has cie related information. Used to gather data |
| 49 |
from user program, and later to transform to disk form |
| 50 |
*/ |
| 51 |
struct Dwarf_P_Cie_s { |
| 52 |
Dwarf_Half cie_version; |
| 53 |
|
| 54 |
/* augmentation. The string is an strdup() copy |
| 55 |
and on freeing the Dwarf_P_Cie the string must be freed. */ |
| 56 |
char *cie_aug; |
| 57 |
|
| 58 |
Dwarf_Ubyte cie_code_align; /* alignment of code */ |
| 59 |
Dwarf_Sbyte cie_data_align; |
| 60 |
Dwarf_Ubyte cie_ret_reg; /* return register # */ |
| 61 |
char *cie_inst; /* initial instruction */ |
| 62 |
long cie_inst_bytes; |
| 63 |
/* no of init_inst */ |
| 64 |
Dwarf_P_Cie cie_next; |
| 65 |
}; |
| 66 |
|
| 67 |
/* producer fields */ |
| 68 |
struct Dwarf_P_Fde_s { |
| 69 |
Dwarf_Unsigned fde_unused1; |
| 70 |
|
| 71 |
/* function/subr die for this fde */ |
| 72 |
Dwarf_P_Die fde_die; |
| 73 |
|
| 74 |
/* index to asso. cie */ |
| 75 |
Dwarf_Unsigned fde_cie; |
| 76 |
|
| 77 |
/* Address of first location of the code this frame applies to If |
| 78 |
fde_end_symbol non-zero, this represents the offset from the |
| 79 |
symbol indicated by fde_r_symidx */ |
| 80 |
Dwarf_Addr fde_initloc; |
| 81 |
|
| 82 |
/* Relocation symbol for address of the code this |
| 83 |
frame applies to. */ |
| 84 |
Dwarf_Unsigned fde_r_symidx; |
| 85 |
|
| 86 |
/* Bytes of instr for this fde, if known */ |
| 87 |
Dwarf_Unsigned fde_addr_range; |
| 88 |
|
| 89 |
/* linked list of instructions we will put in fde. */ |
| 90 |
Dwarf_P_Frame_Pgm fde_inst; |
| 91 |
|
| 92 |
/* number of instructions in fde */ |
| 93 |
Dwarf_Signed fde_n_inst; |
| 94 |
|
| 95 |
/* number of bytes of inst in fde */ |
| 96 |
Dwarf_Signed fde_n_bytes; |
| 97 |
|
| 98 |
/* offset into exception table for this function. */ |
| 99 |
Dwarf_Signed fde_offset_into_exception_tables; |
| 100 |
|
| 101 |
/* The symbol for the exception table elf section. */ |
| 102 |
Dwarf_Unsigned fde_exception_table_symbol; |
| 103 |
|
| 104 |
/* pointer to last inst */ |
| 105 |
Dwarf_P_Frame_Pgm fde_last_inst; |
| 106 |
|
| 107 |
Dwarf_P_Fde fde_next; |
| 108 |
|
| 109 |
/* The symbol and offset of the end symbol. |
| 110 |
When fde_end_symbol is |
| 111 |
non-zero we must represent the length in relocs. */ |
| 112 |
Dwarf_Addr fde_end_symbol_offset; |
| 113 |
Dwarf_Unsigned fde_end_symbol; |
| 114 |
|
| 115 |
int fde_uwordb_size; |
| 116 |
Dwarf_P_Debug fde_dbg; |
| 117 |
|
| 118 |
/* If fde_block is non-null, then it is the set of instructions. |
| 119 |
so we should use it rather than fde_inst. */ |
| 120 |
Dwarf_Unsigned fde_inst_block_size; |
| 121 |
void *fde_block; |
| 122 |
}; |