summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2015-08-18 08:23:35 +0000
committerPavel Labath <labath@google.com>2015-08-18 08:23:35 +0000
commitd2c4c9b132e1f819f2207a607fda794a7d2e6595 (patch)
tree5ed3e553221704b2142aca9047ce61c5023343ce /lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
parente1c08b0bfe5901b6f205c592b8a306f870035aa6 (diff)
[LLGS] Avoid misrepresenting log lines as inferior output
Summary: in case we are logging to stdout, any log lines from the forked child can be misconstrued to be inferior output. To avoid this, we disable all logging immediately after forking. I also fix the implementatoion of DisableAllLogChannels, which was a no-op before this commit. Reviewers: clayborg, ovyalov Subscribers: dean, lldb-commits Differential Revision: http://reviews.llvm.org/D12083 llvm-svn: 245272
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index b4afe6246979..b237339c1246 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -560,8 +560,11 @@ NativeProcessLinux::Launch(LaunchArgs *args, Error &error)
// Child process.
if (pid == 0)
{
+ // First, make sure we disable all logging. If we are logging to stdout, our logs can be
+ // mistaken for inferior output.
+ Log::DisableAllLogChannels(nullptr);
// FIXME consider opening a pipe between parent/child and have this forked child
- // send log info to parent re: launch status, in place of the log lines removed here.
+ // send log info to parent re: launch status.
// Start tracing this child that is about to exec.
error = PtraceWrapper(PTRACE_TRACEME, 0);