[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 16 10:30:22 PDT 2022


JDevlieghere created this revision.
JDevlieghere added reviewers: labath, clayborg, jingham, kastiglione.
Herald added a project: All.
JDevlieghere requested review of this revision.

This patch adds a buffer logging mode to lldb. It can be enabled with `log buffered enable`, which enables logging for the default category for every log channel to an in-memory circular buffer. The buffered log messages can be written to disk with the `log buffered dump` command. The latter command takes a directory as it input argument and creates a log file per log channel.

As of right now these two new commands are pretty bare bones. For example, we do not support specifying categories or logging options. This is intentional, because I don't see them as the primary way to interact with this feature. Instead, I imagine a world where we have a small but meaningful subset of logging always enabled in buffered mode. When something goes wrong, the user types a command (similar to `sysdiagnose` on macOS) and we'll dump the logs as part of a package that's meant to help us investigate the issue.


https://reviews.llvm.org/D127986

Files:
  lldb/include/lldb/Core/Debugger.h
  lldb/source/Commands/CommandObjectLog.cpp
  lldb/source/Core/Debugger.cpp
  lldb/source/Utility/Log.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127986.437591.patch
Type: text/x-patch
Size: 8976 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220616/75b16e1c/attachment.bin>


More information about the lldb-commits mailing list