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

Zachary Turner zturner at google.com
Thu Aug 7 16:04:38 PDT 2014


Thanks.  BTW I actually have a Mac now.  As soon as I get a cable I'll be
able to hook it up and hopefully this kind of thing won't happen anymore.


On Thu, Aug 7, 2014 at 3:37 PM, Jim Ingham <jingham at apple.com> wrote:

> 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;
>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140807/a39495c5/attachment.html>


More information about the lldb-commits mailing list