[Lldb-commits] [PATCH] D128557: [lldb] Add a log dump command to dump the circular log buffer

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 27 07:01:54 PDT 2022


labath accepted this revision.
labath added a comment.

In D128557#3609545 <https://reviews.llvm.org/D128557#3609545>, @JDevlieghere wrote:

> One solution would be to keep a circular buffer per category. I'll think about it and if I come up with a good solution I'll put up another patch.

This isn't completely trivial, because there it's not possible to associate each log message with a specific log category -- `GetLog(FOO | BAR)` will return a log object if either of the two categories are set. So we'd either need to attach a set of categories to each log message, give up the multi-category messages, or do something more complicated...



================
Comment at: lldb/test/API/commands/log/basic/TestLogHandlers.py:20
+
+        self.runCmd("log enable -b 5 -h circular lldb commands")
+        self.runCmd("bogus", check=False)
----------------
clayborg wrote:
> Do we want to test that non circular buffers can't be dumped too to make sure nothing goes wrong or that we get a good error message stating that this log channel isn't circular?
Is that done? I would expect to see a test which runs something like "log enable -h XXX" and then checks that "log dump" errors out with something like "log handler XXX does not support dumping"...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128557/new/

https://reviews.llvm.org/D128557



More information about the lldb-commits mailing list