[Lldb-commits] [lldb] r189953 - Fixing a problem with inferior exit caused by signal
Andrew Kaylor
andrew.kaylor at intel.com
Wed Sep 4 09:06:05 PDT 2013
Author: akaylor
Date: Wed Sep 4 11:06:04 2013
New Revision: 189953
URL: http://llvm.org/viewvc/llvm-project?rev=189953&view=rev
Log:
Fixing a problem with inferior exit caused by signal
Modified:
lldb/trunk/source/Host/common/Host.cpp
lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py
lldb/trunk/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=189953&r1=189952&r2=189953&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Wed Sep 4 11:06:04 2013
@@ -203,7 +203,7 @@ MonitorChildProcessThreadFunction (void
{
signal = WTERMSIG(status);
status_cstr = "SIGNALED";
- if (wait_pid == pid) {
+ if (wait_pid == abs(pid)) {
exited = true;
exit_status = -1;
}
@@ -236,7 +236,7 @@ MonitorChildProcessThreadFunction (void
callback_return = callback (callback_baton, wait_pid, exited, signal, exit_status);
// If our process exited, then this thread should exit
- if (exited && wait_pid == pid)
+ if (exited && wait_pid == abs(pid))
{
if (log)
log->Printf ("%s (arg = %p) thread exiting because pid received exit signal...", __FUNCTION__, arg);
Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp?rev=189953&r1=189952&r2=189953&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp Wed Sep 4 11:06:04 2013
@@ -1448,6 +1448,12 @@ ProcessMonitor::MonitorCallback(void *ca
log->Printf ("ProcessMonitor::%s() GetSignalInfo failed: %s, tid = %" PRIu64 ", signal = %d, status = %d",
__FUNCTION__, strerror(ptrace_err), pid, signal, status);
stop_monitoring = pid == monitor->m_process->GetID();
+ // If we are going to stop monitoring, we need to notify our process object
+ if (stop_monitoring)
+ {
+ message = ProcessMessage::Exit(pid, status);
+ process->SendMessage(message);
+ }
}
}
else {
Modified: lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py?rev=189953&r1=189952&r2=189953&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py (original)
+++ lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py Wed Sep 4 11:06:04 2013
@@ -66,7 +66,7 @@ class CrashingInferiorTestCase(TestBase)
self.inferior_crashing_step_after_break()
@skipIfFreeBSD # llvm.org/pr16684
- @skipIfLinux # due to llvm.org/pr15988 -- step over misbehaves after crash
+ @expectedFailureLinux # due to llvm.org/pr15988 -- step over misbehaves after crash
def test_inferior_crashing_step_after_break_dwarf(self):
"""Test that lldb functions correctly after stepping through a crash."""
self.buildDwarf()
Modified: lldb/trunk/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py?rev=189953&r1=189952&r2=189953&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py (original)
+++ lldb/trunk/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py Wed Sep 4 11:06:04 2013
@@ -67,7 +67,6 @@ class CrashingRecursiveInferiorTestCase(
self.recursive_inferior_crashing_step_after_break()
@skipIfFreeBSD # llvm.org/pr16684
- @skipIfLinux # due to llvm.org/pr15988 -- step over misbehaves after crash
def test_recursive_inferior_crashing_step_after_break_dwarf(self):
"""Test that lldb functions correctly after stepping through a crash."""
self.buildDwarf()
More information about the lldb-commits
mailing list