[Lldb-commits] [lldb] r281943 - Fixed the build by changing a couple of const char *s to StringRefs.
Sean Callanan via lldb-commits
lldb-commits at lists.llvm.org
Mon Sep 19 15:06:12 PDT 2016
Author: spyffe
Date: Mon Sep 19 17:06:12 2016
New Revision: 281943
URL: http://llvm.org/viewvc/llvm-project?rev=281943&view=rev
Log:
Fixed the build by changing a couple of const char *s to StringRefs.
Modified:
lldb/trunk/source/Host/macosx/Host.mm
lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=281943&r1=281942&r2=281943&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Mon Sep 19 17:06:12 2016
@@ -806,7 +806,7 @@ static bool GetMacOSXProcessArgs(const P
for (int i = 0; i < static_cast<int>(argc); ++i) {
cstr = data.GetCStr(&offset);
if (cstr)
- proc_args.AppendArgument(cstr);
+ proc_args.AppendArgument(llvm::StringRef(cstr));
}
Args &proc_env = process_info.GetEnvironmentEntries();
@@ -824,7 +824,7 @@ static bool GetMacOSXProcessArgs(const P
llvm::Triple::MacOSX);
}
- proc_env.AppendArgument(cstr);
+ proc_env.AppendArgument(llvm::StringRef(cstr));
}
return true;
}
@@ -1379,7 +1379,8 @@ Error Host::ShellExpandArguments(Process
if (!str_sp)
continue;
- launch_info.GetArguments().AppendArgument(str_sp->GetValue().c_str());
+ launch_info.GetArguments().AppendArgument(
+ llvm::StringRef(str_sp->GetValue().c_str()));
}
}
Modified: lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm?rev=281943&r1=281942&r2=281943&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm (original)
+++ lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm Mon Sep 19 17:06:12 2016
@@ -88,7 +88,8 @@ bool HostInfoMacOSX::GetOSVersion(uint32
NSString *version_value = [version_info objectForKey:@"ProductVersion"];
const char *version_str = [version_value UTF8String];
if (version_str)
- Args::StringToVersion(version_str, g_major, g_minor, g_update);
+ Args::StringToVersion(llvm::StringRef(version_str), g_major, g_minor,
+ g_update);
}
}
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=281943&r1=281942&r2=281943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Mon Sep 19 17:06:12 2016
@@ -1123,8 +1123,9 @@ Error GDBRemoteCommunication::StartDebug
__FUNCTION__, error.AsCString());
return error;
}
- debugserver_args.AppendArgument("--named-pipe");
- debugserver_args.AppendArgument(named_pipe_path.c_str());
+ debugserver_args.AppendArgument(llvm::StringRef("--named-pipe"));
+ debugserver_args.AppendArgument(
+ llvm::StringRef(named_pipe_path.c_str()));
#else
// Binding to port zero, we need to figure out what port it ends up
// using using an unnamed pipe...
@@ -1191,7 +1192,7 @@ Error GDBRemoteCommunication::StartDebug
if (env_debugserver_log_flags) {
::snprintf(arg_cstr, sizeof(arg_cstr), "--log-flags=%s",
env_debugserver_log_flags);
- debugserver_args.AppendArgument(arg_cstr);
+ debugserver_args.AppendArgument(llvm::StringRef(arg_cstr));
}
#else
const char *env_debugserver_log_channels =
More information about the lldb-commits
mailing list