public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Remove unused code block in inf_ptrace_target::wait
@ 2020-04-24 16:10 Kamil Rytarowski
  2020-04-24 17:00 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Kamil Rytarowski @ 2020-04-24 16:10 UTC (permalink / raw)
  To: gdb-patches

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.
---
 gdb/ChangeLog    |  5 +++++
 gdb/inf-ptrace.c | 38 --------------------------------------
 2 files changed, 5 insertions(+), 38 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7d34d43a578..f1979e14acb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-24  Kamil Rytarowski  <n54@gmx.com>
+
+	* inf-ptrace.c (inf_ptrace_target::wait): Remove
+	`PT_GET_PROCESS_STATE' block.
+
 2020-04-24  Kamil Rytarowski  <n54@gmx.com>

 	* inf-ptrace.h (follow_fork, insert_fork_catchpoint)
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index 4519a9ebef1..a83ffcc8798 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -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);
 }
--
2.25.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Remove unused code block in inf_ptrace_target::wait
  2020-04-24 16:10 [PATCH] Remove unused code block in inf_ptrace_target::wait Kamil Rytarowski
@ 2020-04-24 17:00 ` Tom Tromey
  2020-04-25 22:25   ` Christian Biesinger
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2020-04-24 17:00 UTC (permalink / raw)
  To: Kamil Rytarowski; +Cc: gdb-patches

>>>>> ">" == Kamil Rytarowski <n54@gmx.com> writes:

>> 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.

Looks good, thanks.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Remove unused code block in inf_ptrace_target::wait
  2020-04-24 17:00 ` Tom Tromey
@ 2020-04-25 22:25   ` Christian Biesinger
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Biesinger @ 2020-04-25 22:25 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Kamil Rytarowski, gdb-patches

On Fri, Apr 24, 2020 at 12:00 PM Tom Tromey <tom@tromey.com> wrote:
>
> >>>>> ">" == Kamil Rytarowski <n54@gmx.com> writes:
>
> >> 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.
>
> Looks good, thanks.

I pushed this on behalf of Kamil.
To ssh://sourceware.org/git/binutils-gdb.git
   d472f0fbaa..b9771db784  HEAD -> master

Christian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-25 22:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-24 16:10 [PATCH] Remove unused code block in inf_ptrace_target::wait Kamil Rytarowski
2020-04-24 17:00 ` Tom Tromey
2020-04-25 22:25   ` Christian Biesinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).