[Lldb-commits] [lldb] r333666 - Remove infinite recursion due to FileSpec change.

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu May 31 09:28:29 PDT 2018


Author: jdevlieghere
Date: Thu May 31 09:28:29 2018
New Revision: 333666

URL: http://llvm.org/viewvc/llvm-project?rev=333666&view=rev
Log:
Remove infinite recursion due to FileSpec change.

Fixes infinite recursion due to change in how FileSpec deals with
removing the last path component.

Fixes timout for TestMiniDumpNew.py

Modified:
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=333666&r1=333665&r2=333666&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Thu May 31 09:28:29 2018
@@ -1763,12 +1763,10 @@ PlatformDarwin::FindBundleBinaryInExecSe
 
     FileSpec platform_pull_apart(platform_file);
     std::vector<std::string> path_parts;
-    ConstString unix_root_dir("/");
-    while (true) {
+    path_parts.push_back(
+        platform_pull_apart.GetLastPathComponent().AsCString());
+    while (platform_pull_apart.RemoveLastPathComponent()) {
       ConstString part = platform_pull_apart.GetLastPathComponent();
-      platform_pull_apart.RemoveLastPathComponent();
-      if (part.IsEmpty() || part == unix_root_dir)
-        break;
       path_parts.push_back(part.AsCString());
     }
     const size_t path_parts_size = path_parts.size();




More information about the lldb-commits mailing list