linux-procfs: Handle lowercase "t (tracing stop)" state
authorPedro Alves <palves@redhat.com>
Mon, 25 Jul 2016 11:42:18 +0000 (12:42 +0100)
committerPedro Alves <palves@redhat.com>
Mon, 25 Jul 2016 11:58:38 +0000 (12:58 +0100)
Since Linux 2.6.33, /proc/PID/status shows "t (tracing stop)", with
lowercase 't'.  Because GDB is only expecting "T (tracing stop)", GDB
can incorrectly suppress errors in check_ptrace_stopped_lwp_gone:

 1578          if (!check_ptrace_stopped_lwp_gone (lp))
 1579            throw_exception (ex);

Ref: https://sourceware.org/ml/gdb-patches/2016-06/msg00072.html

2016-07-25  Pedro Alves  <palves@redhat.com>
    Jan Kratochvil  <jan.kratochvil@redhat.com>

* nat/linux-procfs.c (parse_proc_status_state): Handle lowercase
't'.

gdb/ChangeLog
gdb/nat/linux-procfs.c

index 0840a690b76eeb74458a5cd0c68c0ecde81d313c..c346a90b0f2e9a7e89b3aa5a669f38da48b0251e 100644 (file)
@@ -1,3 +1,9 @@
+2016-07-25  Pedro Alves  <palves@redhat.com>
+           Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * nat/linux-procfs.c (parse_proc_status_state): Handle lowercase
+       't'.
+
 2016-07-25  Pedro Alves  <palves@redhat.com>
 
        * nat/linux-procfs.c (enum proc_state): New enum.
index 5d63e1b502496cc76a63ef1fa0e0c02b0302b7e6..f00fe29374f1ed5afb5ca2be18f6107d9898f0a6 100644 (file)
@@ -102,7 +102,10 @@ parse_proc_status_state (const char *state)
 
   switch (state[0])
     {
+    case 't':
+      return PROC_STATE_TRACING_STOP;
     case 'T':
+      /* Before Linux 2.6.33, tracing stop used uppercase T.  */
       if (strcmp (state, "T (tracing stop)") == 0)
        return PROC_STATE_TRACING_STOP;
       else
This page took 0.026535 seconds and 4 git commands to generate.