[Lldb-commits] [PATCH] Fix a problem where lldb-mi would not stop the debuggee after -exec-interrupt command.
clayborg at gmail.com
Fri Feb 20 10:06:10 PST 2015
It is ok to rely on signals here because CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateStopped() already determined that a signal was reported as the stop reason and windows just can avoid saying it stopped due to a signal, so no work needs to be done to work around this.
You do need to ask the process about its signals and you can't use hard coded values, you need to look them up by name through the SBUnixSignals object that you can get from a live SBProcess instance. See inlined comments above.
Comment at: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp:839-840
@@ -838,3 +838,4 @@
- case 2: // Terminal interrupt signal. SIGINT
+ case SIGINT: // Terminal interrupt signal. SIGINT
+ case SIGSTOP:
You need to ask the process about its unix signal and you can't use hard coded values. You can make some member variables in CMICmnLLDBDebuggerHandleEvents and then initialize them when you have a process. The process must be up and running, you can't ask the process before it is stopped at its first stop. So when you get a eStateStopped event, see if it is the first one and then initialize your ivars with something like:
SBUnixSignals unix_signals = sbProcess.GetUnixSignals();
m_SIGINT = unix_signals.GetSignalNumberFromName("SIGINT");
m_SIGSTOP = unix_signals.GetSignalNumberFromName("SIGSTOP");
m_SIGSEGV = unix_signals.GetSignalNumberFromName("SIGSEGV");
m_SIGTRAP = unix_signals.GetSignalNumberFromName("SIGTRAP");
More information about the lldb-commits