Merge branch 'debugger'

This commit is contained in:
Rene Gollent 2011-11-13 20:23:53 -05:00
commit 56f0b3baa9
3 changed files with 32 additions and 19 deletions

View File

@ -1,5 +1,6 @@
/* /*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2011, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@ -152,7 +153,7 @@ public:
// parent already located -- locate the entry in the parent // parent already located -- locate the entry in the parent
BString locatedDirectoryPath; BString locatedDirectoryPath;
if (directory->GetLocatedPath(locatedDirectoryPath)) if (directory->GetLocatedPath(locatedDirectoryPath))
_LocateEntryInParentDir(file, locatedDirectoryPath); _LocateEntryInParentDir(file, locatedDirectoryPath, true);
} }
} }
@ -200,17 +201,17 @@ private:
} }
bool _LocateDirectory(LocatableDirectory* directory, bool _LocateDirectory(LocatableDirectory* directory,
const BString& locatedPath) const BString& locatedPath, bool implicit)
{ {
if (directory == NULL if (directory == NULL
|| directory->State() != LOCATABLE_ENTRY_UNLOCATED) { || directory->State() != LOCATABLE_ENTRY_UNLOCATED) {
return false; return false;
} }
if (!_LocateEntry(directory, locatedPath, true, true)) if (!_LocateEntry(directory, locatedPath, implicit, true))
return false; return false;
_LocateEntries(directory, locatedPath); _LocateEntries(directory, locatedPath, implicit);
return true; return true;
} }
@ -244,14 +245,14 @@ private:
BString locatedName; BString locatedName;
_SplitPath(locatedPath, locatedDirectory, locatedName); _SplitPath(locatedPath, locatedDirectory, locatedName);
if (locatedName == entry->Name()) if (locatedName == entry->Name())
_LocateDirectory(entry->Parent(), locatedDirectory); _LocateDirectory(entry->Parent(), locatedDirectory, implicit);
} }
return true; return true;
} }
bool _LocateEntryInParentDir(LocatableEntry* entry, bool _LocateEntryInParentDir(LocatableEntry* entry,
const BString& locatedDirectoryPath) const BString& locatedDirectoryPath, bool implicit)
{ {
// construct the located entry path // construct the located entry path
BString locatedEntryPath(locatedDirectoryPath); BString locatedEntryPath(locatedDirectoryPath);
@ -260,11 +261,11 @@ private:
locatedEntryPath << '/'; locatedEntryPath << '/';
locatedEntryPath << entry->Name(); locatedEntryPath << entry->Name();
return _LocateEntry(entry, locatedEntryPath, true, false); return _LocateEntry(entry, locatedEntryPath, implicit, false);
} }
void _LocateEntries(LocatableDirectory* directory, void _LocateEntries(LocatableDirectory* directory,
const BString& locatedPath) const BString& locatedPath, bool implicit)
{ {
for (LocatableEntryList::ConstIterator it for (LocatableEntryList::ConstIterator it
= directory->Entries().GetIterator(); = directory->Entries().GetIterator();
@ -272,13 +273,13 @@ private:
if (entry->State() == LOCATABLE_ENTRY_LOCATED_EXPLICITLY) if (entry->State() == LOCATABLE_ENTRY_LOCATED_EXPLICITLY)
continue; continue;
if (_LocateEntryInParentDir(entry, locatedPath)) { if (_LocateEntryInParentDir(entry, locatedPath, implicit)) {
// recurse for directories // recurse for directories
if (LocatableDirectory* subDir if (LocatableDirectory* subDir
= dynamic_cast<LocatableDirectory*>(entry)) { = dynamic_cast<LocatableDirectory*>(entry)) {
BString locatedEntryPath; BString locatedEntryPath;
if (subDir->GetLocatedPath(locatedEntryPath)) if (subDir->GetLocatedPath(locatedEntryPath))
_LocateEntries(subDir, locatedEntryPath); _LocateEntries(subDir, locatedEntryPath, implicit);
} }
} }
} }
@ -313,6 +314,8 @@ private:
directory->ReleaseReference(); directory->ReleaseReference();
return NULL; return NULL;
} }
directory->AddEntry(file);
fEntries.Insert(file); fEntries.Insert(file);
return file; return file;
@ -361,8 +364,11 @@ private:
&& parentDirectory->State() != LOCATABLE_ENTRY_UNLOCATED) { && parentDirectory->State() != LOCATABLE_ENTRY_UNLOCATED) {
BString locatedDirectoryPath; BString locatedDirectoryPath;
if (parentDirectory->GetLocatedPath(locatedDirectoryPath)) if (parentDirectory->GetLocatedPath(locatedDirectoryPath))
_LocateEntryInParentDir(directory, locatedDirectoryPath); _LocateEntryInParentDir(directory, locatedDirectoryPath, true);
} }
if (parentDirectory != NULL)
parentDirectory->AddEntry(directory);
fEntries.Insert(directory); fEntries.Insert(directory);
return directory; return directory;

View File

@ -1,6 +1,6 @@
/* /*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2010, Rene Gollent, rene@gollent.com. * Copyright 2010-2011, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@ -107,7 +107,8 @@ TeamWindow::TeamWindow(::Team* team, UserInterfaceListener* listener)
fRunButton(NULL), fRunButton(NULL),
fStepOverButton(NULL), fStepOverButton(NULL),
fStepIntoButton(NULL), fStepIntoButton(NULL),
fStepOutButton(NULL) fStepOutButton(NULL),
fSourceLocatePanel(NULL)
{ {
fTeam->Lock(); fTeam->Lock();
BString name = fTeam->Name(); BString name = fTeam->Name();
@ -138,6 +139,8 @@ TeamWindow::~TeamWindow()
_SetActiveStackTrace(NULL); _SetActiveStackTrace(NULL);
_SetActiveImage(NULL); _SetActiveImage(NULL);
_SetActiveThread(NULL); _SetActiveThread(NULL);
delete fSourceLocatePanel;
} }
@ -247,13 +250,15 @@ TeamWindow::MessageReceived(BMessage* message)
&& fActiveFunction->GetFunctionDebugInfo() && fActiveFunction->GetFunctionDebugInfo()
->SourceFile() != NULL && fActiveSourceCode != NULL ->SourceFile() != NULL && fActiveSourceCode != NULL
&& fActiveSourceCode->GetSourceFile() == NULL) { && fActiveSourceCode->GetSourceFile() == NULL) {
BFilePanel* panel = NULL;
try { try {
panel = new BFilePanel(B_OPEN_PANEL, if (fSourceLocatePanel == NULL) {
new BMessenger(this)); fSourceLocatePanel = new BFilePanel(B_OPEN_PANEL,
panel->Show(); new BMessenger(this));
}
fSourceLocatePanel->Show();
} catch (...) { } catch (...) {
delete panel; delete fSourceLocatePanel;
fSourceLocatePanel = NULL;
} }
} }
break; break;

View File

@ -1,6 +1,6 @@
/* /*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2010, Rene Gollent, rene@gollent.com. * Copyright 2010-2011, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef TEAM_WINDOW_H #ifndef TEAM_WINDOW_H
@ -24,6 +24,7 @@
class BButton; class BButton;
class BFilePanel;
class BMenuBar; class BMenuBar;
class BSplitView; class BSplitView;
class BStringView; class BStringView;
@ -185,6 +186,7 @@ private:
BSplitView* fThreadSplitView; BSplitView* fThreadSplitView;
InspectorWindow* fInspectorWindow; InspectorWindow* fInspectorWindow;
GUITeamUISettings fUISettings; GUITeamUISettings fUISettings;
BFilePanel* fSourceLocatePanel;
}; };