Re: [Lldb-commits] [PATCH] D12083: [LLGS] Avoid misrepresenting log lines as inferior output
This revision was automatically updated to reflect the committed changes. Closed by commit rL245272: [LLGS] Avoid misrepresenting log lines as inferior output (authored by labath). Changed prior to commit: http://reviews.llvm.org/D12083?vs=32298id=32383#toc Repository: rL LLVM http://reviews.llvm.org/D12083 Files: lldb/trunk/source/Core/Log.cpp lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Index: lldb/trunk/source/Core/Log.cpp === --- lldb/trunk/source/Core/Log.cpp +++ lldb/trunk/source/Core/Log.cpp @@ -449,7 +449,7 @@ { CallbackMap callback_map = GetCallbackMap (); CallbackMapIter pos, end = callback_map.end(); -const char *categories[1] = {NULL}; +const char *categories[] = {all, nullptr}; for (pos = callback_map.begin(); pos != end; ++pos) pos-second.disable (categories, feedback_strm); Index: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp === --- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -560,8 +560,11 @@ // 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); Index: lldb/trunk/source/Core/Log.cpp === --- lldb/trunk/source/Core/Log.cpp +++ lldb/trunk/source/Core/Log.cpp @@ -449,7 +449,7 @@ { CallbackMap callback_map = GetCallbackMap (); CallbackMapIter pos, end = callback_map.end(); -const char *categories[1] = {NULL}; +const char *categories[] = {all, nullptr}; for (pos = callback_map.begin(); pos != end; ++pos) pos-second.disable (categories, feedback_strm); Index: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp === --- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -560,8 +560,11 @@ // 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); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D12083: [LLGS] Avoid misrepresenting log lines as inferior output
ovyalov accepted this revision. ovyalov added a comment. LGTM http://reviews.llvm.org/D12083 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D12083: [LLGS] Avoid misrepresenting log lines as inferior output
labath created this revision. labath added reviewers: clayborg, ovyalov. labath added subscribers: lldb-commits, dean. 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. http://reviews.llvm.org/D12083 Files: source/Core/Log.cpp source/Plugins/Process/Linux/NativeProcessLinux.cpp Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp === --- source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -560,8 +560,11 @@ // Child process. if (pid == 0) { +// First, make sure we disable all logging. If we are logging to stdout, our logs can be +// mistaken for interior 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); Index: source/Core/Log.cpp === --- source/Core/Log.cpp +++ source/Core/Log.cpp @@ -449,7 +449,7 @@ { CallbackMap callback_map = GetCallbackMap (); CallbackMapIter pos, end = callback_map.end(); -const char *categories[1] = {NULL}; +const char *categories[] = {all, nullptr}; for (pos = callback_map.begin(); pos != end; ++pos) pos-second.disable (categories, feedback_strm); Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp === --- source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -560,8 +560,11 @@ // Child process. if (pid == 0) { +// First, make sure we disable all logging. If we are logging to stdout, our logs can be +// mistaken for interior 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); Index: source/Core/Log.cpp === --- source/Core/Log.cpp +++ source/Core/Log.cpp @@ -449,7 +449,7 @@ { CallbackMap callback_map = GetCallbackMap (); CallbackMapIter pos, end = callback_map.end(); -const char *categories[1] = {NULL}; +const char *categories[] = {all, nullptr}; for (pos = callback_map.begin(); pos != end; ++pos) pos-second.disable (categories, feedback_strm); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D12083: [LLGS] Avoid misrepresenting log lines as inferior output
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. Looks good. http://reviews.llvm.org/D12083 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits