[Lldb-commits] [PATCH] D109937: [lldb] Handle malformed qfThreadInfo reply
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 17 00:46:51 PDT 2021
labath added a reviewer: mgorny.
labath added a comment.
+1 for the test. It should be fairly easy to rig up a "gdb-remote client" test that sends such a packet.
================
Comment at: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp:2909-2917
+ if (!pid_tid) {
+ // if ids is empty, this is an error
+ if (ids.size() == 0)
+ return {};
+ // if ids is not empty, bail out from here and process ids
+ break;
+ }
----------------
clayborg wrote:
> Might be nice to make sure we got LLDB_INVALID_PROCESS_ID back, as it might not always be zero?
pid == LLDB_INVALID_PROCESS_ID is a valid response if the stub does not support the multiprocess syntax. pid == GetPID() is a valid response if it supports it. IIRC, further validation/interpretation of these values is done in the caller.
================
Comment at: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp:2911-2912
+ // if ids is empty, this is an error
+ if (ids.size() == 0)
+ return {};
+ // if ids is not empty, bail out from here and process ids
----------------
Isn't it still possible to get the infinite recursion you mentioned, if the response consists only of a single comma ?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109937/new/
https://reviews.llvm.org/D109937
More information about the lldb-commits
mailing list