clayborg added inline comments.

================
Comment at: 
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp:689-706
       const size_t bytes_len = m_bytes.size();
       bool done = false;
       uint32_t idx;
-      for (idx = 1; !done && idx < bytes_len; ++idx) {
+      for (idx = 1; !done && idx < bytes_len;) {
         switch (m_bytes[idx]) {
         case '+':
         case '-':
----------------
This might be more easily and cleanly done with:
```
const idx = m_bytes.find_first_of("+-\x03%$");
if (idx != 0) {
      LLDB_LOGF(log, "GDBRemoteCommunication::%s tossing %u junk bytes: '%.*s'",
                __FUNCTION__, idx, idx, m_bytes.c_str());
      m_bytes.erase(0, idx);
}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116009

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to