linux-procfs: Introduce enum proc_state
authorPedro Alves <palves@redhat.com>
Mon, 25 Jul 2016 11:42:17 +0000 (12:42 +0100)
committerPedro Alves <palves@redhat.com>
Mon, 25 Jul 2016 11:42:17 +0000 (12:42 +0100)
commitd617208bb06bd461b52ce041d89f7127e3044762
tree01f2944aa2ffdcda82ef4537ae462ad25ede3480
parent3a1518e4f3c467cfee2786b0af3388529f14d23b
linux-procfs: Introduce enum proc_state

Parse the process's /proc/PID/status state into an enum instead of the
current scheme of passing state strings around.

gdb/ChangeLog:
2016-07-25  Pedro Alves  <palves@redhat.com>

* nat/linux-procfs.c (enum proc_state): New enum.
(parse_proc_status_state): New function.
(linux_proc_pid_get_state): Replace output string buffer parameter
with an output proc_state parameter.  Use parse_proc_status_state.
(linux_proc_pid_is_gone): Adjust to use proc_state values.
(linux_proc_pid_has_state): Change type of 'state' parameter; now
an enum proc_state.  Adjust to linux_proc_pid_get_state interface
change.
(linux_proc_pid_is_stopped)
(linux_proc_pid_is_trace_stopped_nowarn)
(linux_proc_pid_is_zombie_maybe_warn): Adjust to
linux_proc_pid_get_state interface change.
gdb/ChangeLog
gdb/nat/linux-procfs.c