[lldb] Only run scripted process test on x86_64/arm64

The newly added
test/API/functionalities/scripted_process_empty_memory_region/dummy_scripted_process.py
imports
examples/python/templates/scripted_process.py
which only has register definitions for x86_64 and arm64.

Only run this test on those two architectures for now.
This commit is contained in:
Jason Molenda
2024-11-15 00:55:20 -08:00
parent e54365006a
commit fda4a324a3
2 changed files with 13 additions and 9 deletions

View File

@@ -5,7 +5,6 @@ import json, struct, signal
class ScriptedProcess(metaclass=ABCMeta):
"""
The base class for a scripted process.
@@ -229,7 +228,6 @@ class ScriptedProcess(metaclass=ABCMeta):
class ScriptedThread(metaclass=ABCMeta):
"""
The base class for a scripted thread.
@@ -357,7 +355,10 @@ class ScriptedThread(metaclass=ABCMeta):
if self.originating_process.arch == "x86_64":
self.register_info["sets"] = ["General Purpose Registers"]
self.register_info["registers"] = INTEL64_GPR
elif "arm64" in self.originating_process.arch:
elif (
"arm64" in self.originating_process.arch
or self.originating_process.arch == "aarch64"
):
self.register_info["sets"] = ["General Purpose Registers"]
self.register_info["registers"] = ARM64_GPR
else:
@@ -411,9 +412,9 @@ class PassthroughScriptedProcess(ScriptedProcess):
)
)
self.threads[
driving_thread.GetThreadID()
] = PassthroughScriptedThread(self, structured_data)
self.threads[driving_thread.GetThreadID()] = (
PassthroughScriptedThread(self, structured_data)
)
for module in self.driving_target.modules:
path = module.file.fullpath
@@ -507,9 +508,9 @@ class PassthroughScriptedThread(ScriptedThread):
if self.driving_thread.GetStopReason() != lldb.eStopReasonNone:
if "arm64" in self.originating_process.arch:
stop_reason["type"] = lldb.eStopReasonException
stop_reason["data"][
"desc"
] = self.driving_thread.GetStopDescription(100)
stop_reason["data"]["desc"] = (
self.driving_thread.GetStopDescription(100)
)
elif self.originating_process.arch == "x86_64":
stop_reason["type"] = lldb.eStopReasonSignal
stop_reason["data"]["signal"] = signal.SIGTRAP

View File

@@ -14,6 +14,9 @@ from lldbsuite.test import lldbtest
class ScriptedProcessEmptyMemoryRegion(TestBase):
NO_DEBUG_INFO_TESTCASE = True
# imports examples/python/templates/scripted_process.py
# which only has register definitions for x86_64 and arm64.
@skipIf(archs=no_match(["arm64", "x86_64"]))
def test_scripted_process_empty_memory_region(self):
"""Test that lldb handles an empty SBMemoryRegionInfo object from
a scripted process plugin."""