Extend FunctionSourceCodeRequested().

Now takes an optional boolean parameter to indicate that disassembly is
explicitly being requested. Adjust TeamDebugger and LoadSourceCodeJob's
implementations accordingly.
This commit is contained in:
Rene Gollent
2013-06-22 15:48:17 -04:00
parent 26a4510e59
commit 442f71a7d9
4 changed files with 25 additions and 6 deletions
@@ -762,22 +762,27 @@ TeamDebugger::SourceEntryLocateRequested(const char* sourcePath,
void
TeamDebugger::FunctionSourceCodeRequested(FunctionInstance* functionInstance)
TeamDebugger::FunctionSourceCodeRequested(FunctionInstance* functionInstance,
bool forceDisassembly)
{
Function* function = functionInstance->GetFunction();
// mark loading
AutoLocker< ::Team> locker(fTeam);
if (functionInstance->SourceCodeState() != FUNCTION_SOURCE_NOT_LOADED)
if (forceDisassembly && functionInstance->SourceCodeState()
!= FUNCTION_SOURCE_NOT_LOADED) {
return;
if (function->SourceCodeState() == FUNCTION_SOURCE_LOADED)
} else if (!forceDisassembly && function->SourceCodeState()
== FUNCTION_SOURCE_LOADED) {
return;
}
functionInstance->SetSourceCode(NULL, FUNCTION_SOURCE_LOADING);
bool loadForFunction = false;
if (function->SourceCodeState() == FUNCTION_SOURCE_NOT_LOADED) {
if (!forceDisassembly && function->SourceCodeState()
== FUNCTION_SOURCE_NOT_LOADED) {
loadForFunction = true;
function->SetSourceCode(NULL, FUNCTION_SOURCE_LOADING);
}