CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
72 lines
2.7 KiB
Python
72 lines
2.7 KiB
Python
"""
|
|
Test that the arm64 ADRP + ADD pc-relative addressing pair is symbolicated.
|
|
"""
|
|
|
|
from lldbsuite.test.decorators import *
|
|
from lldbsuite.test.lldbtest import *
|
|
from lldbsuite.test import lldbutil
|
|
|
|
|
|
class TestAArch64AdrpAdd(TestBase):
|
|
@no_debug_info_test
|
|
@skipIfLLVMTargetMissing("AArch64")
|
|
def test_arm64(self):
|
|
src_dir = self.getSourceDir()
|
|
yaml_path = os.path.join(src_dir, "a.out-arm64.yaml")
|
|
obj_path = self.getBuildArtifact("a.out-arm64")
|
|
self.yaml2obj(yaml_path, obj_path)
|
|
|
|
target = self.dbg.CreateTarget(obj_path)
|
|
self.assertTrue(target, VALID_TARGET)
|
|
|
|
mains = target.FindFunctions("main")
|
|
for f in mains.symbols:
|
|
binaryname = f.GetStartAddress().GetModule().GetFileSpec().GetFilename()
|
|
if binaryname == "a.out-arm64":
|
|
self.disassemble_check_for_hi_and_foo(target, f, binaryname)
|
|
|
|
@no_debug_info_test
|
|
@skipIfLLVMTargetMissing("AArch64")
|
|
def test_arm64_32(self):
|
|
src_dir = self.getSourceDir()
|
|
yaml_path = os.path.join(src_dir, "a.out-arm64_32.yaml")
|
|
obj_path = self.getBuildArtifact("a.out-arm64_32")
|
|
self.yaml2obj(yaml_path, obj_path)
|
|
|
|
target = self.dbg.CreateTarget(obj_path)
|
|
self.assertTrue(target, VALID_TARGET)
|
|
|
|
mains = target.FindFunctions("main")
|
|
for f in mains.symbols:
|
|
binaryname = f.GetStartAddress().GetModule().GetFileSpec().GetFilename()
|
|
if binaryname == "a.out-arm64_32":
|
|
self.disassemble_check_for_hi_and_foo(target, f, binaryname)
|
|
|
|
def disassemble_check_for_hi_and_foo(self, target, func, binaryname):
|
|
insns = func.GetInstructions(target)
|
|
found_hi_string = False
|
|
found_foo = False
|
|
|
|
# The binary has an ADRP + ADD instruction pair which load
|
|
# the pc-relative address of a c-string, and loads the address
|
|
# of a function into a function pointer. lldb should show
|
|
# that c-string and the name of that function in the disassembly
|
|
# comment field.
|
|
for i in insns:
|
|
if "HI" in i.GetComment(target):
|
|
found_hi_string = True
|
|
if "foo" in i.GetComment(target):
|
|
found_foo = True
|
|
if not found_hi_string or not found_foo:
|
|
print(
|
|
'Did not find "HI" string or "foo" in disassembly symbolication in %s'
|
|
% binaryname
|
|
)
|
|
if self.TraceOn():
|
|
strm = lldb.SBStream()
|
|
insns.GetDescription(strm)
|
|
print('Disassembly of main(), looking for "HI" and "foo" in comments:')
|
|
print(strm.GetData())
|
|
self.assertTrue(found_hi_string)
|
|
self.assertTrue(found_foo)
|