summaryrefslogtreecommitdiffstats
path: root/lldb/test/tools/lldb-gdbserver/lldbgdbserverutils.py
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-05-19 18:30:48 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-05-19 18:30:48 +0000
commit76e1bf53b4c208b9b6adb08e81ebaea0ccf7610d (patch)
tree40f46b0dd78245ffd5094fac9824b01b6f621a33 /lldb/test/tools/lldb-gdbserver/lldbgdbserverutils.py
parent68a889757dec7f4b6d7e2e87863f3152bb0603c3 (diff)
downloadbcm5719-llvm-76e1bf53b4c208b9b6adb08e81ebaea0ccf7610d.tar.gz
bcm5719-llvm-76e1bf53b4c208b9b6adb08e81ebaea0ccf7610d.zip
Revert r209142.
Need to spend a little more time with suppressing the debugserver 64-to-32 bit warnings. Will re-submit after I get the warnings properly suppressed. llvm-svn: 209151
Diffstat (limited to 'lldb/test/tools/lldb-gdbserver/lldbgdbserverutils.py')
-rw-r--r--lldb/test/tools/lldb-gdbserver/lldbgdbserverutils.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/lldb/test/tools/lldb-gdbserver/lldbgdbserverutils.py b/lldb/test/tools/lldb-gdbserver/lldbgdbserverutils.py
index 8a70e7b8d71..8e899eb71fe 100644
--- a/lldb/test/tools/lldb-gdbserver/lldbgdbserverutils.py
+++ b/lldb/test/tools/lldb-gdbserver/lldbgdbserverutils.py
@@ -149,16 +149,22 @@ def expect_lldb_gdbserver_replay(
elements specified to any GdbRemoteEntry instances in
test_sequence.
"""
+
+ # Ensure we have some work to do.
+ if len(sequence_entry) < 1:
+ return {}
+
received_lines = []
receive_buffer = ''
context = {}
- for sequence_entry in test_sequence.entries:
- if sequence_entry.is_send_to_remote:
+ sequence_entry = test_sequence.entries.pop(0)
+ while sequence_entry:
+ if sequence_entry.is_send_to_remote():
# This is an entry to send to the remote debug monitor.
if logger:
logger.info("sending packet to remote: {}".format(sequence_entry.exact_payload))
- sock.sendall(sequence_entry.exact_payload)
+ sock.sendall(sequence_entry.get_send_packet())
else:
# This is an entry to expect to receive from the remote debug monitor.
if logger:
@@ -208,6 +214,14 @@ def expect_lldb_gdbserver_replay(
if len(received_lines) > 0:
received_packet = received_lines.pop(0)
context = sequence_entry.assert_match(asserter, received_packet, context=context)
+
+ # Move on to next sequence entry as needed. Some sequence entries support executing multiple
+ # times in different states (for looping over query/response packets).
+ if sequence_entry.is_consumed():
+ if len(test_sequence.entries) > 0:
+ sequence_entry = test_sequence.entries.pop(0)
+ else:
+ sequence_entry = None
return context
OpenPOWER on IntegriCloud