Debugger sources code clean-up
[clinton/Virtual-Jaguar-Rx.git] / src / debugger / DBGManager.h
CommitLineData
2d0121d4
JPM
1\r
2\r
3#ifndef __DBGMANAGER_H__\r
4#define __DBGMANAGER_H__\r
5\r
6\r
7typedef enum {\r
8 DBG_NO_TYPE = 0x0,\r
9 DBG_ELF = 0x1,\r
10 DBG_DWARF = 0x2,\r
11 DBG_ELFDWARF = 0x4,\r
12 DBG_HWLABEL = 0x8,\r
13 DBG_END_TYPE\r
14}DBGTYPE;\r
15\r
16// Tag based in the DW_TAG_... list from the dwarf.h\r
17typedef enum {\r
18 DBG_NO_TAG = 0x0,\r
19 DBG_TAG_pointer_type = 0x0f,\r
20 DBG_TAG_compile_unit = 0x11,\r
21 DBG_TAG_base_type = 0x24,\r
22 DBG_TAG_subprogram = 0x2e,\r
23 DBG_END_TAG\r
24}DBGTAG;\r
25\r
0203b5fd
JPM
26//\r
27typedef enum {\r
28 DBG_TAG_TYPE_structure = 0x1,\r
29 DBG_TAG_TYPE_pointer = 0x2,\r
30 DBG_TAG_TYPE_subrange = 0x4,\r
31 DBG_TAG_TYPE_array = 0x8,\r
32 DBG_TAG_TYPE_const = 0x10,\r
33 DBG_TAG_TYPE_typedef = 0x20\r
34}DBGTAGTYPE;\r
35\r
2d0121d4
JPM
36// Encoding based in the DW_ATE_... list from the dwarf.h\r
37// Except for the DBG_ATE_ptr\r
38typedef enum {\r
39 DBG_NO_TYPEENCODING,\r
40 DBG_ATE_address = 0x1, // linear machine address\r
41 DBG_ATE_boolean = 0x2, // true or false\r
42 DBG_ATE_complex_float = 0x3, // complex floating-point number\r
43 DBG_ATE_float = 0x4, // floating-point number\r
44 DBG_ATE_signed = 0x5, // signed binary integer\r
45 DBG_ATE_signed_char = 0x6, // signed character\r
46 DBG_ATE_unsigned = 0x7, // unsigned binary integer\r
47 DBG_ATE_unsigned_char = 0x8, // unsigned character\r
48 DBG_ATE_imaginary_float = 0x9, /* DWARF3 */\r
49 DBG_ATE_packed_decimal = 0xa, /* DWARF3f */\r
50 DBG_ATE_numeric_string = 0xb, /* DWARF3f */\r
51 DBG_ATE_edited = 0xc, /* DWARF3f */\r
52 DBG_ATE_signed_fixed = 0xd, /* DWARF3f */\r
53 DBG_ATE_unsigned_fixed = 0xe, /* DWARF3f */\r
54 DBG_ATE_decimal_float = 0xf, /* DWARF3f */\r
55 DBG_ATE_ptr = 0x10, // Specific to DBG Manager to represent pointer type\r
56 DBG_END_TYPEENCODING\r
57}DBGTYPEENCODING;\r
58\r
0203b5fd
JPM
59// Encoding based in the DW_OP_... list from the dwarf.h\r
60typedef enum {\r
61 DBG_NO_OP,\r
62 DBG_OP_addr = 0x03,\r
63 DBG_OP_deref = 0x06,\r
64 DBG_OP_const1u = 0x08,\r
65 DBG_OP_const1s = 0x09,\r
66 DBG_OP_const2u = 0x0a,\r
67 DBG_OP_const2s = 0x0b,\r
68 DBG_OP_const4u = 0x0c,\r
69 DBG_OP_const4s = 0x0d,\r
70 DBG_OP_const8u = 0x0e,\r
71 DBG_OP_const8s = 0x0f,\r
72 DBG_OP_constu = 0x10,\r
73 DBG_OP_consts = 0x11,\r
74 DBG_OP_dup = 0x12,\r
75 DBG_OP_drop = 0x13,\r
76 DBG_OP_over = 0x14,\r
77 DBG_OP_pick = 0x15,\r
78 DBG_OP_swap = 0x16,\r
79 DBG_OP_rot = 0x17,\r
80 DBG_OP_xderef = 0x18,\r
81 DBG_OP_abs = 0x19,\r
82 DBG_OP_and = 0x1a,\r
83 DBG_OP_div = 0x1b,\r
84 DBG_OP_minus = 0x1c,\r
85 DBG_OP_mod = 0x1d,\r
86 DBG_OP_mul = 0x1e,\r
87 DBG_OP_neg = 0x1f,\r
88 DBG_OP_not = 0x20,\r
89 DBG_OP_or = 0x21,\r
90 DBG_OP_plus = 0x22,\r
91 DBG_OP_plus_uconst = 0x23,\r
92 DBG_OP_shl = 0x24,\r
93 DBG_OP_shr = 0x25,\r
94 DBG_OP_shra = 0x26,\r
95 DBG_OP_xor = 0x27,\r
96 DBG_OP_bra = 0x28,\r
97 DBG_OP_eq = 0x29,\r
98 DBG_OP_ge = 0x2a,\r
99 DBG_OP_gt = 0x2b,\r
100 DBG_OP_le = 0x2c,\r
101 DBG_OP_lt = 0x2d,\r
102 DBG_OP_ne = 0x2e,\r
103 DBG_OP_skip = 0x2f,\r
104 DBG_OP_lit0 = 0x30,\r
105 DBG_OP_lit1 = 0x31,\r
106 DBG_OP_lit2 = 0x32,\r
107 DBG_OP_lit3 = 0x33,\r
108 DBG_OP_lit4 = 0x34,\r
109 DBG_OP_lit5 = 0x35,\r
110 DBG_OP_lit6 = 0x36,\r
111 DBG_OP_lit7 = 0x37,\r
112 DBG_OP_lit8 = 0x38,\r
113 DBG_OP_lit9 = 0x39,\r
114 DBG_OP_lit10 = 0x3a,\r
115 DBG_OP_lit11 = 0x3b,\r
116 DBG_OP_lit12 = 0x3c,\r
117 DBG_OP_lit13 = 0x3d,\r
118 DBG_OP_lit14 = 0x3e,\r
119 DBG_OP_lit15 = 0x3f,\r
120 DBG_OP_lit16 = 0x40,\r
121 DBG_OP_lit17 = 0x41,\r
122 DBG_OP_lit18 = 0x42,\r
123 DBG_OP_lit19 = 0x43,\r
124 DBG_OP_lit20 = 0x44,\r
125 DBG_OP_lit21 = 0x45,\r
126 DBG_OP_lit22 = 0x46,\r
127 DBG_OP_lit23 = 0x47,\r
128 DBG_OP_lit24 = 0x48,\r
129 DBG_OP_lit25 = 0x49,\r
130 DBG_OP_lit26 = 0x4a,\r
131 DBG_OP_lit27 = 0x4b,\r
132 DBG_OP_lit28 = 0x4c,\r
133 DBG_OP_lit29 = 0x4d,\r
134 DBG_OP_lit30 = 0x4e,\r
135 DBG_OP_lit31 = 0x4f,\r
136 DBG_OP_reg0 = 0x50,\r
137 DBG_OP_reg1 = 0x51,\r
138 DBG_OP_reg2 = 0x52,\r
139 DBG_OP_reg3 = 0x53,\r
140 DBG_OP_reg4 = 0x54,\r
141 DBG_OP_reg5 = 0x55,\r
142 DBG_OP_reg6 = 0x56,\r
143 DBG_OP_reg7 = 0x57,\r
144 DBG_OP_reg8 = 0x58,\r
145 DBG_OP_reg9 = 0x59,\r
146 DBG_OP_reg10 = 0x5a,\r
147 DBG_OP_reg11 = 0x5b,\r
148 DBG_OP_reg12 = 0x5c,\r
149 DBG_OP_reg13 = 0x5d,\r
150 DBG_OP_reg14 = 0x5e,\r
151 DBG_OP_reg15 = 0x5f,\r
152 DBG_OP_reg16 = 0x60,\r
153 DBG_OP_reg17 = 0x61,\r
154 DBG_OP_reg18 = 0x62,\r
155 DBG_OP_reg19 = 0x63,\r
156 DBG_OP_reg20 = 0x64,\r
157 DBG_OP_reg21 = 0x65,\r
158 DBG_OP_reg22 = 0x66,\r
159 DBG_OP_reg23 = 0x67,\r
160 DBG_OP_reg24 = 0x68,\r
161 DBG_OP_reg25 = 0x69,\r
162 DBG_OP_reg26 = 0x6a,\r
163 DBG_OP_reg27 = 0x6b,\r
164 DBG_OP_reg28 = 0x6c,\r
165 DBG_OP_reg29 = 0x6d,\r
166 DBG_OP_reg30 = 0x6e,\r
167 DBG_OP_reg31 = 0x6f,\r
168 DBG_OP_breg0 = 0x70,\r
169 DBG_OP_breg1 = 0x71,\r
170 DBG_OP_breg2 = 0x72,\r
171 DBG_OP_breg3 = 0x73,\r
172 DBG_OP_breg4 = 0x74,\r
173 DBG_OP_breg5 = 0x75,\r
174 DBG_OP_breg6 = 0x76,\r
175 DBG_OP_breg7 = 0x77,\r
176 DBG_OP_breg8 = 0x78,\r
177 DBG_OP_breg9 = 0x79,\r
178 DBG_OP_breg10 = 0x7a,\r
179 DBG_OP_breg11 = 0x7b,\r
180 DBG_OP_breg12 = 0x7c,\r
181 DBG_OP_breg13 = 0x7d,\r
182 DBG_OP_breg14 = 0x7e,\r
183 DBG_OP_breg15 = 0x7f,\r
184 DBG_OP_breg16 = 0x80,\r
185 DBG_OP_breg17 = 0x81,\r
186 DBG_OP_breg18 = 0x82,\r
187 DBG_OP_breg19 = 0x83,\r
188 DBG_OP_breg20 = 0x84,\r
189 DBG_OP_breg21 = 0x85,\r
190 DBG_OP_breg22 = 0x86,\r
191 DBG_OP_breg23 = 0x87,\r
192 DBG_OP_breg24 = 0x88,\r
193 DBG_OP_breg25 = 0x89,\r
194 DBG_OP_breg26 = 0x8a,\r
195 DBG_OP_breg27 = 0x8b,\r
196 DBG_OP_breg28 = 0x8c,\r
197 DBG_OP_breg29 = 0x8d,\r
198 DBG_OP_breg30 = 0x8e,\r
199 DBG_OP_breg31 = 0x8f,\r
200 DBG_OP_regx = 0x90,\r
201 DBG_OP_fbreg = 0x91,\r
202 DBG_OP_bregx = 0x92,\r
203 DBG_OP_piece = 0x93,\r
204 DBG_OP_deref_size = 0x94,\r
205 DBG_OP_xderef_size = 0x95,\r
206 DBG_OP_nop = 0x96,\r
207 DBG_OP_push_object_address = 0x97, /* DWARF3 */\r
208 DBG_OP_call2 = 0x98, /* DWARF3 */\r
209 DBG_OP_call4 = 0x99, /* DWARF3 */\r
210 DBG_OP_call_ref = 0x9a, /* DWARF3 */\r
211 DBG_OP_form_tls_address = 0x9b, /* DWARF3f */\r
212 DBG_OP_call_frame_cfa = 0x9c, /* DWARF3f */\r
213 DBG_OP_bit_piece = 0x9d, /* DWARF3f */\r
214 DBG_OP_implicit_value = 0x9e, /* DWARF4 */\r
215 DBG_OP_stack_value = 0x9f, /* DWARF4 */\r
216 DBG_END_OP\r
217}\r
218DBGOP;\r
219\r
2d0121d4
JPM
220\r
221//\r
222extern void DBGManager_Init(void);\r
223extern void DBGManager_SetType(size_t DBGTypeSet);\r
224extern void DBGManager_Reset(void);\r
225extern void DBGManager_Close(void);\r
226\r
227//\r
0203b5fd 228extern char *DBGManager_GetSymbolNameFromAdr(size_t Adr);\r
2d0121d4
JPM
229extern char *DBGManager_GetFullSourceFilenameFromAdr(size_t Adr, bool *Error);\r
230extern size_t DBGManager_GetNumLineFromAdr(size_t Adr, size_t Tag);\r
231extern char *DBGManager_GetLineSrcFromAdr(size_t Adr, size_t Tag);\r
232extern char *DBGManager_GetLineSrcFromAdrNumLine(size_t Adr, size_t NumLine);\r
233extern char *DBGManager_GetLineSrcFromNumLineBaseAdr(size_t Adr, size_t NumLine);\r
2d0121d4 234extern size_t DBGManager_GetAdrFromSymbolName(char *SymbolName);\r
0203b5fd
JPM
235extern char *DBGManager_GetFunctionName(size_t Adr);\r
236extern char *DBGManager_GetVariableValueFromAdr(size_t Adr, size_t TypeEncoding, size_t TypeByteSize);\r
237\r
238// Global variables manager\r
239extern size_t DBGManager_GetNbGlobalVariables(void);\r
240extern char *DBGManager_GetGlobalVariableName(size_t Index);\r
241extern size_t DBGManager_GetGlobalVariableTypeEncoding(size_t Index);\r
242extern char *DBGManager_GetGlobalVariableTypeName(size_t Index);\r
243extern size_t DBGManager_GetGlobalVariableTypeByteSize(size_t Index);\r
244extern size_t DBGManager_GetGlobalVariableAdr(size_t Index);\r
245extern size_t DBGManager_GetGlobalVariableAdrFromName(char *VariableName);\r
246extern char *DBGManager_GetGlobalVariableValue(size_t Index);\r
247extern size_t DBGManager_GetGlobalVariableTypeTag(size_t Index);\r
248\r
249// Local variables manager\r
250extern size_t DBGManager_GetNbLocalVariables(size_t Adr);\r
251extern char *DBGManager_GetLocalVariableName(size_t Adr, size_t Index);\r
252extern size_t DBGManager_GetLocalVariableTypeEncoding(size_t Adr, size_t Index);\r
253extern char *DBGManager_GetLocalVariableTypeName(size_t Adr, size_t Index);\r
254extern size_t DBGManager_GetLocalVariableTypeByteSize(size_t Adr, size_t Index);\r
255extern size_t DBGManager_GetLocalVariableTypeTag(size_t Adr, size_t Index);\r
256extern size_t DBGManager_GetLocalVariableOp(size_t Adr, size_t Index);\r
257extern int DBGManager_GetLocalVariableOffset(size_t Adr, size_t Index);\r
2d0121d4
JPM
258\r
259\r
260#endif // __DBGMANAGER_H__\r