Make the processor automatically generate any ungenerated functions when installing a breakpoint.

This commit is contained in:
Dr. Chat 2015-12-06 18:20:12 -06:00 committed by Ben Vanik
parent 5ef21d3714
commit 0f82e0d090
1 changed files with 9 additions and 0 deletions

View File

@ -420,6 +420,15 @@ bool Processor::InstallBreakpoint(Breakpoint* bp) {
return false; return false;
} }
auto functions = FindFunctionsWithAddress(bp->address());
if (functions.empty()) {
// Go ahead and generate a function.
if (!ResolveFunction(bp->address())) {
// Could not generate a function - fail!
return false;
}
}
// We need to register the breakpoint before installing it with the backend // We need to register the breakpoint before installing it with the backend
// in-case a thread hits it while we're here. // in-case a thread hits it while we're here.
breakpoints_.push_back(bp); breakpoints_.push_back(bp);