A new debugger.

Lots of bugs/rough edges/etc - issues will be filed.
Old-style debugging still works (just use --emit_source_annotations to get
the helpful movs back and --break_on_instruction will still fire).
This commit is contained in:
Ben Vanik
2015-09-20 21:31:05 -07:00
parent 8046c19898
commit 5d033f9cb3
90 changed files with 4183 additions and 4651 deletions

View File

@@ -16,8 +16,6 @@
namespace xe {
namespace cpu {
using xe::debug::Breakpoint;
Function::Function(Module* module, uint32_t address)
: Symbol(Symbol::Type::kFunction, module, address) {}
@@ -100,6 +98,18 @@ const SourceMapEntry* GuestFunction::LookupCodeOffset(uint32_t offset) const {
return source_map_.empty() ? nullptr : &source_map_[0];
}
uintptr_t GuestFunction::MapSourceToCode(uint32_t source_address) const {
auto entry = LookupSourceOffset(source_address - address());
return entry ? entry->code_offset
: reinterpret_cast<uintptr_t>(machine_code());
}
uint32_t GuestFunction::MapCodeToSource(uintptr_t host_address) const {
auto entry = LookupCodeOffset(static_cast<uint32_t>(
host_address - reinterpret_cast<uintptr_t>(machine_code())));
return entry ? entry->source_offset : address();
}
bool GuestFunction::Call(ThreadState* thread_state, uint32_t return_address) {
// SCOPE_profile_cpu_f("cpu");