// The disassembler prints out assembly code annotated // with Java specific information.
// Disassembler inherits from AbstractDisassembler class Disassembler : public AbstractDisassembler { friendclass decode_env; private: // this is the type of the dll entry point: typedefvoid* (*decode_func_virtual)(uintptr_t start_va, uintptr_t end_va, unsignedchar* buffer, uintptr_t length, void* (*event_callback)(void*, constchar*, void*), void* event_stream, int (*printf_callback)(void*, constchar*, ...), void* printf_stream, constchar* options, int newline); // points to the library. staticvoid* _library; // bailout staticbool _tried_to_load_library; staticbool _library_usable; // points to the decode function. static decode_func_virtual _decode_instructions_virtual;
// tries to load library and return whether it succeeded. // Allow (diagnostic) output redirection. // No output at all if stream is NULL. Can be overridden // with -Verbose flag, in which case output goes to tty. staticbool load_library(outputStream* st = NULL); staticvoid* dll_load(char* buf, int buflen, int offset, char* ebuf, int ebuflen, outputStream* st);
// Check if the two addresses are on the same page. staticbool is_same_page(address a1, address a2) { return (((uintptr_t)a1 ^ (uintptr_t)a2) & (~0x0fffUL)) == 0L;
}
public: // We can always decode code blobs. // Either we have a disassembler library available (successfully loaded) // or we will resort to the abstract disassembler. This method informs // about which decoding format is used. // We can also enforce using the abstract disassembler. staticbool is_abstract() { if (!_tried_to_load_library) {
load_library();
} return ! _library_usable;
}
// Check out if we are doing a live disassembly or a post-mortem // disassembly where the binary data was loaded from a hs_err file. staticbool is_decode_error_file() { // Activate once post-mortem disassembly (from hs-err file) is available. #if0 return DecodeErrorFile && (strlen(DecodeErrorFile) != 0); #else returnfalse; #endif
}
staticvoid _hook(constchar* file, int line, class MacroAssembler* masm);
// This functions makes it easy to generate comments in the generated // interpreter code, by riding on the customary __ macro in the interpreter generator. // See templateTable_x86.cpp for an example. template<class T> inlinestatic T* hook(constchar* file, int line, T* masm) { if (PrintInterpreter) {
_hook(file, line, masm);
} return masm;
}
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.