summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Process.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r--lldb/source/Target/Process.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index f370676e73a..7837881fb82 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -416,6 +416,7 @@ Error ProcessLaunchCommandOptions::SetOptionValue(
ExecutionContext *execution_context) {
Error error;
const int short_option = m_getopt_table[option_idx].val;
+ auto option_strref = llvm::StringRef::withNullAsEmpty(option_arg);
switch (short_option) {
case 's': // Stop at program entry point
@@ -484,7 +485,7 @@ Error ProcessLaunchCommandOptions::SetOptionValue(
{
bool success;
const bool disable_aslr_arg =
- Args::StringToBoolean(option_arg, true, &success);
+ Args::StringToBoolean(option_strref, true, &success);
if (success)
disable_aslr = disable_aslr_arg ? eLazyBoolYes : eLazyBoolNo;
else
@@ -497,7 +498,8 @@ Error ProcessLaunchCommandOptions::SetOptionValue(
case 'X': // shell expand args.
{
bool success;
- const bool expand_args = Args::StringToBoolean(option_arg, true, &success);
+ const bool expand_args =
+ Args::StringToBoolean(option_strref, true, &success);
if (success)
launch_info.SetShellExpandArguments(expand_args);
else
@@ -515,7 +517,8 @@ Error ProcessLaunchCommandOptions::SetOptionValue(
break;
case 'v':
- launch_info.GetEnvironmentEntries().AppendArgument(option_arg);
+ launch_info.GetEnvironmentEntries().AppendArgument(
+ llvm::StringRef::withNullAsEmpty(option_arg));
break;
default:
OpenPOWER on IntegriCloud