Fix a race condition in lldb-mi.
lldb-mi has 3 threads. 1. One that waits for user intput. 2. Another waits for 1st thread to get input command. 3. Waits for events from lldb. 2 & 3 needs to be synchronized so that they don't end up doing things at same time. For example, while "break insert" is processing, we can get a breakpoint event. Depending on where we are in "break-insert", it can have different behavior. In some cases, it can cause breakpoint to be deleted too. I have added a mutex so that command processing and event processing are done exclusively and they are not running at the same time. In longer term, I think thread 2 & 3 should be merged to be only one thread which can wait on command or events. Reviewed in http://reviews.llvm.org/D7371. llvm-svn: 228128
Showing
- lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h 3 additions, 0 deletionslldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h
- lldb/tools/lldb-mi/MICmnLLDBDebugger.cpp 7 additions, 1 deletionlldb/tools/lldb-mi/MICmnLLDBDebugger.cpp
- lldb/tools/lldb-mi/MIDriver.cpp 8 additions, 1 deletionlldb/tools/lldb-mi/MIDriver.cpp
Loading
Please register or sign in to comment