From 9186e23d5a959e528876dc4f56bcdb88e14285d2 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sun, 26 Jun 2011 16:22:45 +0000 Subject: [PATCH] Rearrange _HandleSourceCodeChanged() a bit so it correctly handles updating the current source path when changing frames in all cases. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42322 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../gui/team_window/TeamWindow.cpp | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp index 087a4acafc..b1967e37e4 100644 --- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp @@ -1006,26 +1006,27 @@ TeamWindow::_HandleSourceCodeChanged() AutoLocker< ::Team> locker(fTeam); SourceCode* sourceCode = fActiveFunction->GetFunction()->GetSourceCode(); - if (sourceCode == NULL) { + LocatableFile* sourceFile = NULL; + BString sourceText; + if (sourceCode == NULL) sourceCode = fActiveFunction->GetSourceCode(); - BString sourceText; - LocatableFile* sourceFile = fActiveFunction->GetFunctionDebugInfo() - ->SourceFile(); - if (sourceFile != NULL && !sourceFile->GetLocatedPath(sourceText)) - sourceFile->GetPath(sourceText); + if (sourceCode != NULL) + sourceFile = fActiveFunction->GetFunctionDebugInfo()->SourceFile(); - if (sourceCode != NULL && sourceCode->GetSourceFile() == NULL - && sourceFile != NULL) { - sourceText.Prepend("Click to locate source file '"); - sourceText += "'"; - fSourcePathView->SetText(sourceText.String()); - } else if (sourceFile != NULL) { - sourceText.Prepend("File: "); - fSourcePathView->SetText(sourceText.String()); - } else - fSourcePathView->SetText("Source file unavailable."); - } + if (sourceFile != NULL && !sourceFile->GetLocatedPath(sourceText)) + sourceFile->GetPath(sourceText); + + if (sourceCode != NULL && sourceCode->GetSourceFile() == NULL + && sourceFile != NULL) { + sourceText.Prepend("Click to locate source file '"); + sourceText += "'"; + fSourcePathView->SetText(sourceText.String()); + } else if (sourceFile != NULL) { + sourceText.Prepend("File: "); + fSourcePathView->SetText(sourceText.String()); + } else + fSourcePathView->SetText("Source file unavailable."); BReference sourceCodeReference(sourceCode);