[Lldb-commits] [PATCH] D48868: [LLDB] In ProcessGDBRemote::UpdateThreadIDList(), the thread PCs should not be cleared after they are updated from the stop reply packet

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 9 13:40:15 PDT 2018

jasonmolenda added a comment.

I could imagine there being a bug in this ProcessGDBRemote::UpdateThreadIDList -> ProcessGDBRemote::UpdateThreadIDsFromStopReplyThreadsValue sequence when talking to a gdb-remote stub that does not implement the lldb-enhancement jThreadsInfo.  If jThreadsInfo isn't implemented, we fall back to looking for the thread-pcs: and threads: key-value pairs in the stop packet that we received.  We clear m_thread_pcs, then look if thread-pcs: is present (that's one bug) to add all the thread pc values.  After that, we look for the threads: list and if it is present, we call UpdateThreadIDsFromStopReplyThreadsValue which clears m_thread_pcs again (bug #2) and then adds any threads listed to the m_thread_ids.

I could believe there are problems here if we're talking to a gdb-remote that doesn't support jThreadsInfo but does provide threads: or thread-pcs: maybe?  It'd be interesting to see what the packet log for a stop packet is showing, and what exactly the gdb-remote stub is.


More information about the lldb-commits mailing list