From d2c4c9b132e1f819f2207a607fda794a7d2e6595 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Tue, 18 Aug 2015 08:23:35 +0000 Subject: [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 --- lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp') 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); -- cgit v1.2.3