Skip to content

[lldb][test] Fix LibCxxInternalsRecognizerTestCase on clang <= 17 #114122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 31, 2024
Merged
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil

import re

class LibCxxInternalsRecognizerTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True

@add_test_categories(["libc++"])
@skipIf(compiler="clang", compiler_version=["<", "16.0"])
def test_frame_recognizer(self):
"""Test that implementation details of libc++ are hidden"""
self.build()
Expand All @@ -21,7 +23,7 @@ def test_frame_recognizer(self):
# We never hide the frame of the entry-point into the standard library, even
# if the name starts with `__` which usually indicates an internal function.
"ranges_sort_less(int, int)": [
"ranges::__sort::operator()",
re.compile("ranges::__sort::(__fn::)?operator\(\)"),
"test_algorithms",
],
# `ranges::views::transform` internally uses `std::invoke`, and that
Expand Down Expand Up @@ -57,9 +59,14 @@ def test_frame_recognizer(self):
):
frame_id = frame_id + 1
# Expect the correct parent frame
self.assertIn(
expected_parent, thread.GetFrameAtIndex(frame_id).GetFunctionName()
)
func_name = thread.GetFrameAtIndex(frame_id).GetFunctionName()
if isinstance(expected_parent, re.Pattern):
self.assertTrue(
expected_parent.search(func_name) is not None,
f"'{expected_parent}' not found in '{func_name}'"
)
else:
self.assertIn(expected_parent, func_name)
frame_id = frame_id + 1
process.Continue()

Expand Down
Loading