[OB] extract the signal number by WTERMSIG

Yao Qi
2010-09-01T16:14:55Z

[-- Attachment #1: Type: text/plain, Size: 192 bytes --]

Hi,
We should use WTERMSIG to extract the signal number from a WIFSIGNALED
status, not WSTOPSIG.

It is obvious, OK to apply?

--
Yao Qi
CodeSourcery
yao@codesourcery.com
(650) 331-3385 x739

[-- Attachment #2: wtermsig.patch --]
[-- Type: text/x-patch, Size: 728 bytes --]

2010-09-02 Yao Qi <yao@codesourcery.com>

* linux-nat.c (status_to_str): Use WTERMSIG to extract the signal
number from a WIFSIGNALED status.

Index: linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-nat.c,v
retrieving revision 1.182
diff -u -p -r1.182 linux-nat.c
--- linux-nat.c 31 Aug 2010 18:08:43 -0000 1.182
+++ linux-nat.c 1 Sep 2010 16:04:23 -0000
@@ -1094,7 +1094,7 @@ status_to_str (int status)
}
else if (WIFSIGNALED (status))
snprintf (buf, sizeof (buf), "%s (terminated)",
- strsignal (WSTOPSIG (status)));
+ strsignal (WTERMSIG (status)));
else
snprintf (buf, sizeof (buf), "%d (exited)", WEXITSTATUS (status));