summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-mi/MIDriverMain.cpp
diff options
context:
space:
mode:
authorHafiz Abid Qadeer <hafiz_abid@mentor.com>2015-02-20 10:20:05 +0000
committerHafiz Abid Qadeer <hafiz_abid@mentor.com>2015-02-20 10:20:05 +0000
commit6d87a9c09e3b44a8bba2742869f5200f796c39f0 (patch)
tree58dcd9c496ae9bc98f50f448a02994647a9a2a94 /lldb/tools/lldb-mi/MIDriverMain.cpp
parent846de99fbd2024dd8c0626408c8f3e3211b4cf0d (diff)
downloadbcm5719-llvm-6d87a9c09e3b44a8bba2742869f5200f796c39f0.tar.gz
bcm5719-llvm-6d87a9c09e3b44a8bba2742869f5200f796c39f0.zip
Reduce number of threads in lldb-mi.
LLDB-mi have 3 threads. 1. Wait for input. 2. Process commands. 3. Process events. This revision merges 1 & 2. Same thread waits on input and then process the command. This way, no synchronization is needed between first and 2nd. Also it is easy to check when to exit. A lot of code will redundant and will be cleaned up gradually. All lldb-mi tests pass with gcc and clang as test compiler. Also did minimal testing on command line and works ok. The "quit" and "-gdb-exit" command close the application without needing any further return. Reviewed in http://reviews.llvm.org/D7746. llvm-svn: 230003
Diffstat (limited to 'lldb/tools/lldb-mi/MIDriverMain.cpp')
-rw-r--r--lldb/tools/lldb-mi/MIDriverMain.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lldb/tools/lldb-mi/MIDriverMain.cpp b/lldb/tools/lldb-mi/MIDriverMain.cpp
index 5557799d368..dd1e1d18646 100644
--- a/lldb/tools/lldb-mi/MIDriverMain.cpp
+++ b/lldb/tools/lldb-mi/MIDriverMain.cpp
@@ -132,9 +132,8 @@ sigint_handler(int vSigno)
CMICmnLog::Instance().WriteLog(CMIUtilString::Format(MIRSRC(IDS_PROCESS_SIGNAL_RECEIVED), "SIGINT", vSigno));
- // CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
- // Signal MI to shutdown or halt a running debug session
- CMICmnStreamStdin::Instance().SetCtrlCHit();
+ // Send signal to driver so that it can take suitable action
+ rDriverMgr.DeliverSignal (vSigno);
}
// ToDo: Reevaluate if this function needs to be implemented like the UNIX equivalent
@@ -165,8 +164,8 @@ sigtstp_handler(int vSigno)
CMICmnLog::Instance().WriteLog(CMIUtilString::Format(MIRSRC(IDS_PROCESS_SIGNAL_RECEIVED), "SIGTSTP", vSigno));
- // Signal MI to shutdown
- CMICmnStreamStdin::Instance().SetCtrlCHit();
+ // Send signal to driver so that it can take suitable action
+ rDriverMgr.DeliverSignal (vSigno);
}
// ToDo: Reevaluate if this function needs to be implemented like the UNIX equivalent
@@ -196,8 +195,8 @@ sigcont_handler(int vSigno)
CMICmnLog::Instance().WriteLog(CMIUtilString::Format(MIRSRC(IDS_PROCESS_SIGNAL_RECEIVED), "SIGCONT", vSigno));
- // Signal MI to shutdown
- CMICmnStreamStdin::Instance().SetCtrlCHit();
+ // Send signal to driver so that it can take suitable action
+ rDriverMgr.DeliverSignal (vSigno);
}
//++ ------------------------------------------------------------------------------------
OpenPOWER on IntegriCloud