From 59ef8a7a7112899466fd5eec18ce4618e039fda0 Mon Sep 17 00:00:00 2001 From: Joe Grasse Date: Fri, 11 Mar 2016 09:55:10 -0600 Subject: [PATCH] proc: Add process state T On linux kernel 2.6.x, the Trace/Stop status is 'T' Fixes #209 --- proc/proc_linux.go | 3 +++ proc/threads_linux.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/proc/proc_linux.go b/proc/proc_linux.go index fc5751e8..c3e780d5 100644 --- a/proc/proc_linux.go +++ b/proc/proc_linux.go @@ -27,6 +27,9 @@ const ( StatusRunning = 'R' StatusTraceStop = 't' StatusZombie = 'Z' + + // Kernel 2.6 has TraceStop as T + StatusTraceStopT = 'T' ) // OSProcessDetails contains Linux specific diff --git a/proc/threads_linux.go b/proc/threads_linux.go index de29963b..983503f5 100644 --- a/proc/threads_linux.go +++ b/proc/threads_linux.go @@ -30,7 +30,7 @@ func (t *Thread) halt() (err error) { func (t *Thread) stopped() bool { state := status(t.ID, t.dbp.os.comm) - return state == StatusTraceStop + return state == StatusTraceStop || state == StatusTraceStopT } func (t *Thread) resume() error {