[haiku-commits] haiku: hrev50529 - src/kits/debugger/files

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 7 Sep 2016 05:00:04 +0200 (CEST)

hrev50529 adds 1 changeset to branch 'master'
old head: ed99a95f359befa9029c95f173b025ad2d1af1b9
new head: 584fd9619cdc9d2a8b97de2703d0e9d87fec79d8
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=584fd9619cdc+%5Eed99a95f359b

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

584fd9619cdc: libdebugger: Fix #12944.
  
  LocatableFile:
  - If there is no parent path, don't insert a path separator between parent
    and filename. This may be the case depending on how the source file was
    specified during compilation.
  
  FileManager:
  - When constructing an EntryPath from a LocatableEntry, ensure that the
    parent folder actually has a path string that isn't simply empty to ensure
    consistency with the raw dir/file case. Otherwise, hash lookups that are
    dependent on the parent dir being NULL if not specified will fail, causing
    us to not locate the file successfully. This was preventing us from updating
    source location information for make 4.2's main.c, as the latter was
    specified in such a way that the above combination of conditions would
    occur, and consequently when asking the FileManager to update the source
    location with the actual file, the entry couldn't be found in the table,
    and no information would be updated.

                                         [ Rene Gollent <rene@xxxxxxxxxxx> ]

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

Revision:    hrev50529
Commit:      584fd9619cdc9d2a8b97de2703d0e9d87fec79d8
URL:         http://cgit.haiku-os.org/haiku/commit/?id=584fd9619cdc
Author:      Rene Gollent <rene@xxxxxxxxxxx>
Date:        Wed Sep  7 02:50:55 2016 UTC

Ticket:      https://dev.haiku-os.org/ticket/12944

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

2 files changed, 9 insertions(+), 3 deletions(-)
src/kits/debugger/files/FileManager.cpp   | 7 +++++--
src/kits/debugger/files/LocatableFile.cpp | 5 ++++-

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

diff --git a/src/kits/debugger/files/FileManager.cpp 
b/src/kits/debugger/files/FileManager.cpp
index 33be50f..bce3c02 100644
--- a/src/kits/debugger/files/FileManager.cpp
+++ b/src/kits/debugger/files/FileManager.cpp
@@ -1,6 +1,6 @@
 /*
  * Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
- * Copyright 2011-2013, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2011-2016, Rene Gollent, rene@xxxxxxxxxxx.
  * Distributed under the terms of the MIT License.
  */
 
@@ -41,9 +41,12 @@ struct FileManager::EntryPath {
 
        EntryPath(const LocatableEntry* entry)
                :
-               directory(entry->Parent() != NULL ? entry->Parent()->Path() : 
NULL),
+               directory(NULL),
                name(entry->Name())
        {
+               LocatableDirectory* parent = entry->Parent();
+               if (parent != NULL && strlen(parent->Path()) > 0)
+                       directory = parent->Path();
        }
 
        EntryPath(const EntryPath& other)
diff --git a/src/kits/debugger/files/LocatableFile.cpp 
b/src/kits/debugger/files/LocatableFile.cpp
index 38ebdc5..ab45947 100644
--- a/src/kits/debugger/files/LocatableFile.cpp
+++ b/src/kits/debugger/files/LocatableFile.cpp
@@ -1,5 +1,6 @@
 /*
  * Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * Copyright 2016, Rene Gollent, rene@xxxxxxxxxxx.
  * Distributed under the terms of the MIT License.
  */
 
@@ -40,7 +41,9 @@ void
 LocatableFile::GetPath(BString& _path) const
 {
        fParent->GetPath(_path);
-       _path << '/' << fName;
+       if (_path.Length() != 0)
+               _path << '/';
+       _path << fName;
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev50529 - src/kits/debugger/files - anevilyak