[Lldb-commits] [lldb] r207492 - Added debugserver/llgs protocol test for output and clean exit.
Todd Fiala
todd.fiala at gmail.com
Mon Apr 28 22:01:02 PDT 2014
Author: tfiala
Date: Tue Apr 29 00:01:01 2014
New Revision: 207492
URL: http://llvm.org/viewvc/llvm-project?rev=207492&view=rev
Log:
Added debugserver/llgs protocol test for output and clean exit.
Tests for $vCont;c program start, $O output and $W status code.
@llgs_test variant currently marked as expected fail.
Modified:
lldb/trunk/test/tools/lldb-gdbserver/TestLldbGdbServer.py
Modified: lldb/trunk/test/tools/lldb-gdbserver/TestLldbGdbServer.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-gdbserver/TestLldbGdbServer.py?rev=207492&r1=207491&r2=207492&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-gdbserver/TestLldbGdbServer.py (original)
+++ lldb/trunk/test/tools/lldb-gdbserver/TestLldbGdbServer.py Tue Apr 29 00:01:01 2014
@@ -205,5 +205,44 @@ class LldbGdbServerTestCase(TestBase):
self.buildDwarf()
self.start_inferior()
+ def inferior_print_exit(self):
+ server = self.start_server()
+ self.assertIsNotNone(server)
+
+ # TODO grab the build output directory rather than current directory.
+ inferior_exe_name = os.path.abspath('a.out')
+ inferior_exe_name_hex = gdbremote_hex_encode_string(inferior_exe_name)
+
+ log_lines = self.create_no_ack_remote_stream()
+ log_lines.extend([
+ "lldb-gdbserver < 000> read packet: {}".format(
+ gdbremote_packet_encode_string(
+ "A{},0,{}".format(len(inferior_exe_name_hex), inferior_exe_name_hex))),
+ "lldb-gdbserver < 6> send packet: $OK#00",
+ "lldb-gdbserver < 18> read packet: $qLaunchSuccess#a5",
+ "lldb-gdbserver < 6> send packet: $OK#00",
+ "lldb-gdbserver < 5> read packet: $vCont;c#00",
+ "lldb-gdbserver < 7> send packet: $O{}#00".format(gdbremote_hex_encode_string("hello, world\r\n")),
+ "lldb-gdbserver < 7> send packet: $W00#00"])
+
+ expect_lldb_gdbserver_replay(self, self.sock, log_lines, True,
+ self._TIMEOUT_SECONDS, self.logger)
+
+ @debugserver_test
+ @dsym_test
+ def test_inferior_print_exit_debugserver_dsym(self):
+ self.init_debugserver_test()
+ self.buildDsym()
+ self.inferior_print_exit()
+
+ @llgs_test
+ @dwarf_test
+ @unittest2.expectedFailure()
+ def test_inferior_print_exit_llgs_dwarf(self):
+ self.init_llgs_test()
+ self.buildDwarf()
+ self.inferior_print_exit()
+
+
if __name__ == '__main__':
unittest2.main()
More information about the lldb-commits
mailing list