Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions lldb/examples/synthetic/gnu_libstdcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,17 +889,12 @@ def VariantSummaryProvider(valobj, dict):
if not (index_obj and index_obj.IsValid() and data_obj and data_obj.IsValid()):
return "<Can't find _M_index or _M_u>"

def get_variant_npos_value(index_byte_size):
if index_byte_size == 1:
return 0xFF
elif index_byte_size == 2:
return 0xFFFF
else:
return 0xFFFFFFFF
npos = valobj.GetTarget().FindFirstGlobalVariable("std::variant_npos")
if not npos:
return "<Can't find std::variant_npos sentinel>"

npos_value = get_variant_npos_value(index_obj.GetByteSize())
index = index_obj.GetValueAsUnsigned(0)
if index == npos_value:
if index == npos.GetValueAsUnsigned(0):
return " No Value"

# Strip references and typedefs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Test lldb data formatter for LibStdC++ std::variant.
"""


import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
Expand Down Expand Up @@ -62,17 +61,13 @@ def test_with_run_command(self):
"frame variable v3",
substrs=["v3 = Active Type = char {", "Value = 'A'", "}"],
)
"""
TODO: temporarily disable No Value tests as they seem to fail on ubuntu/debian
bots. Pending reproduce and investigation.

self.expect("frame variable v_no_value", substrs=["v_no_value = No Value"])

self.expect(
"frame variable v_many_types_no_value",
substrs=["v_many_types_no_value = No Value"],
)
"""

@add_test_categories(["libstdcxx"])
def test_invalid_variant_index(self):
Expand Down
Loading