Debugger: Fix oversight.

DebugReportGenerator:
- In the case where the function was already disassembled beforehand,
  we weren't retrieving the statement, leading to a null pointer
  dereference.
This commit is contained in:
Rene Gollent 2016-12-11 11:08:17 -05:00
parent 40044981eb
commit c5dcedecae

View File

@ -701,10 +701,18 @@ DebugReportGenerator::_DumpFunctionDisassembly(BFile& _output,
}
codeReference.SetTo(code, true);
statement = code->StatementAtAddress(instructionPointer);
} else
codeReference.SetTo(code);
statement = code->StatementAtAddress(instructionPointer);
if (statement == NULL) {
data.SetToFormat("\t\t\tUnable to retrieve disassembly for IP %#"
B_PRIx64 ": address does not map to a valid instruction.\n",
instructionPointer);
WRITE_AND_CHECK(_output, data);
return B_OK;
}
SourceLocation location = statement->StartSourceLocation();
data = "\t\t\tDisassembly:\n";