Remove unused code block in inf_ptrace_target::wait
authorKamil Rytarowski <n54@gmx.com>
Fri, 24 Apr 2020 16:10:07 +0000 (18:10 +0200)
committerChristian Biesinger <cbiesinger@google.com>
Sat, 25 Apr 2020 22:24:51 +0000 (17:24 -0500)
Remove unused PT_GET_PROCESS_STATE block. It used to be used
by OpenBSD, but it is now reimplemented independently in
obsd-nat.c.

gdb/ChangeLog:

       * inf-ptrace.c (inf_ptrace_target::wait): Remove
       `PT_GET_PROCESS_STATE' block.

Change-Id: I9b872df8517b658c0dfe889fc1e4a7009bc5c076

gdb/ChangeLog
gdb/inf-ptrace.c

index ccc0baafb1e45eeb63e230e5cde41d4fe0a98db3..ba0f680f9747e94528f40b8bd4fd7778833b0533 100644 (file)
@@ -1,3 +1,8 @@
+2020-04-25  Kamil Rytarowski  <n54@gmx.com>
+
+       * inf-ptrace.c (inf_ptrace_target::wait): Remove
+       `PT_GET_PROCESS_STATE' block.
+
 2020-04-24  Tom Tromey  <tom@tromey.com>
 
        * symtab.h (symbol_get_demangled_name): Don't declare.
index 4519a9ebef1ed725fdbb683e3fa5c209f8cc0e47..a83ffcc87989b90416c4df58378dc26f883d3136 100644 (file)
@@ -353,44 +353,6 @@ inf_ptrace_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
     }
   while (pid == -1);
 
-#ifdef PT_GET_PROCESS_STATE
-  if (WIFSTOPPED (status))
-    {
-      ptrace_state_t pe;
-      pid_t fpid;
-
-      if (ptrace (PT_GET_PROCESS_STATE, pid,
-                 (PTRACE_TYPE_ARG3)&pe, sizeof pe) == -1)
-       perror_with_name (("ptrace"));
-
-      switch (pe.pe_report_event)
-       {
-       case PTRACE_FORK:
-         ourstatus->kind = TARGET_WAITKIND_FORKED;
-         ourstatus->value.related_pid = ptid_t (pe.pe_other_pid);
-
-         /* Make sure the other end of the fork is stopped too.  */
-         fpid = waitpid (pe.pe_other_pid, &status, 0);
-         if (fpid == -1)
-           perror_with_name (("waitpid"));
-
-         if (ptrace (PT_GET_PROCESS_STATE, fpid,
-                     (PTRACE_TYPE_ARG3)&pe, sizeof pe) == -1)
-           perror_with_name (("ptrace"));
-
-         gdb_assert (pe.pe_report_event == PTRACE_FORK);
-         gdb_assert (pe.pe_other_pid == pid);
-         if (fpid == inferior_ptid.pid ())
-           {
-             ourstatus->value.related_pid = ptid_t (pe.pe_other_pid);
-             return ptid_t (fpid);
-           }
-
-         return ptid_t (pid);
-       }
-    }
-#endif
-
   store_waitstatus (ourstatus, status);
   return ptid_t (pid);
 }
This page took 0.030327 seconds and 4 git commands to generate.