From 0f82e0d090a249a171ac276fd3ec1623b8ce5306 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Sun, 6 Dec 2015 18:20:12 -0600 Subject: [PATCH] Make the processor automatically generate any ungenerated functions when installing a breakpoint. --- src/xenia/cpu/processor.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/xenia/cpu/processor.cc b/src/xenia/cpu/processor.cc index cb2cfef6e..2cde61ac0 100644 --- a/src/xenia/cpu/processor.cc +++ b/src/xenia/cpu/processor.cc @@ -420,6 +420,15 @@ bool Processor::InstallBreakpoint(Breakpoint* bp) { 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 // in-case a thread hits it while we're here. breakpoints_.push_back(bp);