diff --git a/lldb/test/API/functionalities/gdb_remote_client/gdbclientutils.py b/lldb/packages/Python/lldbsuite/test/gdbclientutils.py rename from lldb/test/API/functionalities/gdb_remote_client/gdbclientutils.py rename to lldb/packages/Python/lldbsuite/test/gdbclientutils.py --- a/lldb/test/API/functionalities/gdb_remote_client/gdbclientutils.py +++ b/lldb/packages/Python/lldbsuite/test/gdbclientutils.py @@ -1,17 +1,10 @@ import ctypes import errno import io -import os -import os.path import threading import socket -import lldb -import binascii import traceback from lldbsuite.support import seven -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbtest_config - def checksum(message): """ @@ -618,100 +611,3 @@ class InvalidPacketException(Exception): pass - -class GDBRemoteTestBase(TestBase): - """ - Base class for GDB client tests. - - This class will setup and start a mock GDB server for the test to use. - It also provides assertPacketLogContains, which simplifies the checking - of packets sent by the client. - """ - - NO_DEBUG_INFO_TESTCASE = True - mydir = TestBase.compute_mydir(__file__) - server = None - server_socket_class = TCPServerSocket - - def setUp(self): - TestBase.setUp(self) - self.server = MockGDBServer(socket_class=self.server_socket_class) - self.server.start() - - def tearDown(self): - # TestBase.tearDown will kill the process, but we need to kill it early - # so its client connection closes and we can stop the server before - # finally calling the base tearDown. - if self.process() is not None: - self.process().Kill() - self.server.stop() - TestBase.tearDown(self) - - def createTarget(self, yaml_path): - """ - Create a target by auto-generating the object based on the given yaml - instructions. - - This will track the generated object so it can be automatically removed - during tearDown. - """ - yaml_base, ext = os.path.splitext(yaml_path) - obj_path = self.getBuildArtifact(yaml_base) - self.yaml2obj(yaml_path, obj_path) - return self.dbg.CreateTarget(obj_path) - - def connect(self, target): - """ - Create a process by connecting to the mock GDB server. - - Includes assertions that the process was successfully created. - """ - listener = self.dbg.GetListener() - error = lldb.SBError() - process = target.ConnectRemote(listener, - self.server.get_connect_url(), "gdb-remote", error) - self.assertTrue(error.Success(), error.description) - self.assertTrue(process, PROCESS_IS_VALID) - return process - - def assertPacketLogContains(self, packets): - """ - Assert that the mock server's packet log contains the given packets. - - The packet log includes all packets sent by the client and received - by the server. This fuction makes it easy to verify that the client - sent the expected packets to the server. - - The check does not require that the packets be consecutive, but does - require that they are ordered in the log as they ordered in the arg. - """ - i = 0 - j = 0 - log = self.server.responder.packetLog - - while i < len(packets) and j < len(log): - if log[j] == packets[i]: - i += 1 - j += 1 - if i < len(packets): - self.fail(u"Did not receive: %s\nLast 10 packets:\n\t%s" % - (packets[i], u'\n\t'.join(log))) - - -class GDBPlatformClientTestBase(GDBRemoteTestBase): - """ - Base class for platform server clients. - - This class extends GDBRemoteTestBase by automatically connecting - via "platform connect" in the setUp() method. - """ - - def setUp(self): - super().setUp() - self.runCmd("platform select remote-gdb-server") - self.runCmd("platform connect " + self.server.get_connect_url()) - self.assertTrue(self.dbg.GetSelectedPlatform().IsConnected()) - - def tearDown(self): - self.dbg.GetSelectedPlatform().DisconnectRemote() - super().tearDown() diff --git a/lldb/packages/Python/lldbsuite/test/lldbgdbclient.py b/lldb/packages/Python/lldbsuite/test/lldbgdbclient.py new file mode 100644 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lldbgdbclient.py @@ -0,0 +1,101 @@ +import os +import os.path +import lldb +from lldbsuite.test.lldbtest import * +from lldbsuite.test.gdbclientutils import * + +class GDBRemoteTestBase(TestBase): + """ + Base class for GDB client tests. + + This class will setup and start a mock GDB server for the test to use. + It also provides assertPacketLogContains, which simplifies the checking + of packets sent by the client. + """ + + NO_DEBUG_INFO_TESTCASE = True + server = None + server_socket_class = TCPServerSocket + + def setUp(self): + TestBase.setUp(self) + self.server = MockGDBServer(socket_class=self.server_socket_class) + self.server.start() + + def tearDown(self): + # TestBase.tearDown will kill the process, but we need to kill it early + # so its client connection closes and we can stop the server before + # finally calling the base tearDown. + if self.process() is not None: + self.process().Kill() + self.server.stop() + TestBase.tearDown(self) + + def createTarget(self, yaml_path): + """ + Create a target by auto-generating the object based on the given yaml + instructions. + + This will track the generated object so it can be automatically removed + during tearDown. + """ + yaml_base, ext = os.path.splitext(yaml_path) + obj_path = self.getBuildArtifact(yaml_base) + self.yaml2obj(yaml_path, obj_path) + return self.dbg.CreateTarget(obj_path) + + def connect(self, target): + """ + Create a process by connecting to the mock GDB server. + + Includes assertions that the process was successfully created. + """ + listener = self.dbg.GetListener() + error = lldb.SBError() + process = target.ConnectRemote(listener, + self.server.get_connect_url(), "gdb-remote", error) + self.assertTrue(error.Success(), error.description) + self.assertTrue(process, PROCESS_IS_VALID) + return process + + def assertPacketLogContains(self, packets): + """ + Assert that the mock server's packet log contains the given packets. + + The packet log includes all packets sent by the client and received + by the server. This fuction makes it easy to verify that the client + sent the expected packets to the server. + + The check does not require that the packets be consecutive, but does + require that they are ordered in the log as they ordered in the arg. + """ + i = 0 + j = 0 + log = self.server.responder.packetLog + + while i < len(packets) and j < len(log): + if log[j] == packets[i]: + i += 1 + j += 1 + if i < len(packets): + self.fail(u"Did not receive: %s\nLast 10 packets:\n\t%s" % + (packets[i], u'\n\t'.join(log))) + + +class GDBPlatformClientTestBase(GDBRemoteTestBase): + """ + Base class for platform server clients. + + This class extends GDBRemoteTestBase by automatically connecting + via "platform connect" in the setUp() method. + """ + + def setUp(self): + super().setUp() + self.runCmd("platform select remote-gdb-server") + self.runCmd("platform connect " + self.server.get_connect_url()) + self.assertTrue(self.dbg.GetSelectedPlatform().IsConnected()) + + def tearDown(self): + self.dbg.GetSelectedPlatform().DisconnectRemote() + super().tearDown() diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestAArch64XMLRegOffsets.py b/lldb/test/API/functionalities/gdb_remote_client/TestAArch64XMLRegOffsets.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestAArch64XMLRegOffsets.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestAArch64XMLRegOffsets.py @@ -3,7 +3,8 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class MyResponder(MockGDBServerResponder): @@ -92,6 +93,8 @@ class TestAArch64XMLRegOffsets(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing @skipIfRemote @skipIfLLVMTargetMissing("AArch64") diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestArmRegisterDefinition.py b/lldb/test/API/functionalities/gdb_remote_client/TestArmRegisterDefinition.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestArmRegisterDefinition.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestArmRegisterDefinition.py @@ -2,10 +2,13 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestArmRegisterDefinition(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing @skipIfRemote def test(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestFork.py b/lldb/test/API/functionalities/gdb_remote_client/TestFork.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestFork.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestFork.py @@ -3,10 +3,14 @@ import unittest from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestMultiprocess(GDBRemoteTestBase): + + mydir = TestBase.compute_mydir(__file__) + def base_test(self, variant): class MyResponder(MockGDBServerResponder): def __init__(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py b/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py @@ -3,11 +3,14 @@ import os.path from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestGDBRemoteClient(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + class gPacketResponder(MockGDBServerResponder): registers = [ "name:rax;bitsize:64;offset:0;encoding:uint;format:hex;set:General Purpose Registers;ehframe:0;dwarf:0;", diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteDiskFileCompletion.py b/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteDiskFileCompletion.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteDiskFileCompletion.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteDiskFileCompletion.py @@ -1,7 +1,10 @@ -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBPlatformClientTestBase class TestGDBRemoteDiskFileCompletion(GDBPlatformClientTestBase): + mydir = GDBPlatformClientTestBase.compute_mydir(__file__) + def test_autocomplete_request(self): """Test remote disk completion on remote-gdb-server plugin""" diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteLoad.py b/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteLoad.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteLoad.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteLoad.py @@ -1,11 +1,14 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestGDBRemoteLoad(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @expectedFailureAll(archs=["aarch64"], oslist=["freebsd"], bugnumber="llvm.org/pr49414") def test_module_load_address(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemotePlatformFile.py b/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemotePlatformFile.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemotePlatformFile.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemotePlatformFile.py @@ -1,9 +1,11 @@ -from gdbclientutils import * - +from lldbsuite.test.gdbclientutils import * from lldbsuite.test.decorators import * +from lldbsuite.test.lldbgdbclient import GDBPlatformClientTestBase class TestGDBRemotePlatformFile(GDBPlatformClientTestBase): + mydir = GDBPlatformClientTestBase.compute_mydir(__file__) + def test_file(self): """Test mock operations on a remote file""" diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py b/lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py @@ -2,10 +2,14 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestGDBServerTargetXML(GDBRemoteTestBase): + + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing @skipIfRemote @skipIfLLVMTargetMissing("X86") diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestIOSSimulator.py b/lldb/test/API/functionalities/gdb_remote_client/TestIOSSimulator.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestIOSSimulator.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestIOSSimulator.py @@ -1,9 +1,13 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestIOSSimulator(GDBRemoteTestBase): + + mydir = TestBase.compute_mydir(__file__) + """ Test that an ios simulator process is recognized as such. """ diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestJLink6Armv7RegisterDefinition.py b/lldb/test/API/functionalities/gdb_remote_client/TestJLink6Armv7RegisterDefinition.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestJLink6Armv7RegisterDefinition.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestJLink6Armv7RegisterDefinition.py @@ -2,10 +2,13 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestJLink6Armv7RegisterDefinition(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing @skipIfRemote def test(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestMemoryRegionDirtyPages.py b/lldb/test/API/functionalities/gdb_remote_client/TestMemoryRegionDirtyPages.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestMemoryRegionDirtyPages.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestMemoryRegionDirtyPages.py @@ -1,11 +1,14 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestMemoryRegionDirtyPages(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing def test(self): class MyResponder(MockGDBServerResponder): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestMultiprocess.py b/lldb/test/API/functionalities/gdb_remote_client/TestMultiprocess.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestMultiprocess.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestMultiprocess.py @@ -3,10 +3,14 @@ import unittest from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestMultiprocess(GDBRemoteTestBase): + + mydir = TestBase.compute_mydir(__file__) + def test_qfThreadInfo(self): class MyResponder(MockGDBServerResponder): def qfThreadInfo(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestNestedRegDefinitions.py b/lldb/test/API/functionalities/gdb_remote_client/TestNestedRegDefinitions.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestNestedRegDefinitions.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestNestedRegDefinitions.py @@ -2,10 +2,13 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestNestedRegDefinitions(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing @skipIfRemote def test(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestNoGPacketSupported.py b/lldb/test/API/functionalities/gdb_remote_client/TestNoGPacketSupported.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestNoGPacketSupported.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestNoGPacketSupported.py @@ -2,7 +2,8 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase # This test case is testing three things: @@ -22,6 +23,8 @@ class TestNoGPacketSupported(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing def test(self): class MyResponder(MockGDBServerResponder): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py b/lldb/test/API/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py @@ -2,10 +2,13 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestNoWatchpointSupportInfo(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing @skipIfRemote def test(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestPartialGPacket.py b/lldb/test/API/functionalities/gdb_remote_client/TestPartialGPacket.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestPartialGPacket.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestPartialGPacket.py @@ -2,11 +2,14 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestPartialGPacket(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing @skipIfRemote def test(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformClient.py b/lldb/test/API/functionalities/gdb_remote_client/TestPlatformClient.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformClient.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestPlatformClient.py @@ -4,13 +4,16 @@ import time from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase def hexlify(string): return binascii.hexlify(string.encode()).decode() class TestPlatformClient(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + def test_process_list_with_all_users(self): """Test connecting to a remote linux platform""" diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformKill.py b/lldb/test/API/functionalities/gdb_remote_client/TestPlatformKill.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformKill.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestPlatformKill.py @@ -2,10 +2,13 @@ import time from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestPlatformKill(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfRemote @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr52451") def test_kill_different_platform(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py b/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py @@ -3,12 +3,15 @@ import os from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase @skipIfRemote class TestProcessConnect(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + NO_DEBUG_INFO_TESTCASE = True def test_gdb_remote_sync(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestPty.py b/lldb/test/API/functionalities/gdb_remote_client/TestPty.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestPty.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestPty.py @@ -1,7 +1,8 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase @skipIfWindows diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestQemuAArch64TargetXml.py b/lldb/test/API/functionalities/gdb_remote_client/TestQemuAArch64TargetXml.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestQemuAArch64TargetXml.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestQemuAArch64TargetXml.py @@ -1,7 +1,8 @@ from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * from textwrap import dedent +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class MyResponder(MockGDBServerResponder): def qXferRead(self, obj, annex, offset, length): @@ -52,6 +53,8 @@ class TestQemuAarch64TargetXml(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing @skipIfRemote @skipIfLLVMTargetMissing("AArch64") diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestRecognizeBreakpoint.py b/lldb/test/API/functionalities/gdb_remote_client/TestRecognizeBreakpoint.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestRecognizeBreakpoint.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestRecognizeBreakpoint.py @@ -1,10 +1,14 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestRecognizeBreakpoint(GDBRemoteTestBase): + + mydir = TestBase.compute_mydir(__file__) + """ This tests the case where the gdb-remote server doesn't support any of the thread-info packets, and just tells which thread got the stop signal with: diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestRegDefinitionInParts.py b/lldb/test/API/functionalities/gdb_remote_client/TestRegDefinitionInParts.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestRegDefinitionInParts.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestRegDefinitionInParts.py @@ -3,10 +3,13 @@ import time from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestRegDefinitionInParts(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing @skipIfRemote def test(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestRemoteRegNums.py b/lldb/test/API/functionalities/gdb_remote_client/TestRemoteRegNums.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestRemoteRegNums.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestRemoteRegNums.py @@ -2,7 +2,8 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase # This test case checks for register number mismatch between lldb and gdb stub. @@ -16,6 +17,8 @@ class TestRemoteRegNums(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing def test(self): class MyResponder(MockGDBServerResponder): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestRestartBug.py b/lldb/test/API/functionalities/gdb_remote_client/TestRestartBug.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestRestartBug.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestRestartBug.py @@ -2,11 +2,14 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestRestartBug(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @expectedFailureAll(bugnumber="llvm.org/pr24530") def test(self): """ diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestStopPCs.py b/lldb/test/API/functionalities/gdb_remote_client/TestStopPCs.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestStopPCs.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestStopPCs.py @@ -1,11 +1,14 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestStopPCs(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing def test(self): class MyResponder(MockGDBServerResponder): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestTargetXMLArch.py b/lldb/test/API/functionalities/gdb_remote_client/TestTargetXMLArch.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestTargetXMLArch.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestTargetXMLArch.py @@ -2,7 +2,8 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class MyResponder(MockGDBServerResponder): def qXferRead(self, obj, annex, offset, length): @@ -101,6 +102,8 @@ class TestTargetXMLArch(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfXmlSupportMissing @expectedFailureAll(archs=["i386"]) @skipIfRemote diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestThreadInfoTrailingComma.py b/lldb/test/API/functionalities/gdb_remote_client/TestThreadInfoTrailingComma.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestThreadInfoTrailingComma.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestThreadInfoTrailingComma.py @@ -1,11 +1,13 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * - +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestThreadInfoTrailingComma(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + def test(self): class MyResponder(MockGDBServerResponder): def haltReason(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestThreadSelectionBug.py b/lldb/test/API/functionalities/gdb_remote_client/TestThreadSelectionBug.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestThreadSelectionBug.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestThreadSelectionBug.py @@ -1,10 +1,14 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestThreadSelectionBug(GDBRemoteTestBase): + + mydir = TestBase.compute_mydir(__file__) + def test(self): class MyResponder(MockGDBServerResponder): def cont(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestWasm.py b/lldb/test/API/functionalities/gdb_remote_client/TestWasm.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestWasm.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestWasm.py @@ -2,7 +2,8 @@ import binascii from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase LLDB_INVALID_ADDRESS = lldb.LLDB_INVALID_ADDRESS load_address = 0x400000000 @@ -86,6 +87,8 @@ class TestWasm(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + @skipIfAsan @skipIfXmlSupportMissing def test_load_module_with_embedded_symbols_from_remote(self): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestWriteMemory.py b/lldb/test/API/functionalities/gdb_remote_client/TestWriteMemory.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestWriteMemory.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestWriteMemory.py @@ -1,11 +1,13 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * - +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestWriteMemory(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + def test(self): class MyResponder(MockGDBServerResponder): diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py b/lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py --- a/lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py @@ -1,11 +1,13 @@ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * -from gdbclientutils import * - +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase class TestqOffsets(GDBRemoteTestBase): + mydir = TestBase.compute_mydir(__file__) + class Responder(MockGDBServerResponder): def qOffsets(self): return 'Text=470000;Data=470000'