[Lldb-commits] [PATCH] D114156: [lldb/test] Add ability to terminate connection from a gdb-client handler

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 18 06:20:37 PST 2021


mgorny added inline comments.


================
Comment at: lldb/packages/Python/lldbsuite/test/gdbclientutils.py:89
     packetLog = None
+    RESPONSE_DISCONNECT = object()
 
----------------
How about making it a class instead? It should make debugging easier, if it ever comes to that.

```
In [6]: RESPONSE_DISCONNECT = object()

In [7]: RESPONSE_DISCONNECT
Out[7]: <object at 0x7f406dd328e0>

In [8]: class RESPONSE_DISCONNECT: pass

In [9]: RESPONSE_DISCONNECT
Out[9]: __main__.RESPONSE_DISCONNECT
```


================
Comment at: lldb/packages/Python/lldbsuite/test/gdbclientutils.py:611
+            if part is MockGDBServerResponder.RESPONSE_DISCONNECT:
+                raise self.TerminateConnectionException
+            self._sendPacket(part)
----------------
It feels weird that you're raising class rather than an object.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114156/new/

https://reviews.llvm.org/D114156



More information about the lldb-commits mailing list