Some tests set settings and don't clean them up, this leads to side effects in other tests. The patch removes a global debugger instance with a per-test debugger to avoid such effects. From what I see, lldb.DBG was needed to determine the platform before a test is run, lldb.selected_platform is used for this purpose now. Though, this required adding a new function to the SBPlatform interface. Differential Revision: https://reviews.llvm.org/D74903
21 lines
650 B
Python
21 lines
650 B
Python
import lldb
|
|
from lldbsuite.test.lldbtest import *
|
|
from lldbsuite.test.decorators import *
|
|
from gdbclientutils import *
|
|
|
|
|
|
class TestqOffsets(GDBRemoteTestBase):
|
|
|
|
class Responder(MockGDBServerResponder):
|
|
def qOffsets(self):
|
|
return 'Text=470000;Data=470000'
|
|
|
|
def test(self):
|
|
self.server.responder = TestqOffsets.Responder()
|
|
target = self.createTarget("qOffsets.yaml")
|
|
text = target.modules[0].FindSection(".text")
|
|
self.assertEquals(text.GetLoadAddress(target), lldb.LLDB_INVALID_ADDRESS)
|
|
|
|
process = self.connect(target)
|
|
self.assertEquals(text.GetLoadAddress(target), 0x471000)
|