[all-commits] [llvm/llvm-project] 02ef0f: [lldb] [gdb-remote client] Refactor SetCurrentThre...

Michał Górny via All-commits all-commits at lists.llvm.org
Fri Jul 2 05:36:50 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 02ef0f5ab483875b7b6b38e24b245e4fd4053959
      https://github.com/llvm/llvm-project/commit/02ef0f5ab483875b7b6b38e24b245e4fd4053959
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2021-07-02 (Fri, 02 Jul 2021)

  Changed paths:
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
    M lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp

  Log Message:
  -----------
  [lldb] [gdb-remote client] Refactor SetCurrentThread*()

Refactor SetCurrentThread() and SetCurrentThreadForRun() to reduce code
duplication and simplify it.  Both methods now call common
SendSetCurrentThreadPacket() that implements the common protocol
exchange part (the only variable is sending `Hg` vs `Hc`) and returns
the selected TID.  The logic is rewritten to use a StreamString
instead of snprintf().

A side effect of the change is that thread-id sent is now zero-padded.
However, this should not have practical impact on the server as both
forms are equivalent.

Differential Revision: https://reviews.llvm.org/D100459




More information about the All-commits mailing list