Skip to content

Commit

Permalink
[lldb] Only run scripted process test on x86_64/arm64
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jasonmolenda committed Nov 15, 2024
1 parent e543650 commit fda4a32
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lldb/examples/python/templates/scripted_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class ScriptedProcess(metaclass=ABCMeta):

"""
The base class for a scripted process.
Expand Down Expand Up @@ -229,7 +228,6 @@ def create_breakpoint(self, addr, error):


class ScriptedThread(metaclass=ABCMeta):

"""
The base class for a scripted thread.
Expand Down Expand Up @@ -357,7 +355,10 @@ def get_register_info(self):
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:
Expand Down Expand Up @@ -411,9 +412,9 @@ def __init__(self, exe_ctx, args, launched_driving_process=True):
)
)

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
Expand Down Expand Up @@ -507,9 +508,9 @@ def get_stop_reason(self):
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
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."""
Expand Down

0 comments on commit fda4a32

Please sign in to comment.