diff options
-rw-r--r-- | lldb/include/lldb/Host/FileSystem.h | 2 | ||||
-rw-r--r-- | lldb/source/Host/posix/FileSystem.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Host/windows/FileSystem.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 7 | ||||
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 5 | ||||
-rw-r--r-- | lldb/source/Target/Process.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Target/ProcessLaunchInfo.cpp | 3 |
7 files changed, 19 insertions, 7 deletions
diff --git a/lldb/include/lldb/Host/FileSystem.h b/lldb/include/lldb/Host/FileSystem.h index 3d7bfcd4f09..465ad451bdd 100644 --- a/lldb/include/lldb/Host/FileSystem.h +++ b/lldb/include/lldb/Host/FileSystem.h @@ -22,6 +22,8 @@ namespace lldb_private class FileSystem { public: + static const char *DEV_NULL; + static FileSpec::PathSyntax GetNativePathSyntax(); static Error MakeDirectory(const FileSpec &file_spec, uint32_t mode); diff --git a/lldb/source/Host/posix/FileSystem.cpp b/lldb/source/Host/posix/FileSystem.cpp index b974c446b91..1f2e7db0e1e 100644 --- a/lldb/source/Host/posix/FileSystem.cpp +++ b/lldb/source/Host/posix/FileSystem.cpp @@ -32,6 +32,9 @@ using namespace lldb; using namespace lldb_private; +const char * +FileSystem::DEV_NULL = "/dev/null"; + FileSpec::PathSyntax FileSystem::GetNativePathSyntax() { diff --git a/lldb/source/Host/windows/FileSystem.cpp b/lldb/source/Host/windows/FileSystem.cpp index 08190913021..2cca12b9271 100644 --- a/lldb/source/Host/windows/FileSystem.cpp +++ b/lldb/source/Host/windows/FileSystem.cpp @@ -19,6 +19,9 @@ using namespace lldb_private; +const char * +FileSystem::DEV_NULL = "nul"; + FileSpec::PathSyntax FileSystem::GetNativePathSyntax() { diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 960730b32b7..84dc10a5afc 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -40,6 +40,7 @@ #include "lldb/Core/Timer.h" #include "lldb/Core/Value.h" #include "lldb/DataFormatters/FormatManager.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Host/HostThread.h" #include "lldb/Host/StringConvert.h" #include "lldb/Host/Symbols.h" @@ -1004,11 +1005,11 @@ ProcessGDBRemote::DoLaunch (Module *exe_module, ProcessLaunchInfo &launch_info) { // set to /dev/null unless redirected to a file above if (!stdin_file_spec) - stdin_file_spec.SetFile("/dev/null", false); + stdin_file_spec.SetFile(FileSystem::DEV_NULL, false); if (!stdout_file_spec) - stdout_file_spec.SetFile("/dev/null", false); + stdout_file_spec.SetFile(FileSystem::DEV_NULL, false); if (!stderr_file_spec) - stderr_file_spec.SetFile("/dev/null", false); + stderr_file_spec.SetFile(FileSystem::DEV_NULL, false); } else if (platform_sp && platform_sp->IsHost()) { diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 704e851e72c..1b8e43dabd8 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -34,6 +34,7 @@ #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/Host/ConnectionFileDescriptor.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Host/HostInfo.h" #include "lldb/Host/Pipe.h" #include "lldb/Interpreter/CommandInterpreter.h" @@ -809,9 +810,9 @@ ScriptInterpreterPython::ExecuteOneLine (const char *command, CommandReturnObjec else { input_file_sp.reset (new StreamFile ()); - input_file_sp->GetFile().Open("/dev/null", File::eOpenOptionRead); + input_file_sp->GetFile().Open(FileSystem::DEV_NULL, File::eOpenOptionRead); output_file_sp.reset (new StreamFile ()); - output_file_sp->GetFile().Open("/dev/null", File::eOpenOptionWrite); + output_file_sp->GetFile().Open(FileSystem::DEV_NULL, File::eOpenOptionWrite); error_file_sp = output_file_sp; } diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index cf3090664b9..e634c1d5318 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -21,6 +21,7 @@ #include "lldb/Expression/UserExpression.h" #include "lldb/Expression/IRDynamicChecks.h" #include "lldb/Host/ConnectionFileDescriptor.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Host/Pipe.h" @@ -478,7 +479,7 @@ ProcessLaunchCommandOptions::SetOptionValue (uint32_t option_idx, const char *op case 'n': // Disable STDIO { FileAction action; - const FileSpec dev_null{"/dev/null", false}; + const FileSpec dev_null{FileSystem::DEV_NULL, false}; if (action.Open(STDIN_FILENO, dev_null, true, false)) launch_info.AppendFileAction (action); if (action.Open(STDOUT_FILENO, dev_null, false, true)) diff --git a/lldb/source/Target/ProcessLaunchInfo.cpp b/lldb/source/Target/ProcessLaunchInfo.cpp index bd2e1bc4c4a..fc17fe614c5 100644 --- a/lldb/source/Target/ProcessLaunchInfo.cpp +++ b/lldb/source/Target/ProcessLaunchInfo.cpp @@ -11,6 +11,7 @@ #include "lldb/Core/Debugger.h" #include "lldb/Core/Log.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Target/FileAction.h" #include "lldb/Target/Target.h" @@ -129,7 +130,7 @@ bool ProcessLaunchInfo::AppendSuppressFileAction (int fd, bool read, bool write) { FileAction file_action; - if (file_action.Open(fd, FileSpec{"/dev/null", false}, read, write)) + if (file_action.Open(fd, FileSpec{FileSystem::DEV_NULL, false}, read, write)) { AppendFileAction (file_action); return true; |