64 typedef void* (*decode_func)(void* start_va, void* end_va, 65 void* (*event_callback)(void*, const char*, void*), 66 void* event_stream, 67 int (*printf_callback)(void*, const char*, ...), 68 void* printf_stream, 69 const char* options); 70 // points to the library. 71 static void* _library; 72 // bailout 73 static bool _tried_to_load_library; 74 // points to the decode function. 75 static decode_func_virtual _decode_instructions_virtual; 76 static decode_func _decode_instructions; 77 // tries to load library and return whether it succedded. 78 static bool load_library(); 79 80 // Machine dependent stuff 81 #ifdef TARGET_ARCH_x86 82 # include "disassembler_x86.hpp" 83 #endif 84 #ifdef TARGET_ARCH_sparc 85 # include "disassembler_sparc.hpp" 86 #endif 87 #ifdef TARGET_ARCH_zero 88 # include "disassembler_zero.hpp" 89 #endif 90 #ifdef TARGET_ARCH_arm 91 # include "disassembler_arm.hpp" 92 #endif 93 #ifdef TARGET_ARCH_ppc 94 # include "disassembler_ppc.hpp" 95 #endif 96 97 98 public: 99 static bool can_decode() { 100 return (_decode_instructions_virtual != NULL) || 101 (_decode_instructions != NULL) || 102 load_library(); 103 } | 64 typedef void* (*decode_func)(void* start_va, void* end_va, 65 void* (*event_callback)(void*, const char*, void*), 66 void* event_stream, 67 int (*printf_callback)(void*, const char*, ...), 68 void* printf_stream, 69 const char* options); 70 // points to the library. 71 static void* _library; 72 // bailout 73 static bool _tried_to_load_library; 74 // points to the decode function. 75 static decode_func_virtual _decode_instructions_virtual; 76 static decode_func _decode_instructions; 77 // tries to load library and return whether it succedded. 78 static bool load_library(); 79 80 // Machine dependent stuff 81 #ifdef TARGET_ARCH_x86 82 # include "disassembler_x86.hpp" 83 #endif 84 #ifdef TARGET_ARCH_aarch64 85 # include "disassembler_aarch64.hpp" 86 #endif 87 #ifdef TARGET_ARCH_sparc 88 # include "disassembler_sparc.hpp" 89 #endif 90 #ifdef TARGET_ARCH_zero 91 # include "disassembler_zero.hpp" 92 #endif 93 #ifdef TARGET_ARCH_arm 94 # include "disassembler_arm.hpp" 95 #endif 96 #ifdef TARGET_ARCH_ppc 97 # include "disassembler_ppc.hpp" 98 #endif 99 100 101 public: 102 static bool can_decode() { 103 return (_decode_instructions_virtual != NULL) || 104 (_decode_instructions != NULL) || 105 load_library(); 106 } |