[Lldb-commits] [lldb] r216473 - Added a couple more gdb-remote tests to ensure qProcessInfo on darwin is not defining triple.

Todd Fiala todd.fiala at gmail.com
Tue Aug 26 11:40:57 PDT 2014


Author: tfiala
Date: Tue Aug 26 13:40:56 2014
New Revision: 216473

URL: http://llvm.org/viewvc/llvm-project?rev=216473&view=rev
Log:
Added a couple more gdb-remote tests to ensure qProcessInfo on darwin is not defining triple.

And likewise for qProcessInfo on Linux, but ensures cputype/cpusubtype is not defined.  The
Apple case is the more important one, since we take a slightly different path to initialize
ProcessGDBRemote-related remote host/process info if triple is present.

Related to http://llvm.org/bugs/show_bug.cgi?id=20755.

Modified:
    lldb/trunk/test/tools/lldb-gdbserver/TestGdbRemoteProcessInfo.py

Modified: lldb/trunk/test/tools/lldb-gdbserver/TestGdbRemoteProcessInfo.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-gdbserver/TestGdbRemoteProcessInfo.py?rev=216473&r1=216472&r2=216473&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-gdbserver/TestGdbRemoteProcessInfo.py (original)
+++ lldb/trunk/test/tools/lldb-gdbserver/TestGdbRemoteProcessInfo.py Tue Aug 26 13:40:56 2014
@@ -128,6 +128,26 @@ class TestGdbRemoteProcessInfo(gdbremote
 
         self.assertEquals(missing_key_set, set(), "the listed keys are missing in the qProcessInfo result")
 
+    def qProcessInfo_does_not_contain_keys(self, absent_key_set):
+        procs = self.prep_debug_monitor_and_inferior()
+        self.add_process_info_collection_packets()
+
+        # Run the stream
+        context = self.expect_gdbremote_sequence()
+        self.assertIsNotNone(context)
+
+        # Gather process info response
+        process_info = self.parse_process_info_response(context)
+        self.assertIsNotNone(process_info)
+
+        # Ensure the unexpected keys are not present
+        unexpected_key_set = set()
+        for unexpected_key in absent_key_set:
+            if unexpected_key in process_info:
+                unexpected_key_set.add(unexpected_key)
+
+        self.assertEquals(unexpected_key_set, set(), "the listed keys were present but unexpected in qProcessInfo result")
+
     @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @debugserver_test
     @dsym_test
@@ -144,6 +164,25 @@ class TestGdbRemoteProcessInfo(gdbremote
         self.buildDwarf()
         self.qProcessInfo_contains_keys(set(['triple']))
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @debugserver_test
+    @dsym_test
+    def test_qProcessInfo_does_not_contain_triple_debugserver_darwin(self):
+        self.init_debugserver_test()
+        self.buildDsym()
+        # We don't expect to see triple on darwin.  If we do, we'll prefer triple
+        # to cputype/cpusubtype and skip some darwin-based ProcessGDBRemote ArchSpec setup
+        # for the remote Host and Process.
+        self.qProcessInfo_does_not_contain_keys(set(['triple']))
+
+    @unittest2.skipUnless(sys.platform.startswith("linux"), "requires Linux")
+    @llgs_test
+    @dwarf_test
+    def test_qProcessInfo_does_not_contain_cputype_cpusubtype_llgs_linux(self):
+        self.init_llgs_test()
+        self.buildDwarf()
+        self.qProcessInfo_does_not_contain_keys(set(['cputype', 'cpusubtype']))
+
 
 if __name__ == '__main__':
     unittest2.main()





More information about the lldb-commits mailing list