Automatically install any CPU breakpoints in any newly-defined functions if necessary.

This commit is contained in:
Dr. Chat
2015-11-27 23:00:38 -06:00
committed by Ben Vanik
parent d09e3b7953
commit 41d5b41523
6 changed files with 51 additions and 3 deletions

View File

@@ -274,6 +274,8 @@ bool Processor::DemandFunction(Function* function) {
debugger_->OnFunctionDefined(function);
}
BreakpointFunctionDefined(function);
function->set_status(Symbol::Status::kDefined);
symbol_status = function->status();
}
@@ -402,6 +404,16 @@ void Processor::LowerIrql(Irql old_value) {
reinterpret_cast<volatile uint32_t*>(&irql_));
}
void Processor::BreakpointFunctionDefined(Function* function) {
std::lock_guard<std::recursive_mutex> lock(breakpoint_lock_);
for (auto it = breakpoints_.begin(); it != breakpoints_.end(); it++) {
if (function->ContainsAddress((*it)->address())) {
backend_->InstallBreakpoint(*it, function);
}
}
}
bool Processor::InstallBreakpoint(Breakpoint* bp) {
std::lock_guard<std::recursive_mutex> lock(breakpoint_lock_);