[Lldb-commits] [lldb] r215159 - r215124 missed a few Mac OS X only uses of FileSpec::Resolve, fixing to match

Jim Ingham jingham at apple.com
Thu Aug 7 15:37:43 PDT 2014


Author: jingham
Date: Thu Aug  7 17:37:43 2014
New Revision: 215159

URL: http://llvm.org/viewvc/llvm-project?rev=215159&view=rev
Log:
r215124 missed a few Mac OS X only uses of FileSpec::Resolve, fixing to match
the new signature.

Modified:
    lldb/trunk/source/Host/common/Host.cpp

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=215159&r1=215158&r2=215159&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Thu Aug  7 17:37:43 2014
@@ -1180,7 +1180,6 @@ Host::GetLLDBPath (PathType path_type, F
                 if (GetLLDBPath (ePathTypeLLDBShlibDir, lldb_file_spec))
                 {
                     char raw_path[PATH_MAX];
-                    char resolved_path[PATH_MAX];
                     lldb_file_spec.GetPath(raw_path, sizeof(raw_path));
 
                     char *framework_pos = ::strstr (raw_path, "LLDB.framework");
@@ -1189,8 +1188,9 @@ Host::GetLLDBPath (PathType path_type, F
                         framework_pos += strlen("LLDB.framework");
                         ::strncpy (framework_pos, "/Headers", PATH_MAX - (framework_pos - raw_path));
                     }
-                    FileSpec::Resolve (raw_path, resolved_path, sizeof(resolved_path));
-                    g_lldb_headers_dir.SetCString(resolved_path);
+                    llvm::SmallString<64> resolved_path(raw_path);
+                    FileSpec::Resolve (resolved_path);
+                    g_lldb_headers_dir.SetCString(resolved_path.c_str());
                 }
 #else
                 // TODO: Anyone know how we can determine this for linux? Other systems??
@@ -1275,7 +1275,6 @@ Host::GetLLDBPath (PathType path_type, F
                 if (GetLLDBPath (ePathTypeLLDBShlibDir, lldb_file_spec))
                 {
                     char raw_path[PATH_MAX];
-                    char resolved_path[PATH_MAX];
                     lldb_file_spec.GetPath(raw_path, sizeof(raw_path));
 
                     char *framework_pos = ::strstr (raw_path, "LLDB.framework");
@@ -1283,8 +1282,9 @@ Host::GetLLDBPath (PathType path_type, F
                     {
                         framework_pos += strlen("LLDB.framework");
                         ::strncpy (framework_pos, "/Resources/PlugIns", PATH_MAX - (framework_pos - raw_path));
-                        FileSpec::Resolve (raw_path, resolved_path, sizeof(resolved_path));
-                        g_lldb_system_plugin_dir.SetCString(resolved_path);
+                        llvm::SmallString<64> resolved_path(raw_path);
+                        FileSpec::Resolve (resolved_path);
+                        g_lldb_system_plugin_dir.SetCString(resolved_path.c_str());
                     }
                     return false;
                 }
@@ -1319,12 +1319,11 @@ Host::GetLLDBPath (PathType path_type, F
             static ConstString g_lldb_user_plugin_dir;
             if (!g_lldb_user_plugin_dir)
             {
-                char user_plugin_path[PATH_MAX];
-                if (FileSpec::Resolve ("~/Library/Application Support/LLDB/PlugIns", 
-                                       user_plugin_path, 
-                                       sizeof(user_plugin_path)))
+                    llvm::SmallString<64> user_plugin_path("~/Library/Application Support/LLDB/PlugIns");
+                    FileSpec::Resolve (user_plugin_path);
+                if (user_plugin_path.size())
                 {
-                    g_lldb_user_plugin_dir.SetCString(user_plugin_path);
+                    g_lldb_user_plugin_dir.SetCString(user_plugin_path.c_str());
                 }
             }
             file_spec.GetDirectory() = g_lldb_user_plugin_dir;





More information about the lldb-commits mailing list