* main.c: Move entire file except for #ifndef MAIN_OVERRIDE code

to new file top.c.  Make things extern instead of static and
	similar rearrangements to deal with this.
	* top.h: New file.
	* utils.c: Move fputs_unfiltered to main.c.  Remove
	FPUTS_UNFILTERED_OVERRIDE ifndef.
	* Makefile.in: Change so that gdb uses main.c, utils.c, and top.c,
	and libgdb uses utils.c and top.c.
This commit is contained in:
Jim Kingdon 1994-06-03 17:25:08 +00:00
parent 4ee3b9beb1
commit 172559ec33
5 changed files with 2566 additions and 15 deletions

View File

@ -293,6 +293,8 @@ terminal.h
testsuite
thread.c
thread.h
top.c
top.h
typeprint.c
typeprint.h
ultra3-nat.c

View File

@ -1,3 +1,14 @@
Fri Jun 3 09:15:00 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
* main.c: Move entire file except for #ifndef MAIN_OVERRIDE code
to new file top.c. Make things extern instead of static and
similar rearrangements to deal with this.
* top.h: New file.
* utils.c: Move fputs_unfiltered to main.c. Remove
FPUTS_UNFILTERED_OVERRIDE ifndef.
* Makefile.in: Change so that gdb uses main.c, utils.c, and top.c,
and libgdb uses utils.c and top.c.
Thu Jun 2 23:19:10 1994 Jeff Law (law@snake.cs.utah.edu)
* hppa-tdep.c (skip_trampoline_code): Fix typo.

View File

@ -304,7 +304,8 @@ SFILES = blockframe.c breakpoint.c buildsym.c c-exp.y c-lang.c \
m2-exp.y m2-lang.c m2-typeprint.c m2-valprint.c main.c maint.c \
mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c parse.c \
printcmd.c remote.c source.c stabsread.c stack.c symfile.c symmisc.c \
symtab.c target.c thread.c typeprint.c utils.c valarith.c valops.c \
symtab.c target.c thread.c top.c \
typeprint.c utils.c valarith.c valops.c \
valprint.c values.c serial.c ser-unix.c mdebugread.c os9kread.c
# Files that are not source code, but need to go into
@ -398,7 +399,7 @@ HFILES_NO_SRCDIR = buildsym.h call-cmds.h coff-solib.h defs.h dst.h environ.h \
vx-share/dbgRpcLib.h vx-share/ptrace.h vx-share/vxTypes.h \
vx-share/vxWorks.h vx-share/wait.h vx-share/xdr_ld.h \
vx-share/xdr_ptrace.h vx-share/xdr_rdb.h thread.h \
dcache.h remote-utils.h remote-sim.h
dcache.h remote-utils.h remote-sim.h top.h
# Header files that already have srcdir in them, or which are in objdir.
@ -445,11 +446,11 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o stack.o thread.o \
dwarfread.o mipsread.o stabsread.o core.o c-lang.o ch-lang.o m2-lang.o \
complaints.o typeprint.o c-typeprint.o ch-typeprint.o m2-typeprint.o \
c-valprint.o cp-valprint.o ch-valprint.o m2-valprint.o nlmread.o \
serial.o mdebugread.o os9kread.o
serial.o mdebugread.o os9kread.o top.o utils.o
OBS = $(COMMON_OBS) main.o utils.o annotate.o
OBS = $(COMMON_OBS) main.o annotate.o
LIBGDB_OBS = libmain.o libutils.o
LIBGDB_OBS =
TSOBS = inflow.o
@ -568,14 +569,6 @@ libgdb-files: $(LIBGDBDEPS) Makefile.in
echo $$i >> libgdb-files;\
done
libmain.o: main.c
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/main.c -DMAIN_OVERRIDE \
-o libmain.o
libutils.o: utils.c
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/utils.c -o libutils.o \
-DFPUTS_UNFILTERED_OVERRIDE
saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c
#setopt load_flags $(CFLAGS) $(BFD_CFLAGS) -DHOST_SYS=SUN4_SYS
#load ./init.c $(SFILES)
@ -1290,10 +1283,12 @@ m88k-nat.o: m88k-nat.c $(defs_h) $(gdbcore_h) $(inferior_h)
m88k-pinsn.o: m88k-pinsn.c $(defs_h) $(symtab_h)
m88k-tdep.o: m88k-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
main.o: main.c $(bfd_h) $(getopt_h) $(readline_headers) call-cmds.h \
top.o: top.c top.h $(bfd_h) $(getopt_h) $(readline_headers) call-cmds.h \
$(defs_h) $(gdbcmd_h) $(inferior_h) language.h signals.h \
$(remote_utils_h)
$(CC) -c $(INTERNAL_CFLAGS) $(READLINE_CFLAGS) $(srcdir)/main.c
$(CC) -c $(INTERNAL_CFLAGS) $(READLINE_CFLAGS) $(srcdir)/top.c
main.o: main.c top.h $(defs_h)
maint.o: maint.c $(defs_h) $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) language.h \
$(expression_h)

2495
gdb/top.c Normal file

File diff suppressed because it is too large Load Diff

48
gdb/top.h Normal file
View File

@ -0,0 +1,48 @@
/* Top level stuff for GDB, the GNU debugger.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994
Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* From top.c. */
extern char *line;
extern int linesize;
extern FILE *instream;
extern char dirbuf[1024];
extern int inhibit_gdbinit;
extern int epoch_interface;
extern char gdbinit[];
/* Generally one should use catch_errors rather than manipulating these
directly. The exception is main(). */
extern jmp_buf error_return;
extern jmp_buf quit_return;
extern void print_gdb_version PARAMS ((GDB_FILE *));
extern void print_gnu_advertisement PARAMS ((void));
extern void source_command PARAMS ((char *, int));
extern void cd_command PARAMS ((char *, int));
extern void read_command_file PARAMS ((FILE *));
extern void init_history PARAMS ((void));
extern void command_loop PARAMS ((void));
extern void quit_command PARAMS ((char *, int));
/* From random places. */
extern int mapped_symbol_files;
extern int readnow_symbol_files;
#define ALL_CLEANUPS ((struct cleanup *)0)