This revision was automatically updated to reflect the committed changes.
Closed by commit rL328485: Add a test for setting the load address of a module 
with differing… (authored by labath, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D44738

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py


Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py
===================================================================
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py
@@ -6,6 +6,25 @@
 
 class TestGDBRemoteLoad(GDBRemoteTestBase):
 
+    def setUp(self):
+        super(TestGDBRemoteLoad, self).setUp()
+        self._initial_platform = lldb.DBG.GetSelectedPlatform()
+
+    def tearDown(self):
+        lldb.DBG.SetSelectedPlatform(self._initial_platform)
+        super(TestGDBRemoteLoad, self).tearDown()
+
+    def test_module_load_address(self):
+        """Test that setting the load address of a module uses virtual 
addresses"""
+        target = self.createTarget("a.yaml")
+        process = self.connect(target)
+        module = target.GetModuleAtIndex(0)
+        self.assertTrue(module.IsValid())
+        self.assertTrue(target.SetModuleLoadAddress(module, 0).Success())
+        address = target.ResolveLoadAddress(0x2001)
+        self.assertTrue(address.IsValid())
+        self.assertEqual(".data", address.GetSection().GetName())
+
     def test_ram_load(self):
         """Test loading an object file to a target's ram"""
         target = self.createTarget("a.yaml")


Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py
@@ -6,6 +6,25 @@
 
 class TestGDBRemoteLoad(GDBRemoteTestBase):
 
+    def setUp(self):
+        super(TestGDBRemoteLoad, self).setUp()
+        self._initial_platform = lldb.DBG.GetSelectedPlatform()
+
+    def tearDown(self):
+        lldb.DBG.SetSelectedPlatform(self._initial_platform)
+        super(TestGDBRemoteLoad, self).tearDown()
+
+    def test_module_load_address(self):
+        """Test that setting the load address of a module uses virtual addresses"""
+        target = self.createTarget("a.yaml")
+        process = self.connect(target)
+        module = target.GetModuleAtIndex(0)
+        self.assertTrue(module.IsValid())
+        self.assertTrue(target.SetModuleLoadAddress(module, 0).Success())
+        address = target.ResolveLoadAddress(0x2001)
+        self.assertTrue(address.IsValid())
+        self.assertEqual(".data", address.GetSection().GetName())
+
     def test_ram_load(self):
         """Test loading an object file to a target's ram"""
         target = self.createTarget("a.yaml")
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to