[Lldb-commits] [lldb] [lldb][AIX] Added Kill() implementation (PR #169454)

Dhruv Srivastava via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 24 23:11:06 PST 2025


================
@@ -187,7 +193,41 @@ Status NativeProcessAIX::Signal(int signo) { return Status("unsupported"); }
 
 Status NativeProcessAIX::Interrupt() { return Status("unsupported"); }
 
-Status NativeProcessAIX::Kill() { return Status("unsupported"); }
+Status NativeProcessAIX::Kill() {
+
+  Log *log = GetLog(POSIXLog::Process);
+  LLDB_LOG(log, "pid {0}", GetID());
+
+  Status error;
+
+  switch (m_state) {
+  case StateType::eStateInvalid:
+  case StateType::eStateExited:
+  case StateType::eStateCrashed:
+  case StateType::eStateDetached:
+  case StateType::eStateUnloaded:
+    // Nothing to do - the process is already dead.
+    LLDB_LOG(log, "ignored for PID {0} due to current state: {1}", GetID(),
+             m_state);
+    return error;
+
+  case StateType::eStateConnected:
+  case StateType::eStateAttaching:
+  case StateType::eStateLaunching:
+  case StateType::eStateStopped:
+  case StateType::eStateRunning:
+  case StateType::eStateStepping:
+  case StateType::eStateSuspended:
+    // We can try to kill a process in these states.
+    break;
+  }
+
+  llvm::Error result =
+      (PtraceWrapper(PT_KILL, GetID(), nullptr, nullptr, 0)).takeError();
----------------
DhruvSrivastavaX wrote:

SIGKILL on a traced debuggee does not trigger SIGCHLD, thats why we use PT_KILL here.

https://github.com/llvm/llvm-project/pull/169454


More information about the lldb-commits mailing list