binutils-gdb/gdb/nat
Jan Kratochvil 5c811d30d1 PR gdb/22046: Fix T-stopped detach regression on old Linux kernels
On <=RHEL6 hosts Fedora/RHEL GDB started to 'kill -STOP' all processes it
detached.  Even those not originally T-stopped.  This is a Fedora-specific
patch which is based on upstream GDB's PROC_STATE_STOPPED state.

I believe (I did not verify) this patch did regress it:
commit d617208bb0
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Jul 25 12:42:17 2016 +0100
    linux-procfs: Introduce enum proc_state

As originally there was strstr() but now there is strcmp() and so the missing
trailing '\n' no longer matches.

The Bug was found by Michal Kolar.

Reproducibility:
$ gdb -p $PID
(gdb) quit
$ ...

Actual results:
===
RHEL6.9 x86_64 # scl enable devtoolset-7 bash
RHEL6.9 x86_64 # which gdb
/opt/rh/devtoolset-7/root/usr/bin/gdb
RHEL6.9 x86_64 # ./testcase.sh
24737 pts/0    S+     0:00 /bin/sleep 4
24737 pts/0    T+     0:00 /bin/sleep 4
RHEL6.9 x86_64 #
===

Expected results:
===
RHEL6.9 x86_64 # which gdb
/usr/bin/gdb
RHEL6.9 x86_64 # ./testcase.sh
24708 pts/0    S+     0:00 /bin/sleep 4
24708 pts/0    S+     0:00 /bin/sleep 4
./testcase.sh: line 20: kill: (24708) - No such process
RHEL6.9 x86_64 #
===

gdb/ChangeLog
2017-09-01  Jan Kratochvil  <jan.kratochvil@redhat.com>

	PR gdb/22046
	* nat/linux-procfs.c (parse_proc_status_state): Fix PROC_STATE_STOPPED
	detection.
2017-09-01 06:14:43 +02:00
..
aarch64-linux-hw-point.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
aarch64-linux-hw-point.h Include break-common.h in nat/aarch64-linux-hw-point.h 2017-01-06 14:33:01 +00:00
aarch64-linux.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
aarch64-linux.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
amd64-linux-siginfo.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
amd64-linux-siginfo.h Include signal.h in nat/amd64-linux-siginfo.h 2017-01-06 14:33:01 +00:00
fork-inferior.c Share fork_inferior et al with gdbserver 2017-06-07 19:56:09 -04:00
fork-inferior.h Add ATTRIBUTE_PRINTF to trace_start_error 2017-06-17 23:19:25 +02:00
gdb_ptrace.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_thread_db.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
glibc_thread_db.h Move shared native target specific code to gdb/nat 2014-06-20 14:06:48 +01:00
linux-btrace.c Introduce and use gdb_file_up 2017-08-03 07:58:52 -06:00
linux-btrace.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
linux-namespaces.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
linux-namespaces.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
linux-nat.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
linux-osdata.c Introduce and use gdb_file_up 2017-08-03 07:58:52 -06:00
linux-osdata.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
linux-personality.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
linux-personality.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
linux-procfs.c PR gdb/22046: Fix T-stopped detach regression on old Linux kernels 2017-09-01 06:14:43 +02:00
linux-procfs.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
linux-ptrace.c nat/linux-ptrace.c: add missing gdb_byte* cast 2017-06-18 23:29:03 +02:00
linux-ptrace.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
linux-waitpid.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
linux-waitpid.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
mips-linux-watch.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
mips-linux-watch.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
ppc-linux.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
ppc-linux.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
x86-cpuid.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
x86-dregs.c x86-dregs: Print debug registers one per line 2017-06-25 12:40:10 +02:00
x86-dregs.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
x86-gcc-cpuid.h Sync up x86-gcc-cpuid.h with cpuid.h from gcc-6 branch. 2017-02-17 11:43:39 +01:00
x86-linux-dregs.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
x86-linux-dregs.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
x86-linux.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
x86-linux.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00