summaryrefslogtreecommitdiff
path: root/lldb/packages
diff options
context:
space:
mode:
authorAdrian Vogelsgesang <avogelsgesang@salesforce.com>2022-08-26 06:00:43 -0700
committerAdrian Vogelsgesang <avogelsgesang@salesforce.com>2022-11-20 14:26:36 -0800
commitcd3091a88f7c55c90d9b5fff372ce1cdfc71948d (patch)
tree4d92f67b4f015a1e9f780dd2c8f09070a0b97559 /lldb/packages
parent53b674ee159ae0dd9f5e7492e1c0af45d2305e73 (diff)
downloadllvm-cd3091a88f7c55c90d9b5fff372ce1cdfc71948d.tar.gz
[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
Diffstat (limited to 'lldb/packages')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 63bad9d0241d..f579a0160b2b 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -246,7 +246,7 @@ def which(program):
class ValueCheck:
def __init__(self, name=None, value=None, type=None, summary=None,
- children=None):
+ children=None, dereference=None):
"""
:param name: The name that the SBValue should have. None if the summary
should not be checked.
@@ -261,12 +261,15 @@ class ValueCheck:
The order of checks is the order of the checks in the
list. The number of checks has to match the number of
children.
+ :param dereference: A ValueCheck for the SBValue returned by the
+ `Dereference` function.
"""
self.expect_name = name
self.expect_value = value
self.expect_type = type
self.expect_summary = summary
self.children = children
+ self.dereference = dereference
def check_value(self, test_base, val, error_msg=None):
"""
@@ -308,6 +311,9 @@ class ValueCheck:
if self.children is not None:
self.check_value_children(test_base, val, error_msg)
+ if self.dereference is not None:
+ self.dereference.check_value(test_base, val.Dereference(), error_msg)
+
def check_value_children(self, test_base, val, error_msg=None):
"""
Checks that the children of a SBValue match a certain structure and