[haiku-commits] haiku: hrev46490 - src/apps/debugger/dwarf

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 5 Dec 2013 04:57:02 +0100 (CET)

hrev46490 adds 1 changeset to branch 'master'
old head: 7b59a617900fa972fbbe16d2e89cf9b06b2920e1
new head: 75c19f704367cd001001a4f8d48df5ea94b7573a
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=75c19f7+%5E7b59a61

----------------------------------------------------------------------------

75c19f7: 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.

                                         [ Rene Gollent <rene@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev46490
Commit:      75c19f704367cd001001a4f8d48df5ea94b7573a
URL:         http://cgit.haiku-os.org/haiku/commit/?id=75c19f7
Author:      Rene Gollent <rene@xxxxxxxxxxx>
Date:        Thu Dec  5 03:53:31 2013 UTC

----------------------------------------------------------------------------

1 file changed, 12 insertions(+), 20 deletions(-)
src/apps/debugger/dwarf/DwarfFile.cpp | 32 ++++++++++++-------------------

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/dwarf/DwarfFile.cpp 
b/src/apps/debugger/dwarf/DwarfFile.cpp
index a2f7a88..4aaa9c8 100644
--- a/src/apps/debugger/dwarf/DwarfFile.cpp
+++ b/src/apps/debugger/dwarf/DwarfFile.cpp
@@ -15,7 +15,6 @@
 #include <FindDirectory.h>
 #include <Path.h>
 #include <PathFinder.h>
-#include <StringList.h>
 
 #include "AttributeClasses.h"
 #include "AttributeValue.h"
@@ -2770,25 +2769,18 @@ DwarfFile::_GetDebugInfoPath(const char* debugFileName,
        if (entry.Exists())
                return B_OK;
 
-       // See if our image is in any of the system locations.
-       // if so, look for its debug info in the corresponding location.
-       BPathFinder finder;
-       BStringList paths;
-       result = finder.FindPaths(B_FIND_PATH_DEVELOP_DIRECTORY, paths);
-       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) {
-                       _infoPath.SetToFormat("%s/debug/%s", basePath.Path(),
-                               debugFileName);
-                       entry.SetTo(_infoPath.String());
-                       result = entry.InitCheck();
-                       if (result != B_OK && result != B_ENTRY_NOT_FOUND)
-                               return result;
-                       return entry.Exists() ? B_OK : B_ENTRY_NOT_FOUND;
-               }
+       // If the above search failed, check if our image is located in any
+       // of the system installation paths, and attempt to locate the debug 
info
+       // file in the corresponding well-known location
+       BString pathSuffix;
+       pathSuffix.SetToFormat("debug/%s", debugFileName);
+
+       BPathFinder finder(fName);
+       result = finder.FindPath(B_FIND_PATH_DEVELOP_DIRECTORY,
+               pathSuffix.String(), B_FIND_PATH_EXISTING_ONLY, basePath);
+       if (result == B_OK) {
+               _infoPath = basePath.Path();
+               return B_OK;
        }
 
        return B_ENTRY_NOT_FOUND;


Other related posts:

  • » [haiku-commits] haiku: hrev46490 - src/apps/debugger/dwarf - anevilyak