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

Adrian Vogelsgesang via All-commits all-commits at lists.llvm.org
Sun Nov 20 14:29:06 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cd3091a88f7c55c90d9b5fff372ce1cdfc71948d
      https://github.com/llvm/llvm-project/commit/cd3091a88f7c55c90d9b5fff372ce1cdfc71948d
  Author: Adrian Vogelsgesang <avogelsgesang at salesforce.com>
  Date:   2022-11-20 (Sun, 20 Nov 2022)

  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




More information about the All-commits mailing list