[all-commits] [llvm/llvm-project] 03604a: [lldb] Make lldbassert fire only once per instance...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Fri Apr 4 12:53:31 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 03604a784011bec2292f900b118d825f34f8cf89
      https://github.com/llvm/llvm-project/commit/03604a784011bec2292f900b118d825f34f8cf89
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2025-04-04 (Fri, 04 Apr 2025)

  Changed paths:
    M lldb/include/lldb/Utility/LLDBAssert.h
    M lldb/source/Utility/LLDBAssert.cpp

  Log Message:
  -----------
  [lldb] Make lldbassert fire only once per instance (#134343)

The `lldbassert` macro in LLDB behaves like a regular `assert` when
assertions are enabled, and otherwise prints a pretty backtrace and
prompts the user to file a bug. By default, this is emitted as a
diagnostic event, but vendors can provide their own behavior, for
example pre-populating a bug report.

Recently, we ran into an issue where an `lldbassert` (in the Swift
language plugin) would fire excessively, to the point that it was
interfering with the usability of the debugger.

Once an `lldbasser` has fired, there's no point in bothering the user
over and over again for the same problem. This PR solves the problem by
introducing a static `std::once_flag` in the macro. This way, every
`lldbasser` will fire at most once per lldb instance.

rdar://148520448



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list