Skip to content

Commit fda4a32

Browse files
committed
[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.
1 parent e543650 commit fda4a32

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

lldb/examples/python/templates/scripted_process.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class ScriptedProcess(metaclass=ABCMeta):
8-
98
"""
109
The base class for a scripted process.
1110
@@ -229,7 +228,6 @@ def create_breakpoint(self, addr, error):
229228

230229

231230
class ScriptedThread(metaclass=ABCMeta):
232-
233231
"""
234232
The base class for a scripted thread.
235233
@@ -357,7 +355,10 @@ def get_register_info(self):
357355
if self.originating_process.arch == "x86_64":
358356
self.register_info["sets"] = ["General Purpose Registers"]
359357
self.register_info["registers"] = INTEL64_GPR
360-
elif "arm64" in self.originating_process.arch:
358+
elif (
359+
"arm64" in self.originating_process.arch
360+
or self.originating_process.arch == "aarch64"
361+
):
361362
self.register_info["sets"] = ["General Purpose Registers"]
362363
self.register_info["registers"] = ARM64_GPR
363364
else:
@@ -411,9 +412,9 @@ def __init__(self, exe_ctx, args, launched_driving_process=True):
411412
)
412413
)
413414

414-
self.threads[
415-
driving_thread.GetThreadID()
416-
] = PassthroughScriptedThread(self, structured_data)
415+
self.threads[driving_thread.GetThreadID()] = (
416+
PassthroughScriptedThread(self, structured_data)
417+
)
417418

418419
for module in self.driving_target.modules:
419420
path = module.file.fullpath
@@ -507,9 +508,9 @@ def get_stop_reason(self):
507508
if self.driving_thread.GetStopReason() != lldb.eStopReasonNone:
508509
if "arm64" in self.originating_process.arch:
509510
stop_reason["type"] = lldb.eStopReasonException
510-
stop_reason["data"][
511-
"desc"
512-
] = self.driving_thread.GetStopDescription(100)
511+
stop_reason["data"]["desc"] = (
512+
self.driving_thread.GetStopDescription(100)
513+
)
513514
elif self.originating_process.arch == "x86_64":
514515
stop_reason["type"] = lldb.eStopReasonSignal
515516
stop_reason["data"]["signal"] = signal.SIGTRAP

lldb/test/API/functionalities/scripted_process_empty_memory_region/TestScriptedProcessEmptyMemoryRegion.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
class ScriptedProcessEmptyMemoryRegion(TestBase):
1515
NO_DEBUG_INFO_TESTCASE = True
1616

17+
# imports examples/python/templates/scripted_process.py
18+
# which only has register definitions for x86_64 and arm64.
19+
@skipIf(archs=no_match(["arm64", "x86_64"]))
1720
def test_scripted_process_empty_memory_region(self):
1821
"""Test that lldb handles an empty SBMemoryRegionInfo object from
1922
a scripted process plugin."""

0 commit comments

Comments
 (0)