summaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test/lldbtest.py
diff options
context:
space:
mode:
authorMingming Liu <mingmingl@google.com>2025-09-10 15:25:31 -0700
committerGitHub <noreply@github.com>2025-09-10 15:25:31 -0700
commit1417dafa1db9cb1b2b09438aa9f53ea5ab6e36e2 (patch)
tree57f4b1f313c8cf74eed8819870f39c36ea263c68 /lldb/packages/Python/lldbsuite/test/lldbtest.py
parent898b813bc8a6d0276bf0f4769f5f2f64b34e632d (diff)
parentb8cefcb601ddaa18482555c4ff363c01a270c2fe (diff)
Merge branch 'main' into users/mingmingl-llvm/samplefdo-profile-formatusers/mingmingl-llvm/samplefdo-profile-format
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py27
1 files changed, 26 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 0fc85fcc4d2d..b7077f8d8cc5 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1702,6 +1702,29 @@ class Base(unittest.TestCase):
command += ["--max-size=%d" % max_size]
self.runBuildCommand(command)
+ def yaml2macho_core(self, yaml_path, obj_path, uuids=None):
+ """
+ Create a Mach-O corefile at the given path from a yaml file.
+
+ Throws subprocess.CalledProcessError if the object could not be created.
+ """
+ yaml2macho_core_bin = configuration.get_yaml2macho_core_path()
+ if not yaml2macho_core_bin:
+ self.assertTrue(False, "No valid yaml2macho-core executable specified")
+ if uuids != None:
+ command = [
+ yaml2macho_core_bin,
+ "-i",
+ yaml_path,
+ "-o",
+ obj_path,
+ "-u",
+ uuids,
+ ]
+ else:
+ command = [yaml2macho_core_bin, "-i", yaml_path, "-o", obj_path]
+ self.runBuildCommand(command)
+
def cleanup(self, dictionary=None):
"""Platform specific way to do cleanup after build."""
module = builder_module()
@@ -2264,7 +2287,9 @@ class TestBase(Base, metaclass=LLDBTestCaseFactory):
given list of completions"""
interp = self.dbg.GetCommandInterpreter()
match_strings = lldb.SBStringList()
- interp.HandleCompletion(command, len(command), 0, max_completions, match_strings)
+ interp.HandleCompletion(
+ command, len(command), 0, max_completions, match_strings
+ )
# match_strings is a 1-indexed list, so we have to slice...
self.assertCountEqual(
completions, list(match_strings)[1:], "List of returned completion is wrong"