This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch/rfc] Deprecate CHILD_RESUME and KILL_INFERIOR


Hello,

Following up on:
http://sources.redhat.com/ml/gdb-patches/2004-09/msg00093.html

this deprecates several of the macros used by infptrace.c / inftarg.c (there are more, these were easy and serve as an illustration).

Code can now instead, as illustrated by PPC/NetBSD (ppcnbsd-nat.c), use inf_ptrace_target (or inf_child_target) to construct the target vector and then register it directly.

I'll look to commit this in a week.
Andrew
2004-09-12  Andrew Cagney  <cagney@gnu.org>

	* config/nm-lynx.h (DEPRECATED_CHILD_RESUME): Deprecate
	CHILD_RESUME.
	* config/i386/nm-linux.h (DEPRECATED_CHILD_RESUME): Ditto.
	* config/i386/nm-fbsd.h (DEPRECATED_CHILD_RESUME): Ditto.
	* config/nm-linux.h (DEPRECATED_KILL_INFERIOR): Deprecate
	KILL_INFERIOR.
	* infptrace.c: Update.

Index: infptrace.c
===================================================================
RCS file: /cvs/src/src/gdb/infptrace.c,v
retrieving revision 1.44
diff -p -u -r1.44 infptrace.c
--- infptrace.c	7 Sep 2004 21:55:10 -0000	1.44
+++ infptrace.c	12 Sep 2004 14:17:54 -0000
@@ -148,7 +148,11 @@ ptrace_wait (ptid_t ptid, int *status)
   return wstate;
 }
 
-#ifndef KILL_INFERIOR
+#ifndef DEPRECATED_KILL_INFERIOR
+/* NOTE: cagney/2004-09-12: Instead of definining this macro, code
+   should call inf_ptrace_target to get a basic ptrace target and then
+   locally update any necessary methods.  See ppcnbsd-nat.c.  */
+
 void
 kill_inferior (void)
 {
@@ -170,9 +174,12 @@ kill_inferior (void)
   ptrace_wait (null_ptid, &status);
   target_mourn_inferior ();
 }
-#endif /* KILL_INFERIOR */
+#endif /* DEPRECATED_KILL_INFERIOR */
 
-#ifndef CHILD_RESUME
+#ifndef DEPRECATED_CHILD_RESUME
+/* NOTE: cagney/2004-09-12: Instead of definining this macro, code
+   should call inf_ptrace_target to get a basic ptrace target and then
+   locally update any necessary methods.  See ppcnbsd-nat.c.  */
 
 /* Resume execution of the inferior process.
    If STEP is nonzero, single-step it.
@@ -211,7 +218,7 @@ child_resume (ptid_t ptid, int step, enu
   if (errno != 0)
     perror_with_name ("ptrace");
 }
-#endif /* CHILD_RESUME */
+#endif /* DEPRECATED_CHILD_RESUME */
 
 
 /* Start debugging the process whose number is PID.  */
Index: infttrace.c
===================================================================
RCS file: /cvs/src/src/gdb/infttrace.c,v
retrieving revision 1.34
diff -p -u -r1.34 infttrace.c
--- infttrace.c	7 Sep 2004 21:55:10 -0000	1.34
+++ infttrace.c	12 Sep 2004 14:17:55 -0000
@@ -3842,7 +3842,7 @@ kill_inferior (void)
 }
 
 
-#ifndef CHILD_RESUME
+#ifndef DEPRECATED_CHILD_RESUME
 
 /* Sanity check a thread about to be continued.
  */
@@ -4253,7 +4253,7 @@ threads_continue_one_with_signal (lwpid_
 }
 #endif
 
-#ifndef CHILD_RESUME
+#ifndef DEPRECATED_CHILD_RESUME
 
 /* Resume execution of the inferior process.
 
@@ -4554,7 +4554,7 @@ child_resume (ptid_t ptid, int step, enu
 #endif
 
 }
-#endif /* CHILD_RESUME */
+#endif /* DEPRECATED_CHILD_RESUME */
 
 /*
  * Like it says.
Index: config/nm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/nm-linux.h,v
retrieving revision 1.23
diff -p -u -r1.23 nm-linux.h
--- config/nm-linux.h	3 Sep 2004 17:13:47 -0000	1.23
+++ config/nm-linux.h	12 Sep 2004 14:17:55 -0000
@@ -68,7 +68,7 @@ extern void lin_thread_get_thread_signal
 #define CHILD_POST_STARTUP_INFERIOR
 #define CHILD_POST_ATTACH
 #define CHILD_FOLLOW_FORK
-#define KILL_INFERIOR
+#define DEPRECATED_KILL_INFERIOR
 
 #define NATIVE_XFER_AUXV	procfs_xfer_auxv
 #include "auxv.h"		/* Declares it. */
Index: config/nm-lynx.h
===================================================================
RCS file: /cvs/src/src/gdb/config/nm-lynx.h,v
retrieving revision 1.7
diff -p -u -r1.7 nm-lynx.h
--- config/nm-lynx.h	12 Apr 2003 17:41:26 -0000	1.7
+++ config/nm-lynx.h	12 Sep 2004 14:17:55 -0000
@@ -64,7 +64,7 @@ struct target_waitstatus;
 
 /* Override child_resume in infptrace.c */
 
-#define CHILD_RESUME
+#define DEPRECATED_CHILD_RESUME
 
 /* Override child_thread_alive in intarg.c */
 
Index: config/i386/nm-fbsd.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/nm-fbsd.h,v
retrieving revision 1.9
diff -p -u -r1.9 nm-fbsd.h
--- config/i386/nm-fbsd.h	13 Mar 2004 13:07:20 -0000	1.9
+++ config/i386/nm-fbsd.h	12 Sep 2004 14:17:55 -0000
@@ -56,7 +56,7 @@ extern unsigned long i386bsd_dr_get_stat
 #include "config/nm-bsd.h"
 
 /* Override child_resume in `infptrace.c' to work around a kernel bug.  */
-#define CHILD_RESUME
+#define DEPRECATED_CHILD_RESUME
 
 /* Override child_pid_to_exec_file in 'inftarg.c'.  */
 #define CHILD_PID_TO_EXEC_FILE
Index: config/i386/nm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/nm-linux.h,v
retrieving revision 1.20
diff -p -u -r1.20 nm-linux.h
--- config/i386/nm-linux.h	17 Aug 2003 18:22:25 -0000	1.20
+++ config/i386/nm-linux.h	12 Sep 2004 14:17:55 -0000
@@ -80,7 +80,7 @@ extern int cannot_store_register (int re
 #endif
 
 /* Override child_resume in `infptrace.c'.  */
-#define CHILD_RESUME
+#define DEPRECATED_CHILD_RESUME
 
 /* `linux-nat.c' and `i386-nat.c' have their own versions of
    child_post_startup_inferior.  Define this to use the copy in

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]