llvm-project/lldb/tools/lldb-mi
Hafiz Abid Qadeer d1f606ff0f 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
2015-02-04 09:59:23 +00:00
..
CMakeLists.txt Don't try to link libpthread on Windows. 2015-01-14 22:58:09 +00:00
Driver.cpp Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
Driver.h Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
MICmdArgContext.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgContext.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgSet.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgSet.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValBase.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValBase.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValConsume.cpp Fix handling of data-disassemble command arguments. 2015-01-23 14:31:56 +00:00
MICmdArgValConsume.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValFile.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValFile.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValListBase.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValListBase.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValListOfN.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValListOfN.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValNumber.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValNumber.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValOptionLong.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValOptionLong.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValOptionShort.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValOptionShort.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValString.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValString.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValThreadGrp.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdArgValThreadGrp.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdBase.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdBase.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmd.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmd.h Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
MICmdCmdBreak.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmdCmdBreak.h Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
MICmdCmdData.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmdCmdData.h Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmdCmdEnviro.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdEnviro.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdExec.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmdCmdExec.h Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
MICmdCmdFile.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmdCmdFile.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdGdbInfo.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmdCmdGdbInfo.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdGdbSet.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdGdbSet.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdGdbThread.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdGdbThread.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdMiscellanous.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmdCmdMiscellanous.h Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
MICmdCmdStack.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmdCmdStack.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdSupportInfo.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdSupportInfo.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdSupportList.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdSupportList.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdTarget.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmdCmdTarget.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdThread.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmdCmdThread.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdTrace.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdTrace.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCmdVar.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmdCmdVar.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCommands.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdCommands.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdData.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdData.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdFactory.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdFactory.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdInterpreter.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdInterpreter.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdInvoker.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdInvoker.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdMgr.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdMgr.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdMgrSetCmdDeleteCallback.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmdMgrSetCmdDeleteCallback.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnBase.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnBase.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnConfig.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnLLDBBroadcaster.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnLLDBBroadcaster.h Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
MICmnLLDBDebugSessionInfo.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmnLLDBDebugSessionInfo.h Fix a race condition in lldb-mi. 2015-02-04 09:59:23 +00:00
MICmnLLDBDebugSessionInfoVarObj.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnLLDBDebugSessionInfoVarObj.h Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
MICmnLLDBDebugger.cpp Fix a race condition in lldb-mi. 2015-02-04 09:59:23 +00:00
MICmnLLDBDebugger.h Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
MICmnLLDBDebuggerHandleEvents.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmnLLDBDebuggerHandleEvents.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnLLDBProxySBValue.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmnLLDBProxySBValue.h Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
MICmnLLDBUtilSBValue.cpp Fix CLI commands in lldb-mi. 2015-02-03 10:05:54 +00:00
MICmnLLDBUtilSBValue.h Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
MICmnLog.cpp Fix log file generation in lldb-mi. 2015-02-02 17:08:25 +00:00
MICmnLog.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnLogMediumFile.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnLogMediumFile.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIOutOfBandRecord.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIOutOfBandRecord.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIResultRecord.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIResultRecord.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIValue.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIValue.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIValueConst.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIValueConst.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIValueList.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIValueList.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIValueResult.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIValueResult.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIValueTuple.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnMIValueTuple.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnResources.cpp Fix log file generation in lldb-mi. 2015-02-02 17:08:25 +00:00
MICmnResources.h Fix log file generation in lldb-mi. 2015-02-02 17:08:25 +00:00
MICmnStreamStderr.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnStreamStderr.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnStreamStdin.cpp Replace ioctl with select to reduce processor usage by lldb-mi on OSX. 2014-12-15 19:09:40 +00:00
MICmnStreamStdin.h Replace ioctl with select to reduce processor usage by lldb-mi on OSX. 2014-12-15 19:09:40 +00:00
MICmnStreamStdinLinux.cpp Replace ioctl with select to reduce processor usage by lldb-mi on OSX. 2014-12-15 19:09:40 +00:00
MICmnStreamStdinLinux.h Replace ioctl with select to reduce processor usage by lldb-mi on OSX. 2014-12-15 19:09:40 +00:00
MICmnStreamStdinWindows.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnStreamStdinWindows.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnStreamStdout.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnStreamStdout.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnThreadMgrStd.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MICmnThreadMgrStd.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIDataTypes.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIDriver.cpp Fix a race condition in lldb-mi. 2015-02-04 09:59:23 +00:00
MIDriver.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIDriverBase.cpp Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
MIDriverBase.h Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
MIDriverMain.cpp Restore the signal handler for Windows as it is not presistent there. 2015-02-03 11:20:00 +00:00
MIDriverMgr.cpp Fix log file generation in lldb-mi. 2015-02-02 17:08:25 +00:00
MIDriverMgr.h Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets. 2015-01-20 00:04:26 +00:00
MIReadMe.txt Add new MI commands, features and fixes to the lldb-mi driver. 2014-08-08 16:47:42 +00:00
MIUtilDateTimeStd.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilDateTimeStd.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilDebug.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilDebug.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilFileStd.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilFileStd.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilMapIdToVariant.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilMapIdToVariant.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilSingletonBase.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilSingletonHelper.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilString.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilString.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilSystemLinux.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilSystemLinux.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilSystemOsx.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilSystemOsx.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilSystemWindows.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilSystemWindows.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilTermios.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilTermios.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilThreadBaseStd.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilThreadBaseStd.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilVariant.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
MIUtilVariant.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
Makefile
Platform.cpp Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
Platform.h Reformat lldb-mi using clang-format. 2014-11-17 18:06:21 +00:00
lldb-Info.plist