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]

[commit] Give child_ops a proper extern declaration


Hello,

This patch eliminates a bunch of extern-in-c declarations of child_ops replacing them with declaration/definition in target.[hc].

I put them in target.[hc] as that allows me to break a dependance on inftarg.c.

I'm going to follow up by deprecating this global -> inferior inheritance makes it redundant.

committed,
Andrew
2004-09-29  Andrew Cagney  <cagney@gnu.org>

	* target.h (child_ops): Declare.
	* inftarg.c (child_ops): Move from here ...
	* target.c (child_ops): ... to here.
	* wince.c (child_ops): Delete extern declaration.
	* win32-nat.c (child_ops): Delete extern declaration.
	* linux-nat.c (child_ops): Delete extern declaration.
	* hpux-thread.c (child_ops): Delete extern declaration.

Index: hpux-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/hpux-thread.c,v
retrieving revision 1.25
diff -p -u -r1.25 hpux-thread.c
--- hpux-thread.c	3 Aug 2004 00:57:25 -0000	1.25
+++ hpux-thread.c	29 Sep 2004 13:52:40 -0000
@@ -45,7 +45,6 @@
 #include "gdbcore.h"
 
 extern int child_suppress_run;
-extern struct target_ops child_ops;	/* target vector for inftarg.c */
 
 extern void _initialize_hpux_thread (void);
 
Index: inftarg.c
===================================================================
RCS file: /cvs/src/src/gdb/inftarg.c,v
retrieving revision 1.27
diff -p -u -r1.27 inftarg.c
--- inftarg.c	14 Aug 2004 23:14:34 -0000	1.27
+++ inftarg.c	29 Sep 2004 13:52:40 -0000
@@ -89,8 +89,6 @@ static void init_child_ops (void);
 
 extern char **environ;
 
-struct target_ops child_ops;
-
 int child_suppress_run = 0;	/* Non-zero if inftarg should pretend not to
 				   be a runnable target.  Used by targets
 				   that can sit atop inftarg, such as HPUX
Index: linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-nat.c,v
retrieving revision 1.9
diff -p -u -r1.9 linux-nat.c
--- linux-nat.c	28 Sep 2004 17:29:05 -0000	1.9
+++ linux-nat.c	29 Sep 2004 13:52:41 -0000
@@ -83,8 +83,6 @@
 
 static int debug_linux_nat;
 
-extern struct target_ops child_ops;
-
 static int linux_parent_pid;
 
 struct simple_pid_list
@@ -599,9 +597,6 @@ ptid_t trap_ptid;
 /* This module's target-specific operations.  */
 static struct target_ops linux_nat_ops;
 
-/* The standard child operations.  */
-extern struct target_ops child_ops;
-
 /* Since we cannot wait (in linux_nat_wait) for the initial process and
    any cloned processes with a single call to waitpid, we have to use
    the WNOHANG flag and call waitpid in a loop.  To optimize
Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.80
diff -p -u -r1.80 target.c
--- target.c	12 Sep 2004 15:20:47 -0000	1.80
+++ target.c	29 Sep 2004 13:52:42 -0000
@@ -159,6 +159,12 @@ static int debug_to_thread_alive (ptid_t
 
 static void debug_to_stop (void);
 
+/* NOTE: cagney/2004-09-29: Many targets reference this variable in
+   wierd and mysterious ways.  Putting the variable here lets those
+   wierd and mysterious ways keep building while they are being
+   converted to the inferior inheritance structure.  */
+struct target_ops child_ops;
+
 /* Pointer to array of target architecture structures; the size of the
    array; the current index into the array; the allocated size of the 
    array.  */
Index: target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.60
diff -p -u -r1.60 target.h
--- target.h	7 Jun 2004 17:58:32 -0000	1.60
+++ target.h	29 Sep 2004 13:52:42 -0000
@@ -1237,4 +1237,6 @@ extern void push_remote_target (char *na
 /* Blank target vector entries are initialized to target_ignore. */
 void target_ignore (void);
 
+extern struct target_ops child_ops;
+
 #endif /* !defined (TARGET_H) */
Index: win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.97
diff -p -u -r1.97 win32-nat.c
--- win32-nat.c	26 Jul 2004 14:53:06 -0000	1.97
+++ win32-nat.c	29 Sep 2004 13:52:43 -0000
@@ -86,9 +86,6 @@ static int debug_registers_used;
 #define DEBUG_MEM(x)	if (debug_memory)	printf_unfiltered x
 #define DEBUG_EXCEPT(x)	if (debug_exceptions)	printf_unfiltered x
 
-/* Forward declaration */
-extern struct target_ops child_ops;
-
 static void child_stop (void);
 static int win32_child_thread_alive (ptid_t);
 void child_kill_inferior (void);
Index: wince.c
===================================================================
RCS file: /cvs/src/src/gdb/wince.c,v
retrieving revision 1.32
diff -p -u -r1.32 wince.c
--- wince.c	30 Jul 2004 19:23:51 -0000	1.32
+++ wince.c	29 Sep 2004 13:52:43 -0000
@@ -126,9 +126,6 @@ upload_options[3] =
 static char *remote_upload = NULL;	/* Set by set remoteupload */
 static int remote_add_host = 0;
 
-/* Forward declaration */
-extern struct target_ops child_ops;
-
 static int win32_child_thread_alive (ptid_t);
 void child_kill_inferior (void);
 

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