
RFC https://discourse.llvm.org/t/rfc-python-callback-for-target-get-module/71580 SBFileSpec and SBModuleSpec will be used for locate module callback as Python function arguments. This diff allows these things. - Can be instantiated from SBPlatform. - Can be passed to/from Python. - Can be accessed for object offset and size. Differential Revision: https://reviews.llvm.org/D153733
25 lines
722 B
Python
25 lines
722 B
Python
"""
|
|
Test some SBModuleSpec APIs.
|
|
"""
|
|
|
|
import lldb
|
|
from lldbsuite.test.decorators import *
|
|
from lldbsuite.test.lldbtest import *
|
|
|
|
|
|
class ModuleSpecAPIsTestCase(TestBase):
|
|
def test_object_offset_and_size(self):
|
|
module_spec = lldb.SBModuleSpec()
|
|
self.assertEqual(module_spec.GetObjectOffset(), 0)
|
|
self.assertEqual(module_spec.GetObjectSize(), 0)
|
|
|
|
module_spec.SetObjectOffset(4096)
|
|
self.assertEqual(module_spec.GetObjectOffset(), 4096)
|
|
|
|
module_spec.SetObjectSize(3600)
|
|
self.assertEqual(module_spec.GetObjectSize(), 3600)
|
|
|
|
module_spec.Clear()
|
|
self.assertEqual(module_spec.GetObjectOffset(), 0)
|
|
self.assertEqual(module_spec.GetObjectSize(), 0)
|