gdb-remote testing: new test, cleaned up socket reading.
authorTodd Fiala <todd.fiala@gmail.com>
Thu, 29 May 2014 20:44:45 +0000 (20:44 +0000)
committerTodd Fiala <todd.fiala@gmail.com>
Thu, 29 May 2014 20:44:45 +0000 (20:44 +0000)
commit0428c978376cfdee8a774521f52bfc29efb6374e
tree4ea3cea6840db85ed4576191f15987463ac0abca
parent9ede702bc4ef97df625c0e69be225f1fd5a6a55c
gdb-remote testing: new test, cleaned up socket reading.

Added new SocketPacketPump class to decouple gdb remote packet
reading from packet expectations code.  This allowed for cleaner
implementation of the separate $O output streams (non-deterministic
packaging of inferior stdout/stderr) from all the rest of the packets.

Added a packet expectation matcher that can match expected accumulated
output with a timeout.  Use a dictionary with "type":"output_match".
See lldbgdbserverutils.MatchRemoteOutputEntry for details.

Added a gdb remote test to verify that $Hc (continue thread selection)
plus signal delivery ($C{signo}) works.  Having trouble getting this
to pass with debugserver on MacOSX 10.9.  Tried different variants,
including $vCont;C{signo}:{thread-id};c.  In some cases, I get the
test exe's signal handler to run ($vCont variant first time), in others I don't
($vCont second and further times).  $C{signo} doesn't hit the signal
handler code at all in the test exe but delivers a stop.  Further
$Hc and $C{signo} deliver the stop marking the wrong thread.  For now I'm
marking the test as XFAIL on dsym/debugserver.  Will revisit this on
lldb-dev.

Updated the text exe for these tests to support thread:print-ids (each
thread announces its thread id) and provide a SIGUSR1 thread handler
that prints out the thread id on which it was signaled.

llvm-svn: 209845
lldb/test/tools/lldb-gdbserver/Makefile
lldb/test/tools/lldb-gdbserver/TestLldbGdbServer.py
lldb/test/tools/lldb-gdbserver/lldbgdbserverutils.py
lldb/test/tools/lldb-gdbserver/main.cpp
lldb/test/tools/lldb-gdbserver/socket_packet_pump.py [new file with mode: 0644]