* ThreadHandler::_ClearContinuationState(): Forgot to set fStepStatement to

NULL after releasing its reference, so it could be released again later.
* No longer attach the source code to StackFrame, but rather to
  FunctionDebugInfo. Besides being the more obvious place it also prevents
  un-/reloading the source code when stepping. Only disadvantage is that we
  never unload the source again yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31256 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-06-26 15:11:56 +00:00
parent 66ae5b2d99
commit 6fb6551c97
14 changed files with 228 additions and 161 deletions
+10 -9
View File
@@ -362,9 +362,13 @@ ThreadHandler::_GetStatementAtInstructionPointer(StackFrame* frame)
{
AutoLocker<TeamDebugModel> locker(fDebugModel);
// If there's source code attached to the stack frame, we can just get the
FunctionDebugInfo* function = frame->Function();
if (function == NULL)
return NULL;
// If there's source code attached to the function, we can just get the
// statement.
SourceCode* sourceCode = frame->GetSourceCode();
SourceCode* sourceCode = function->GetSourceCode();
if (sourceCode != NULL) {
Statement* statement = sourceCode->StatementAtAddress(
frame->InstructionPointer());
@@ -375,12 +379,7 @@ ThreadHandler::_GetStatementAtInstructionPointer(StackFrame* frame)
locker.Unlock();
// We need to get the statement from the debug info of the function (if
// any).
FunctionDebugInfo* function = frame->Function();
if (function == NULL)
return NULL;
// We need to get the statement from the debug info of the function.
Statement* statement;
if (function->GetDebugInfo()->GetStatement(function,
frame->InstructionPointer(), statement) != B_OK) {
@@ -456,8 +455,10 @@ ThreadHandler::_ClearContinuationState()
{
_UninstallTemporaryBreakpoint();
if (fStepStatement != NULL)
if (fStepStatement != NULL) {
fStepStatement->RemoveReference();
fStepStatement = NULL;
}
fStepMode = STEP_NONE;
fSingleStepping = false;