[Lldb-commits] [lldb] [lldb] Claim to support swbreak and hwbreak packets when debugging a gdbremote (PR #102873)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 12 03:30:15 PDT 2024


================
@@ -2349,6 +2349,9 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
         if (!value.getAsInteger(0, addressing_bits)) {
           addressable_bits.SetHighmemAddressableBits(addressing_bits);
         }
+      } else if (key.compare("swbreak") == 0 || key.compare("hwbreak") == 0) {
+        // There is nothing needs to be done for swbreak or hwbreak since
+        // the value is expected to be empty
----------------
DavidSpickett wrote:

This code is run by lldb when parsing a stop packet from the gdbserver, so this comment should also note that lldb's default is to act in the same way as swbreak or hwbreak does, that's why we take no action on it here.

I think making this whole thing a comment is also a good idea, so we don't trip up static analysis tools. Best place for it I think is after the last else if, something like:

```
// swbreak and hwbreak are also expected keys, but we don't need to change our behaviour for them because...
```

https://github.com/llvm/llvm-project/pull/102873


More information about the lldb-commits mailing list