diff --git a/src/apps/debugger/files/FileManager.cpp b/src/apps/debugger/files/FileManager.cpp index 3cf0eb4cc4..3983475b00 100644 --- a/src/apps/debugger/files/FileManager.cpp +++ b/src/apps/debugger/files/FileManager.cpp @@ -124,11 +124,20 @@ public: return B_OK; } - LocatableFile* GetFile(const BString& directoryPath, const BString& name) + LocatableFile* GetFile(const BString& directoryPath, + const BString& relativePath) { - BString normalizedDirectoryPath; - _NormalizePath(directoryPath, normalizedDirectoryPath); - LocatableFile* file = _GetFile(normalizedDirectoryPath, name); + if (directoryPath.Length() == 0) + return GetFile(relativePath); + return GetFile(BString(directoryPath) << '/' << relativePath); + } + + LocatableFile* GetFile(const BString& path) + { + BString directoryPath; + BString name; + _SplitPath(path, directoryPath, name); + LocatableFile* file = _GetFile(directoryPath, name); if (file == NULL) return NULL; @@ -150,14 +159,6 @@ public: return file; } - LocatableFile* GetFile(const BString& path) - { - BString directoryPath; - BString name; - _SplitPath(path, directoryPath, name); - return _GetFile(directoryPath, name); - } - void EntryLocated(const BString& path, const BString& locatedPath) { BString directory; @@ -580,10 +581,11 @@ FileManager::Init(bool targetIsLocal) LocatableFile* -FileManager::GetTargetFile(const BString& directory, const BString& name) +FileManager::GetTargetFile(const BString& directory, + const BString& relativePath) { AutoLocker locker(this); - return fTargetDomain->GetFile(directory, name); + return fTargetDomain->GetFile(directory, relativePath); } @@ -604,10 +606,11 @@ FileManager::TargetEntryLocated(const BString& path, const BString& locatedPath) LocatableFile* -FileManager::GetSourceFile(const BString& directory, const BString& name) +FileManager::GetSourceFile(const BString& directory, + const BString& relativePath) { AutoLocker locker(this); - return fSourceDomain->GetFile(directory, name); + return fSourceDomain->GetFile(directory, relativePath); } diff --git a/src/apps/debugger/files/FileManager.h b/src/apps/debugger/files/FileManager.h index 89d2ff26e1..6ff7edf7ac 100644 --- a/src/apps/debugger/files/FileManager.h +++ b/src/apps/debugger/files/FileManager.h @@ -26,7 +26,7 @@ public: void Unlock() { fLock.Unlock(); } LocatableFile* GetTargetFile(const BString& directory, - const BString& name); + const BString& relativePath); // returns a reference LocatableFile* GetTargetFile(const BString& path); // returns a reference @@ -34,7 +34,7 @@ public: const BString& locatedPath); LocatableFile* GetSourceFile(const BString& directory, - const BString& name); + const BString& relativePath); // returns a reference LocatableFile* GetSourceFile(const BString& path); // returns a reference