summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-10-11 21:42:09 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-10-11 21:42:09 +0000
commit75f47c3a5d8fa1f3f7f492af58199d34f10f26ed (patch)
tree9897488a36cba6200867d738e554ecbbac64a62d /lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
parent3c1e1e949895fbe29b7f5b0ca4708243c261e807 (diff)
downloadbcm5719-llvm-75f47c3a5d8fa1f3f7f492af58199d34f10f26ed.tar.gz
bcm5719-llvm-75f47c3a5d8fa1f3f7f492af58199d34f10f26ed.zip
llgs: fixes to PTY/gdb-remote inferior stdout/stderr handling, logging addtions.
With this change, both local-process llgs and remote-target llgs stdout/stderr handling from inferior work correctly. Several log lines have been added around PTY and stdout/stderr redirection logic on the lldb client side. Regarding remote llgs execution, see the following: With these changes, remote llgs with $O now works properly: $ lldb (lldb) platform select remote-linux (lldb) target create ~/some/inferior/exe (lldb) gdb-remote {some-target}:{port} (lldb) run The sequence above will correctly redirect stdout/stderr over gdb-remote $O, as is needed for remote debugging. That sequence assumes there is a lldb-gdbserver exe running on the target with {some-host}:{port}. You can replace the gdb-remote command with a '(lldb) platform connect connect://{target-ip}:{target-port}'. If you do this and have a lldb-platform running on the remote end, it will go ahead and launch llgs for lldb for each target instance that is run/attached. For local debugging with llgs, the following sequence also works, and uses local PTYs instead to avoid $O and extra gdb-remote messages: $ lldb (lldb) settings set platform.plugin.linux.use-llgs true (lldb) target create ~/some/inferior/exe (lldb) run The above will run the inferior using llgs on the local host, and will use PTYs rather than $O redirection. This change also removes the logging that happened after the fork but before the exec when llgs is launching a new inferior process. Some aspect of the file handling during that portion of code would not do the right thing with log handling. We might want to go back later and have that communicate over a pipe from the child to parent to pass along any messages that previously were logged in that section of code. llvm-svn: 219578
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.h')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeProcessLinux.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
index a13570f63ef..dc1646ecb3d 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
@@ -220,9 +220,9 @@ namespace lldb_private
lldb_private::Module *module,
char const **argv,
char const **envp,
- const char *stdin_path,
- const char *stdout_path,
- const char *stderr_path,
+ const std::string &stdin_path,
+ const std::string &stdout_path,
+ const std::string &stderr_path,
const char *working_dir,
const lldb_private::ProcessLaunchInfo &launch_info);
@@ -231,9 +231,9 @@ namespace lldb_private
lldb_private::Module *m_module; // The executable image to launch.
char const **m_argv; // Process arguments.
char const **m_envp; // Process environment.
- const char *m_stdin_path; // Redirect stdin or NULL.
- const char *m_stdout_path; // Redirect stdout or NULL.
- const char *m_stderr_path; // Redirect stderr or NULL.
+ const std::string &m_stdin_path; // Redirect stdin if not empty.
+ const std::string &m_stdout_path; // Redirect stdout if not empty.
+ const std::string &m_stderr_path; // Redirect stderr if not empty.
const char *m_working_dir; // Working directory or NULL.
const lldb_private::ProcessLaunchInfo &m_launch_info;
};
@@ -260,9 +260,9 @@ namespace lldb_private
Module *module,
char const *argv[],
char const *envp[],
- const char *stdin_path,
- const char *stdout_path,
- const char *stderr_path,
+ const std::string &stdin_path,
+ const std::string &stdout_path,
+ const std::string &stderr_path,
const char *working_dir,
const lldb_private::ProcessLaunchInfo &launch_info,
Error &error);
OpenPOWER on IntegriCloud