Processor breakpoint support

This commit is contained in:
Dr. Chat
2015-11-25 21:35:05 -06:00
committed by Ben Vanik
parent 5019f1aa98
commit e383e2f101
7 changed files with 269 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2015 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include "xenia/cpu/breakpoint.h"
#include "xenia/cpu/backend/backend.h"
namespace xe {
namespace cpu {
Breakpoint::Breakpoint(Processor* processor, uint32_t address,
std::function<void(uint32_t, uint64_t)> hit_callback)
: processor_(processor), address_(address), hit_callback_(hit_callback) {}
Breakpoint::~Breakpoint() { assert_false(installed_); }
bool Breakpoint::Install() {
assert_false(installed_);
installed_ = processor_->InstallBreakpoint(this);
return installed_;
}
bool Breakpoint::Uninstall() {
assert_true(installed_);
installed_ = !processor_->UninstallBreakpoint(this);
return !installed_;
}
} // namespace cpu
} // namespace xe