[all-commits] [llvm/llvm-project] 84ea6b: [lldb] Add diagnostics

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Mon Oct 31 14:40:55 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 84ea6b6f78df789db6724ef8d774cf04d94d2313
      https://github.com/llvm/llvm-project/commit/84ea6b6f78df789db6724ef8d774cf04d94d2313
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
    M lldb/include/lldb/API/SBDebugger.h
    A lldb/include/lldb/Utility/Diagnostics.h
    M lldb/source/API/SBDebugger.cpp
    M lldb/source/Core/Debugger.cpp
    M lldb/source/Initialization/SystemInitializerCommon.cpp
    M lldb/source/Utility/CMakeLists.txt
    A lldb/source/Utility/Diagnostics.cpp
    M lldb/tools/driver/Driver.cpp

  Log Message:
  -----------
  [lldb] Add diagnostics

Around this time last year, I said on the mailing list [1] that I wanted
to to transform the reproducers into something that resembles a
sysdiagnose on Apple platforms: a collection of files containing a
variety of information to help diagnose bugs or troubleshoot issues.

This patch adds that framework. Based on lessons learned from the
reproducers, I've intentionally tried to keep it small and simple.
Different parts of LLDB can register callbacks (this is necessary for
layering purposes) that will get called when the diagnostics should be
generated.

[1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html

Differential revision: https://reviews.llvm.org/D134991


  Commit: 0d01300aacf6029b6d63f7dcede3ca8e15229d34
      https://github.com/llvm/llvm-project/commit/0d01300aacf6029b6d63f7dcede3ca8e15229d34
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
    M lldb/include/lldb/Utility/Diagnostics.h
    M lldb/source/Commands/CMakeLists.txt
    A lldb/source/Commands/CommandObjectDiagnostics.cpp
    A lldb/source/Commands/CommandObjectDiagnostics.h
    M lldb/source/Commands/Options.td
    M lldb/source/Interpreter/CommandInterpreter.cpp
    M lldb/source/Utility/Diagnostics.cpp
    A lldb/test/Shell/Diagnostics/TestDump.test

  Log Message:
  -----------
  [lldb] Add a "diagnostics dump" command

Add a "diagnostics dump" command to, as the name implies, dump the
diagnostics to disk. The goal of this command is to let the user
generate the diagnostics in case of an issue that doesn't cause the
debugger to crash.

This command is also critical for testing, where we don't want to cause
a crash to emit the diagnostics.

Differential revision: https://reviews.llvm.org/D135622


  Commit: 8aed0ce20fc6be41a7e49ea1433095d4cf583e56
      https://github.com/llvm/llvm-project/commit/8aed0ce20fc6be41a7e49ea1433095d4cf583e56
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
    M lldb/include/lldb/Core/Debugger.h
    M lldb/include/lldb/Core/DebuggerEvents.h
    M lldb/include/lldb/Utility/Diagnostics.h
    M lldb/source/Core/Debugger.cpp
    M lldb/source/Core/DebuggerEvents.cpp
    M lldb/source/Utility/Diagnostics.cpp
    A lldb/test/Shell/Diagnostics/TestDiagnosticsLog.test

  Log Message:
  -----------
  [lldb] Emit diagnostic events in the diagnostic dump

Connect the diagnostic events with the diagnostic infrastructure.

 - Emit existing diagnostic events (warnings and errors) to the
   diagnostic log.
 - Introduce a new diagnostic event (info) that's used exclusively for
   diagnostic logging and does not get broadcast.

Differential revision: https://reviews.llvm.org/D136648


Compare: https://github.com/llvm/llvm-project/compare/1f8ac37e2d50...8aed0ce20fc6


More information about the All-commits mailing list