From: Jim Kingdon Date: Fri, 22 Oct 1993 05:55:58 +0000 (+0000) Subject: * Makefile.in (init.c): Generate using the source, not munch. This X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=976bb0be038b72449683a428903658347d581eaa;p=binutils-gdb.git * Makefile.in (init.c): Generate using the source, not munch. This cleans up all kinds of hassles (which nm to use in munch, etc). The new formatting conventions (mostly already followed) are that the name of the _initialize_* routines must start in column zero, and must not be inside #if. * munch: Removed. * Makefile.in: Remove references to munch. * serial.c, remote.c, infptrace.c, maint.c, convex-tdep.c, alpha-tdep.c, hp300ux-nat.c, hppab-nat.c, osfsolib.c, remote-es.c, procfs.c, remote-udi.c, ser-go32.c, ultra3-xdep.c, sh-tdep.c, i960-tdep.c, hppa-tdep.c, h8500-tdep.c, dpx2-nat.c, delta68-nat.c, z8k-tdep.c: Make sure the above conventions are followed. Make sure they are all declared as returning void. Clean up miscellaneous comments and such. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2851017f1a9..2302d30e94b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,20 @@ Thu Oct 21 12:23:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + * Makefile.in (init.c): Generate using the source, not munch. This + cleans up all kinds of hassles (which nm to use in munch, etc). The + new formatting conventions (mostly already followed) are that + the name of the _initialize_* routines must start in column zero, + and must not be inside #if. + * munch: Removed. + * Makefile.in: Remove references to munch. + * serial.c, remote.c, infptrace.c, maint.c, convex-tdep.c, + alpha-tdep.c, hp300ux-nat.c, hppab-nat.c, osfsolib.c, remote-es.c, + procfs.c, remote-udi.c, ser-go32.c, ultra3-xdep.c, sh-tdep.c, + i960-tdep.c, hppa-tdep.c, h8500-tdep.c, dpx2-nat.c, delta68-nat.c, + z8k-tdep.c: Make sure the above conventions are followed. Make + sure they are all declared as returning void. Clean up + miscellaneous comments and such. + * sh-tdep.c (sim_load): Add function. Thu Oct 21 15:58:48 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 01e177936ba..b4f3f5ed259 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -55,11 +55,6 @@ RANLIB = ranlib # This can be overridden in the host Makefile fragment file. TERMCAP = -ltermcap -# System V: If you compile gdb with a compiler which uses the coff -# encapsulation feature (this is a function of the compiler used, NOT -# of the m-?.h file selected by config.gdb), you must make sure that -# the GNU nm is the one that is used by munch. - # If you are compiling with GCC, make sure that either 1) You have the # fixed include files where GCC can reach them, or 2) You use the # -traditional flag. Otherwise the ioctl calls in inflow.c @@ -314,7 +309,7 @@ SFILES = blockframe.c breakpoint.c buildsym.c c-exp.y c-lang.c \ # Files that are not source code, but need to go into # gdb-$(VERSION).tar.Z. -NONSRC = Makefile.in munch configure.in ChangeLog ChangeLog-9091 \ +NONSRC = Makefile.in configure.in ChangeLog ChangeLog-9091 \ ChangeLog-92 ChangeLog-3.x gdb.1 refcard.ps README TODO TAGS NEWS \ Projects .gdbinit COPYING $(YYFILES) copying.c copying.awk \ saber.suppress standalone.c stuff.c kdb-start.c gcc.patch \ @@ -483,9 +478,33 @@ uninstall: force rm -f $(bindir)/gdb $(man1dir)/gdb.1 @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do -init.c: munch $(OBS) $(TSOBS) - $(srcdir)/munch $(MUNCH_DEFINE) $(OBS) $(TSOBS) > init.c-new - mv init.c-new init.c +# We do this by grepping through sources. If that turns out to be too slow, +# maybe we could just require every .o file to have an initialization routine +# of a given name (remote-udi.o -> _initialize_remote_udi, etc.). +init.c: $(OBS) $(TSOBS) + @echo Making init.c + @rm -f init.c-tmp + @echo '/* Do not modify this file. */' >init.c-tmp + @echo '/* It is created automatically by the Makefile. */'>>init.c-tmp + @echo 'void initialize_all_files () {' >>init.c-tmp + @for i in $(OBS) $(TSOBS); do \ + filename=`echo $$i | sed \ + -e '/^Onindy.o/d' \ + -e '/^nindy.o/d' \ + -e '/ttyflush.o/d' \ + -e '/xdr_ld.o/d' \ + -e '/xdr_ptrace.o/d' \ + -e '/xdr_rdb.o/d' \ + -e '/udr.o/d' \ + -e '/udip2soc.o/d' \ + -e '/version.o/d' \ + -e '/[a-z0-9A-Z_]*-exp.tab.o/d' \ + -e 's/\.o/.c/'` ; \ + sed <$(srcdir)/$$filename >>init.c-tmp -n \ + -e '/^_initialize_[a-z_0-9A-Z]* *(/s/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (); \1 ();}/p' ; \ + done + @echo '}' >>init.c-tmp + @mv init.c-tmp init.c .PRECIOUS: init.c @@ -654,7 +673,7 @@ make-proto-testsuite.dir: force_update clean: @$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(SUBDIRS)" subdir_do - rm -f *.o $(ADD_FILES) *~ + rm -f *.o $(ADD_FILES) *~ init.c-tmp rm -f init.c version.c rm -f gdb core make.log rm -f gdb[0-9] diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index fb4eecf7c88..adaec4b7167 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -51,9 +51,6 @@ alpha_in_lenient_prologue PARAMS ((CORE_ADDR, CORE_ADDR)); static void reinit_frame_cache_sfunc PARAMS ((char *, int, struct cmd_list_element *)); -void -_initialize_alpha_tdep PARAMS ((void)); - /* Heuristic_proc_start may hunt through the text section for a long time across a 2400 baud serial line. Allows the user to limit this search. */ diff --git a/gdb/convex-tdep.c b/gdb/convex-tdep.c index dd4daeb9f35..4fbf34bc57b 100644 --- a/gdb/convex-tdep.c +++ b/gdb/convex-tdep.c @@ -858,6 +858,7 @@ psw_info (arg) } } +void _initialize_convex_dep () { add_com ("alias", class_support, alias_command, diff --git a/gdb/delta68-nat.c b/gdb/delta68-nat.c index d5d004973c5..ab5fa805366 100644 --- a/gdb/delta68-nat.c +++ b/gdb/delta68-nat.c @@ -62,7 +62,8 @@ Internal error: invalid register number %d in REGISTER_U_ADDR\n", CORE_ADDR kernel_u_addr; /* Read the value of the u area from the kernel. */ -void _initialize_kernel_u_addr () +void +_initialize_delta68_nat () { stuct nlist nl[2]; diff --git a/gdb/dpx2-nat.c b/gdb/dpx2-nat.c index ee1ccb75503..c437c7596db 100644 --- a/gdb/dpx2-nat.c +++ b/gdb/dpx2-nat.c @@ -72,7 +72,7 @@ dpx2_register_u_addr (blockend, regnum) CORE_ADDR kernel_u_addr; void -_initialize_kernel_u_addr () +_initialize_dpx2_nat () { struct utsname uts; diff --git a/gdb/h8500-tdep.c b/gdb/h8500-tdep.c index 0ffb02b2e05..cda468ca25c 100644 --- a/gdb/h8500-tdep.c +++ b/gdb/h8500-tdep.c @@ -764,6 +764,7 @@ h8500_set_trapped_internalvar (var, newval, bitpos, bitsize, offset) parse_and_eval (expression); } +void _initialize_h8500_tdep () { add_prefix_cmd ("memory", no_class, set_memory, diff --git a/gdb/hp300ux-nat.c b/gdb/hp300ux-nat.c index d5248fc5ee7..af852fc14e8 100644 --- a/gdb/hp300ux-nat.c +++ b/gdb/hp300ux-nat.c @@ -53,7 +53,8 @@ struct hpnlist { static struct hpnlist nl[] = {{ "_u", -1, }, { (char *) 0, }}; /* read the value of the u area from the hp-ux kernel */ -void _initialize_kernel_u_addr () +void +_initialize_hp300ux_nat () { #ifndef HPUX_VERSION_5 nlist ("/hp-ux", nl); diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 08f9e4ed2e5..92199edd8d9 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -1218,13 +1218,14 @@ unwind_command (exp, from_tty) printf ("%08x\n%08X\n%08X\n%08X\n", xxx.foo[0], xxx.foo[1], xxx.foo[2], xxx.foo[3]); } +#endif /* MAINTENANCE_CMDS */ void _initialize_hppa_tdep () { +#ifdef MAINTENANCE_CMDS add_cmd ("unwind", class_maintenance, unwind_command, "Print unwind table entry at given address.", &maintenanceprintlist); -} - #endif /* MAINTENANCE_CMDS */ +} diff --git a/gdb/hppab-nat.c b/gdb/hppab-nat.c index 5f3cdf724dc..a47474f9669 100644 --- a/gdb/hppab-nat.c +++ b/gdb/hppab-nat.c @@ -135,7 +135,8 @@ struct hpnlist { static struct hpnlist nl[] = {{ "_u", -1, }, { (char *) 0, }}; /* read the value of the u area from the hp-ux kernel */ -void _initialize_kernel_u_addr () +void +_initialize_kernel_u_addr () { struct user u; nlist ("/hp-ux", &nl); diff --git a/gdb/i960-tdep.c b/gdb/i960-tdep.c index df9f04a615e..728474bcf00 100644 --- a/gdb/i960-tdep.c +++ b/gdb/i960-tdep.c @@ -636,6 +636,7 @@ print_fault( siggnal ) /* Initialization stub */ +void _initialize_i960_tdep () { check_host (); diff --git a/gdb/maint.c b/gdb/maint.c index 7addd4e7eb2..35da83f7abf 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -217,27 +217,12 @@ maintenance_print_command (arg, from_tty) help_list (maintenanceprintlist, "maintenance print ", -1, stdout); } -/* - -GLOBAL FUNCTION - - _initialize_maint_cmds -- initialize the process file system stuff - -SYNOPSIS - - void _initialize_maint_cmds (void) - -DESCRIPTION - - Do required initializations during gdb startup for using the - /proc file system interface. - -*/ - +#endif /* MAINTENANCE_CMDS */ void _initialize_maint_cmds () { +#if MAINTENANCE_CMDS /* Entire file goes away if not including maint cmds */ add_prefix_cmd ("maintenance", class_maintenance, maintenance_command, "Commands for use by GDB maintainers.\n\ Includes commands to dump specific internal GDB structures in\n\ @@ -301,7 +286,5 @@ If a SOURCE file is specified, dump only that file's partial symbols.", add_cmd ("objfiles", class_maintenance, maintenance_print_objfiles, "Print dump of current object file definitions.", &maintenanceprintlist); - -} - #endif /* MAINTENANCE_CMDS */ +} diff --git a/gdb/osfsolib.c b/gdb/osfsolib.c index 4006f172f8b..bf272d1c0e1 100644 --- a/gdb/osfsolib.c +++ b/gdb/osfsolib.c @@ -130,9 +130,6 @@ xfer_link_map_member PARAMS ((struct so_list *, struct link_map *)); static void solib_map_sections PARAMS ((struct so_list *)); -void -_initialize_solib PARAMS ((void)); - /* LOCAL FUNCTION diff --git a/gdb/procfs.c b/gdb/procfs.c index 9a6937d15ad..e667c82b634 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -3537,23 +3537,6 @@ struct target_ops procfs_ops = { OPS_MAGIC /* to_magic */ }; -/* - -GLOBAL FUNCTION - - _initialize_procfs -- initialize the process file system stuff - -SYNOPSIS - - void _initialize_procfs (void) - -DESCRIPTION - - Do required initializations during gdb startup for using the - /proc file system interface. - -*/ - void _initialize_procfs () { diff --git a/gdb/remote-es.c b/gdb/remote-es.c index 66a62dae3df..acff4e3aa5e 100644 --- a/gdb/remote-es.c +++ b/gdb/remote-es.c @@ -2250,8 +2250,6 @@ Specify the serial device it is connected to (e.g. /dev/ttya).", OPS_MAGIC /* to_magic (always last) */ }; -/* _initialize_es1800 () */ - void _initialize_es1800 () { diff --git a/gdb/remote-udi.c b/gdb/remote-udi.c index 91fe86b7e70..536d7434f96 100644 --- a/gdb/remote-udi.c +++ b/gdb/remote-udi.c @@ -1589,7 +1589,8 @@ Arguments are\n\ OPS_MAGIC, /* Always the last thing */ }; -void _initialize_remote_udi() +void +_initialize_remote_udi () { add_target (&udi_ops); } diff --git a/gdb/remote.c b/gdb/remote.c index 9bc32dac166..189977ddb96 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -1259,10 +1259,12 @@ Specify the serial device it is connected to (e.g. /dev/ttya).", /* to_doc */ NULL, /* sections_end */ OPS_MAGIC /* to_magic */ }; +#endif /* Use remote. */ void _initialize_remote () { +#if !defined(DONT_USE_REMOTE) add_target (&remote_ops); -} #endif +} diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c index e77fd56320b..68c43b00ffe 100644 --- a/gdb/ser-go32.c +++ b/gdb/ser-go32.c @@ -379,6 +379,7 @@ static struct serial_ops go32_ops = go32_setbaudrate, }; +void _initialize_ser_go32 () { serial_add_interface (&go32_ops); diff --git a/gdb/serial.c b/gdb/serial.c index 6913fd6e239..70f4323a7d3 100644 --- a/gdb/serial.c +++ b/gdb/serial.c @@ -250,12 +250,14 @@ connect_command (args, fromtty) } } } +#endif /* 0 */ void _initialize_serial () { +#if 0 add_com ("connect", class_obscure, connect_command, "Connect the terminal directly up to the command monitor.\n\ Use ~. or ~^D to break out."); -} #endif /* 0 */ +} diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 5b89780ed27..3b04d54fb47 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -254,6 +254,7 @@ char *prog; return sim_load_standard (abfd); } +void _initialize_sh_tdep () { extern int sim_memory_size; diff --git a/gdb/ultra3-xdep.c b/gdb/ultra3-xdep.c index fb24657fed3..ff566226050 100644 --- a/gdb/ultra3-xdep.c +++ b/gdb/ultra3-xdep.c @@ -119,6 +119,7 @@ unsigned int sigmask; /* Initialization code for this module. */ +void _initialize_ultra3 () { #ifdef SYM1 diff --git a/gdb/z8k-tdep.c b/gdb/z8k-tdep.c index e6b5e8aff97..cf6060bc975 100644 --- a/gdb/z8k-tdep.c +++ b/gdb/z8k-tdep.c @@ -461,6 +461,7 @@ set_memory (args, from_tty) help_list (setmemorylist, "set memory ", -1, stdout); } +void _initialize_z8ktdep () { add_prefix_cmd ("memory", no_class, set_memory,