Debugger: Clean up DwarfFile::_GetDebugInfoPath().
- Fix a regression introduced when refactoring for the removal of /boot/common, and adjust to use BPathFinder::FindPath() with implicit existence check instead of manual iteration.
This commit is contained in:
@@ -15,7 +15,6 @@
|
|||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <PathFinder.h>
|
#include <PathFinder.h>
|
||||||
#include <StringList.h>
|
|
||||||
|
|
||||||
#include "AttributeClasses.h"
|
#include "AttributeClasses.h"
|
||||||
#include "AttributeValue.h"
|
#include "AttributeValue.h"
|
||||||
@@ -2770,25 +2769,18 @@ DwarfFile::_GetDebugInfoPath(const char* debugFileName,
|
|||||||
if (entry.Exists())
|
if (entry.Exists())
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
// See if our image is in any of the system locations.
|
// If the above search failed, check if our image is located in any
|
||||||
// if so, look for its debug info in the corresponding location.
|
// of the system installation paths, and attempt to locate the debug info
|
||||||
BPathFinder finder;
|
// file in the corresponding well-known location
|
||||||
BStringList paths;
|
BString pathSuffix;
|
||||||
result = finder.FindPaths(B_FIND_PATH_DEVELOP_DIRECTORY, paths);
|
pathSuffix.SetToFormat("debug/%s", debugFileName);
|
||||||
if (result != B_OK)
|
|
||||||
return result;
|
|
||||||
for (int32 i = 0; i < paths.CountStrings(); i++) {
|
|
||||||
BString tempPath = paths.StringAt(i);
|
|
||||||
|
|
||||||
if (tempPath.Compare(fName, tempPath.Length()) == 0) {
|
BPathFinder finder(fName);
|
||||||
_infoPath.SetToFormat("%s/debug/%s", basePath.Path(),
|
result = finder.FindPath(B_FIND_PATH_DEVELOP_DIRECTORY,
|
||||||
debugFileName);
|
pathSuffix.String(), B_FIND_PATH_EXISTING_ONLY, basePath);
|
||||||
entry.SetTo(_infoPath.String());
|
if (result == B_OK) {
|
||||||
result = entry.InitCheck();
|
_infoPath = basePath.Path();
|
||||||
if (result != B_OK && result != B_ENTRY_NOT_FOUND)
|
return B_OK;
|
||||||
return result;
|
|
||||||
return entry.Exists() ? B_OK : B_ENTRY_NOT_FOUND;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_ENTRY_NOT_FOUND;
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
|||||||
Reference in New Issue
Block a user