[Lldb-commits] [PATCH] D23802: gdb-remote: Make the sequence mutex non-recursive

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 23 06:31:19 PDT 2016


labath created this revision.
labath added a reviewer: clayborg.
labath added a subscriber: lldb-commits.

This is a preparatory commit for D22914, where I'd like to replace this mutex by an R/W lock
(which is also not recursive). This required a couple of changes:
- Read/WriteRegister expect the caller to obtain the mutex and are renamed to reflect that. The
  only caller of these functions is the GDBRemoteRegisterContext class, which already acquired
  that mutex (for the most part), so the changes there are minimal. (It is not clear to me
  whether this function actually needs to take the lock. The thing which this lock seems to
  protect is the state of the register context if it is being accessed from multiple threads,
  which, if true, sounds like it could be done by a separate mutex.)
- GetThreadSuffixSupported() was being called from locked and unlocked contexts (including
  contexts where the process was running, and the call would fail if it did not have the result
  cached). I have split this into two functions, one which computes the thread suffix support and
  caches it (this one always takes the lock), and another, which returns the cached value (and
  never needs to take the lock). This feels quite natural as ProcessGdbRemote was already
  pre-caching this value at the start.

https://reviews.llvm.org/D23802

Files:
  source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
  source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23802.68985.patch
Type: text/x-patch
Size: 23930 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160823/95333987/attachment-0001.bin>


More information about the lldb-commits mailing list