Apparently the file names in the .debug_line section can be relative paths, not
only file names. Changed the FileManager::Get*File() method versions taking directory path and file name to also accept relative file paths. They just join the paths and use the single-argument versions, which now does all the work. Fixes finding source files for which a relative path is given in .debug_line. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31394 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -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<FileManager> 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<FileManager> locker(this);
|
||||
return fSourceDomain->GetFile(directory, name);
|
||||
return fSourceDomain->GetFile(directory, relativePath);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user