Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@gnu.org>
To: cagney@gnu.org, gdb-patches@sources.redhat.com
Subject: [RFA/RFC] Replace call_ptrace and ptrace_wait in inf-ptrace.c
Date: Mon, 20 Sep 2004 19:14:00 -0000	[thread overview]
Message-ID: <200409201913.i8KJDosi035323@elgar.sibelius.xs4all.nl> (raw)

This is another step in the direction of eliminating the need for both
inf-ptrace.c and infptrace.c.  It eliminates the calls to call_ptrace
and ptrace_wait.

Andrew has recently suggested that we'd want debugging support for the
ptrace(2) interface, which could be implemented by using call_ptrace()
unconditionally.  That, however, is a bad idea, since this makes it
impossible for the compiler to properly typecheck the arguments to
ptrace().  Hence the removal of call_ptrace() usage.

In inf_ptrace_kill_inferior, I just replaced ptrace_wait() with
wait().  Calling target_post_wait here seems inappropriate.

If nobody objetcs, I'll check this in later this week.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* inf-ptrace.c (inf_ptrace_kill_inferior): Call ptrace directly
	instead of call_ptrace.  Call wait directly instead of
	ptrace_wait.
	(inf_ptrace_me): Call ptrace directly instead of call_ptrace.
	(inf_ptrace_wait): Inline ptrace_wait call.

Index: inf-ptrace.c
===================================================================
RCS file: /cvs/src/src/gdb/inf-ptrace.c,v
retrieving revision 1.2
diff -u -p -r1.2 inf-ptrace.c
--- inf-ptrace.c 16 Sep 2004 19:54:18 -0000 1.2
+++ inf-ptrace.c 20 Sep 2004 18:58:17 -0000
@@ -55,8 +55,8 @@ inf_ptrace_kill_inferior (void)
 
      The kill call causes problems under hpux10, so it's been removed;
      if this causes problems we'll deal with them as they arise.  */
-  call_ptrace (PT_KILL, pid, (PTRACE_TYPE_ARG3) 0, 0);
-  ptrace_wait (null_ptid, &status);
+  ptrace (PT_KILL, pid, (PTRACE_TYPE_ARG3) 0, 0);
+  wait (&status);
   target_mourn_inferior ();
 }
 
@@ -255,7 +255,8 @@ inf_ptrace_wait (ptid_t ptid, struct tar
 				   attached process. */
       set_sigio_trap ();
 
-      pid = ptrace_wait (inferior_ptid, &status);
+      pid = wait (&status);
+      target_post_wait (pid_to_ptid (pid), status);
 
       save_errno = errno;
 
@@ -433,7 +434,7 @@ static void
 inf_ptrace_me (void)
 {
   /* "Trace me, Dr. Memory!" */
-  call_ptrace (0, 0, (PTRACE_TYPE_ARG3) 0, 0);
+  ptrace (0, 0, (PTRACE_TYPE_ARG3) 0, 0);
 }
 
 /* Stub function which causes the GDB that runs it, to start ptrace-ing


             reply	other threads:[~2004-09-20 19:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-20 19:14 Mark Kettenis [this message]
2004-09-20 19:37 ` Andrew Cagney
2004-09-20 19:42   ` Daniel Jacobowitz
2004-09-20 21:48   ` Mark Kettenis
2004-09-21 13:09     ` Andrew Cagney
2004-09-24 22:37       ` Mark Kettenis
2004-09-24 22:46         ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200409201913.i8KJDosi035323@elgar.sibelius.xs4all.nl \
    --to=kettenis@gnu.org \
    --cc=cagney@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox