[all-commits] [llvm/llvm-project] c319c0: [LLDB] Do not dereference promise pointer in `coro...

Andrew Ng via All-commits all-commits at lists.llvm.org
Mon Feb 13 02:30:39 PST 2023


  Branch: refs/heads/release/16.x
  Home:   https://github.com/llvm/llvm-project
  Commit: c319c03df351f88e3ae750f1cc21fd679ffcd844
      https://github.com/llvm/llvm-project/commit/c319c03df351f88e3ae750f1cc21fd679ffcd844
  Author: Adrian Vogelsgesang <avogelsgesang at salesforce.com>
  Date:   2023-02-13 (Mon, 13 Feb 2023)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/lldbtest.py
    M lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp
    M lldb/source/Plugins/Language/CPlusPlus/Coroutines.h
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/coroutine_handle/TestCoroutineHandle.py

  Log Message:
  -----------
  [LLDB] Do not dereference promise pointer in `coroutine_handle` pretty printer

So far, the pretty printer for `std::coroutine_handle` internally
dereferenced the contained frame pointer displayed the `promise`
as a sub-value. As noticed in https://reviews.llvm.org/D132624
by @labath, this can lead to an endless loop in lldb during printing
if the coroutine frame pointers form a cycle.

This commit breaks the cycle by exposing the `promise` as a pointer
type instead of a value type. The depth to which the `frame variable`
and the `expression` commands dereference those pointers can be
controlled using the `--ptr-depth` argument.

Differential Revision: https://reviews.llvm.org/D132815

(cherry picked from commit 8aa313755118bf43c6042fb316b6c243b2c59be2)


  Commit: 6dabe601994def41eb420e2f19a7e89c57fddff5
      https://github.com/llvm/llvm-project/commit/6dabe601994def41eb420e2f19a7e89c57fddff5
  Author: Adrian Vogelsgesang <avogelsgesang at salesforce.com>
  Date:   2023-02-13 (Mon, 13 Feb 2023)

  Changed paths:
    M lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp
    M lldb/source/Plugins/Language/CPlusPlus/Coroutines.h

  Log Message:
  -----------
  [LLDB] Fix assertion failure by removing `CopyType` in `std::coroutine_handle` pretty printer

The pretty printer for `std::coroutine_handle` was running into
> Assertion failed: (target_ctx != source_ctx && "Can't import into itself")
from ClangASTImporter.h, line 270.

This commit fixes the issue by removing the `CopyType` call from the
pretty printer. While this call was necessary in the past, it seems to
be no longer required, at least all test cases are still passing. Maybe
something changed in the meantime around the handling of `TypesystemClang`
instances. I don't quite understand why `CopyType` was necessary earlier.

I am not sure how to add a regression test for this, though. It seems
the issue is already triggered by the exising `TestCoroutineHandle.py`,
but API tests seem to ignore all violations of `lldbassert` and still
report the test as "passed", even if assertions were triggered

Differential Revision: https://reviews.llvm.org/D143127

(cherry picked from commit 54d4a2550d3167d51a9d386d9823a06aca459531)


  Commit: ce601db12b62a894cfd569838ca3f56da5203f7d
      https://github.com/llvm/llvm-project/commit/ce601db12b62a894cfd569838ca3f56da5203f7d
  Author: Andrew Ng <andrew.ng at sony.com>
  Date:   2023-02-13 (Mon, 13 Feb 2023)

  Changed paths:
    M clang/lib/Driver/Driver.cpp
    M llvm/include/llvm/Support/ExitCodes.h
    M llvm/include/llvm/Support/Signals.h
    M llvm/lib/Support/Windows/Signals.inc
    M llvm/lib/Support/raw_ostream.cpp

  Log Message:
  -----------
  [Support] Emulate SIGPIPE handling in raw_fd_ostream write for Windows

Prevent errors and crash dumps for broken pipes on Windows.

Fixes: https://github.com/llvm/llvm-project/issues/48672

Differential Revision: https://reviews.llvm.org/D142224

(cherry picked from commit 0b704d9db7e15723922ee29c6f245d108a09c214)


Compare: https://github.com/llvm/llvm-project/compare/d19ef5ffce38...ce601db12b62


More information about the All-commits mailing list