Added search paths in case of missing DWARF directories information
[clinton/Virtual-Jaguar-Rx.git] / src / debugger / DBGManager.h
index 87e0900..bf0181b 100644 (file)
@@ -23,6 +23,18 @@ typedef enum {
        DBG_END_TAG\r
 }DBGTAG;\r
 \r
        DBG_END_TAG\r
 }DBGTAG;\r
 \r
+//\r
+typedef enum {\r
+       DBG_TAG_TYPE_structure = 0x1,                                   // structure\r
+       DBG_TAG_TYPE_pointer = 0x2,                                             // pointer\r
+       DBG_TAG_TYPE_subrange = 0x4,                                    // (subrange_type?)\r
+       DBG_TAG_TYPE_array = 0x8,                                               // array type\r
+       DBG_TAG_TYPE_const = 0x10,                                              // const type\r
+       DBG_TAG_TYPE_typedef = 0x20,                                    // typedef\r
+       DBG_TAG_TYPE_enumeration_type = 0x40,                   // enumeration\r
+       DBG_TAG_TYPE_subroutine_type = 0x80                             // subroutine\r
+}DBGTAGTYPE;\r
+\r
 // Encoding based in the DW_ATE_... list from the dwarf.h\r
 // Except for the DBG_ATE_ptr\r
 typedef enum {\r
 // Encoding based in the DW_ATE_... list from the dwarf.h\r
 // Except for the DBG_ATE_ptr\r
 typedef enum {\r
@@ -46,32 +58,215 @@ typedef enum {
        DBG_END_TYPEENCODING\r
 }DBGTYPEENCODING;\r
 \r
        DBG_END_TYPEENCODING\r
 }DBGTYPEENCODING;\r
 \r
+// Encoding based in the DW_OP_... list from the dwarf.h\r
+typedef enum {\r
+       DBG_NO_OP,\r
+       DBG_OP_addr = 0x03,\r
+       DBG_OP_deref = 0x06,\r
+       DBG_OP_const1u = 0x08,\r
+       DBG_OP_const1s = 0x09,\r
+       DBG_OP_const2u = 0x0a,\r
+       DBG_OP_const2s = 0x0b,\r
+       DBG_OP_const4u = 0x0c,\r
+       DBG_OP_const4s = 0x0d,\r
+       DBG_OP_const8u = 0x0e,\r
+       DBG_OP_const8s = 0x0f,\r
+       DBG_OP_constu = 0x10,\r
+       DBG_OP_consts = 0x11,\r
+       DBG_OP_dup = 0x12,\r
+       DBG_OP_drop = 0x13,\r
+       DBG_OP_over = 0x14,\r
+       DBG_OP_pick = 0x15,\r
+       DBG_OP_swap = 0x16,\r
+       DBG_OP_rot = 0x17,\r
+       DBG_OP_xderef = 0x18,\r
+       DBG_OP_abs = 0x19,\r
+       DBG_OP_and = 0x1a,\r
+       DBG_OP_div = 0x1b,\r
+       DBG_OP_minus = 0x1c,\r
+       DBG_OP_mod = 0x1d,\r
+       DBG_OP_mul = 0x1e,\r
+       DBG_OP_neg = 0x1f,\r
+       DBG_OP_not = 0x20,\r
+       DBG_OP_or = 0x21,\r
+       DBG_OP_plus = 0x22,\r
+       DBG_OP_plus_uconst = 0x23,\r
+       DBG_OP_shl = 0x24,\r
+       DBG_OP_shr = 0x25,\r
+       DBG_OP_shra = 0x26,\r
+       DBG_OP_xor = 0x27,\r
+       DBG_OP_bra = 0x28,\r
+       DBG_OP_eq = 0x29,\r
+       DBG_OP_ge = 0x2a,\r
+       DBG_OP_gt = 0x2b,\r
+       DBG_OP_le = 0x2c,\r
+       DBG_OP_lt = 0x2d,\r
+       DBG_OP_ne = 0x2e,\r
+       DBG_OP_skip = 0x2f,\r
+       DBG_OP_lit0 = 0x30,\r
+       DBG_OP_lit1 = 0x31,\r
+       DBG_OP_lit2 = 0x32,\r
+       DBG_OP_lit3 = 0x33,\r
+       DBG_OP_lit4 = 0x34,\r
+       DBG_OP_lit5 = 0x35,\r
+       DBG_OP_lit6 = 0x36,\r
+       DBG_OP_lit7 = 0x37,\r
+       DBG_OP_lit8 = 0x38,\r
+       DBG_OP_lit9 = 0x39,\r
+       DBG_OP_lit10 = 0x3a,\r
+       DBG_OP_lit11 = 0x3b,\r
+       DBG_OP_lit12 = 0x3c,\r
+       DBG_OP_lit13 = 0x3d,\r
+       DBG_OP_lit14 = 0x3e,\r
+       DBG_OP_lit15 = 0x3f,\r
+       DBG_OP_lit16 = 0x40,\r
+       DBG_OP_lit17 = 0x41,\r
+       DBG_OP_lit18 = 0x42,\r
+       DBG_OP_lit19 = 0x43,\r
+       DBG_OP_lit20 = 0x44,\r
+       DBG_OP_lit21 = 0x45,\r
+       DBG_OP_lit22 = 0x46,\r
+       DBG_OP_lit23 = 0x47,\r
+       DBG_OP_lit24 = 0x48,\r
+       DBG_OP_lit25 = 0x49,\r
+       DBG_OP_lit26 = 0x4a,\r
+       DBG_OP_lit27 = 0x4b,\r
+       DBG_OP_lit28 = 0x4c,\r
+       DBG_OP_lit29 = 0x4d,\r
+       DBG_OP_lit30 = 0x4e,\r
+       DBG_OP_lit31 = 0x4f,\r
+       DBG_OP_reg0 = 0x50,\r
+       DBG_OP_reg1 = 0x51,\r
+       DBG_OP_reg2 = 0x52,\r
+       DBG_OP_reg3 = 0x53,\r
+       DBG_OP_reg4 = 0x54,\r
+       DBG_OP_reg5 = 0x55,\r
+       DBG_OP_reg6 = 0x56,\r
+       DBG_OP_reg7 = 0x57,\r
+       DBG_OP_reg8 = 0x58,\r
+       DBG_OP_reg9 = 0x59,\r
+       DBG_OP_reg10 = 0x5a,\r
+       DBG_OP_reg11 = 0x5b,\r
+       DBG_OP_reg12 = 0x5c,\r
+       DBG_OP_reg13 = 0x5d,\r
+       DBG_OP_reg14 = 0x5e,\r
+       DBG_OP_reg15 = 0x5f,\r
+       DBG_OP_reg16 = 0x60,\r
+       DBG_OP_reg17 = 0x61,\r
+       DBG_OP_reg18 = 0x62,\r
+       DBG_OP_reg19 = 0x63,\r
+       DBG_OP_reg20 = 0x64,\r
+       DBG_OP_reg21 = 0x65,\r
+       DBG_OP_reg22 = 0x66,\r
+       DBG_OP_reg23 = 0x67,\r
+       DBG_OP_reg24 = 0x68,\r
+       DBG_OP_reg25 = 0x69,\r
+       DBG_OP_reg26 = 0x6a,\r
+       DBG_OP_reg27 = 0x6b,\r
+       DBG_OP_reg28 = 0x6c,\r
+       DBG_OP_reg29 = 0x6d,\r
+       DBG_OP_reg30 = 0x6e,\r
+       DBG_OP_reg31 = 0x6f,\r
+       DBG_OP_breg0 = 0x70,\r
+       DBG_OP_breg1 = 0x71,\r
+       DBG_OP_breg2 = 0x72,\r
+       DBG_OP_breg3 = 0x73,\r
+       DBG_OP_breg4 = 0x74,\r
+       DBG_OP_breg5 = 0x75,\r
+       DBG_OP_breg6 = 0x76,\r
+       DBG_OP_breg7 = 0x77,\r
+       DBG_OP_breg8 = 0x78,\r
+       DBG_OP_breg9 = 0x79,\r
+       DBG_OP_breg10 = 0x7a,\r
+       DBG_OP_breg11 = 0x7b,\r
+       DBG_OP_breg12 = 0x7c,\r
+       DBG_OP_breg13 = 0x7d,\r
+       DBG_OP_breg14 = 0x7e,\r
+       DBG_OP_breg15 = 0x7f,\r
+       DBG_OP_breg16 = 0x80,\r
+       DBG_OP_breg17 = 0x81,\r
+       DBG_OP_breg18 = 0x82,\r
+       DBG_OP_breg19 = 0x83,\r
+       DBG_OP_breg20 = 0x84,\r
+       DBG_OP_breg21 = 0x85,\r
+       DBG_OP_breg22 = 0x86,\r
+       DBG_OP_breg23 = 0x87,\r
+       DBG_OP_breg24 = 0x88,\r
+       DBG_OP_breg25 = 0x89,\r
+       DBG_OP_breg26 = 0x8a,\r
+       DBG_OP_breg27 = 0x8b,\r
+       DBG_OP_breg28 = 0x8c,\r
+       DBG_OP_breg29 = 0x8d,\r
+       DBG_OP_breg30 = 0x8e,\r
+       DBG_OP_breg31 = 0x8f,\r
+       DBG_OP_regx = 0x90,\r
+       DBG_OP_fbreg = 0x91,\r
+       DBG_OP_bregx = 0x92,\r
+       DBG_OP_piece = 0x93,\r
+       DBG_OP_deref_size = 0x94,\r
+       DBG_OP_xderef_size = 0x95,\r
+       DBG_OP_nop = 0x96,\r
+       DBG_OP_push_object_address = 0x97,              /* DWARF3 */\r
+       DBG_OP_call2 = 0x98,                                    /* DWARF3 */\r
+       DBG_OP_call4 = 0x99,                                    /* DWARF3 */\r
+       DBG_OP_call_ref = 0x9a,                                 /* DWARF3 */\r
+       DBG_OP_form_tls_address = 0x9b,                 /* DWARF3f */\r
+       DBG_OP_call_frame_cfa = 0x9c,                   /* DWARF3f */\r
+       DBG_OP_bit_piece = 0x9d,                                /* DWARF3f */\r
+       DBG_OP_implicit_value = 0x9e,                   /* DWARF4 */\r
+       DBG_OP_stack_value = 0x9f,                              /* DWARF4 */\r
+       DBG_END_OP\r
+}\r
+DBGOP;\r
 \r
 \r
-//\r
+\r
+// Internal manager\r
 extern void    DBGManager_Init(void);\r
 extern void    DBGManager_SetType(size_t DBGTypeSet);\r
 extern void    DBGManager_Init(void);\r
 extern void    DBGManager_SetType(size_t DBGTypeSet);\r
+extern size_t DBGManager_GetType(void);\r
 extern void    DBGManager_Reset(void);\r
 extern void    DBGManager_Close(void);\r
 extern void    DBGManager_Reset(void);\r
 extern void    DBGManager_Close(void);\r
+extern void DBGManager_SourceFileSearchPathsSet(char *ListPaths);\r
 \r
 \r
-//\r
-extern char    *DBGManager_GetSymbolnameFromAdr(size_t Adr);\r
-extern char    *DBGManager_GetFullSourceFilenameFromAdr(size_t Adr, bool *Error);\r
+// Source text lines manager\r
 extern size_t DBGManager_GetNumLineFromAdr(size_t Adr, size_t Tag);\r
 extern char *DBGManager_GetLineSrcFromAdr(size_t Adr, size_t Tag);\r
 extern char *DBGManager_GetLineSrcFromAdrNumLine(size_t Adr, size_t NumLine);\r
 extern char *DBGManager_GetLineSrcFromNumLineBaseAdr(size_t Adr, size_t NumLine);\r
 \r
 extern size_t DBGManager_GetNumLineFromAdr(size_t Adr, size_t Tag);\r
 extern char *DBGManager_GetLineSrcFromAdr(size_t Adr, size_t Tag);\r
 extern char *DBGManager_GetLineSrcFromAdrNumLine(size_t Adr, size_t NumLine);\r
 extern char *DBGManager_GetLineSrcFromNumLineBaseAdr(size_t Adr, size_t NumLine);\r
 \r
-// External variables manager\r
-extern size_t DBGManager_GetNbExternalVariables(void);\r
-extern char *DBGManager_GetExternalVariableName(size_t Index);\r
-extern size_t DBGManager_GetExternalVariableTypeEncoding(size_t Index);\r
-extern char *DBGManager_GetExternalVariableTypeName(size_t Index);\r
-extern size_t DBGManager_GetExternalVariableTypeByteSize(size_t Index);\r
-extern size_t DBGManager_GetExternalVariableAdr(size_t Index);\r
-extern size_t DBGManager_GetExternalVariableAdrFromName(char *VariableName);\r
+// General manager\r
+extern char *DBGManager_GetFunctionName(size_t Adr);\r
+extern char *DBGManager_GetVariableValueFromAdr(size_t Adr, size_t TypeEncoding, size_t TypeByteSize);\r
+\r
+// Symbols manager\r
+extern char    *DBGManager_GetSymbolNameFromAdr(size_t Adr);\r
 extern size_t DBGManager_GetAdrFromSymbolName(char *SymbolName);\r
 extern size_t DBGManager_GetAdrFromSymbolName(char *SymbolName);\r
-extern char *DBGManager_GetExternalVariableValue(size_t Index);\r
-extern size_t DBGManager_GetExternalVariableTypeTag(size_t Index);\r
+\r
+// Source text files manager\r
+extern char    *DBGManager_GetFullSourceFilenameFromAdr(size_t Adr, bool *Error);\r
+extern size_t DBGManager_GetNbFullSourceFilename(void);\r
+extern char *DBGManager_GetNumFullSourceFilename(size_t Index);\r
+\r
+// Global variables manager\r
+extern size_t DBGManager_GetNbGlobalVariables(void);\r
+extern char *DBGManager_GetGlobalVariableName(size_t Index);\r
+extern size_t DBGManager_GetGlobalVariableTypeEncoding(size_t Index);\r
+extern char *DBGManager_GetGlobalVariableTypeName(size_t Index);\r
+extern size_t DBGManager_GetGlobalVariableTypeByteSize(size_t Index);\r
+extern size_t DBGManager_GetGlobalVariableAdr(size_t Index);\r
+extern size_t DBGManager_GetGlobalVariableAdrFromName(char *VariableName);\r
+extern char *DBGManager_GetGlobalVariableValue(size_t Index);\r
+extern size_t DBGManager_GetGlobalVariableTypeTag(size_t Index);\r
+\r
+// Local variables manager\r
+extern size_t DBGManager_GetNbLocalVariables(size_t Adr);\r
+extern char *DBGManager_GetLocalVariableName(size_t Adr, size_t Index);\r
+extern size_t DBGManager_GetLocalVariableTypeEncoding(size_t Adr, size_t Index);\r
+extern char *DBGManager_GetLocalVariableTypeName(size_t Adr, size_t Index);\r
+extern size_t DBGManager_GetLocalVariableTypeByteSize(size_t Adr, size_t Index);\r
+extern size_t DBGManager_GetLocalVariableTypeTag(size_t Adr, size_t Index);\r
+extern size_t DBGManager_GetLocalVariableOp(size_t Adr, size_t Index);\r
+extern int DBGManager_GetLocalVariableOffset(size_t Adr, size_t Index);\r
 \r
 \r
 #endif // __DBGMANAGER_H__\r
 \r
 \r
 #endif // __DBGMANAGER_H__\r