Obsolete stuff.c and kdb-start.c.

This commit is contained in:
Andrew Cagney
2001-03-23 00:58:48 +00:00
parent 41899c0412
commit 17e78a56e2
5 changed files with 224 additions and 221 deletions

View File

@ -1,3 +1,11 @@
2001-03-22 Andrew Cagney <ac131313@redhat.com>
* Makefile.in (NTSSTART): Delete.
(NTSOBS): Delete.
(kdb): Delete target.
* kdb-start.c, stuff.c: Mark as obsolete.
* NEWS: Update.
2001-03-22 Andrew Cagney <ac131313@redhat.com> 2001-03-22 Andrew Cagney <ac131313@redhat.com>
* config/pa/xm-hppah.h (HPPA_COMPILER_BUG): Delete. GDB only * config/pa/xm-hppah.h (HPPA_COMPILER_BUG): Delete. GDB only

View File

@ -692,10 +692,6 @@ OBS = $(COMMON_OBS) $(ANNOTATE_OBS)
TSOBS = inflow.o TSOBS = inflow.o
NTSOBS = standalone.o
NTSSTART = kdb-start.o
SUBDIRS = @SUBDIRS@ SUBDIRS = @SUBDIRS@
# For now, shortcut the "configure GDB for fewer languages" stuff. # For now, shortcut the "configure GDB for fewer languages" stuff.
@ -902,10 +898,6 @@ tm-sun4os4.h: tm-sparc.h
xm-vaxult.h: xm-vax.h xm-vaxult.h: xm-vax.h
xm-vaxbsd.h: xm-vax.h xm-vaxbsd.h: xm-vax.h
kdb: $(NTSSTART) $(OBS) $(CONFIG_OBS) $(NTSOBS) $(ADD_DEPS) $(CDEPS)
ld -o kdb $(NTSSTART) $(OBS) $(CONFIG_OBS) $(NTSOBS) init.o \
$(ADD_FILES) -lc $(CLIBS)
# Put the proper machine-specific files first, so M-. on a machine # Put the proper machine-specific files first, so M-. on a machine
# specific routine gets the one for the correct machine. (FIXME: those # specific routine gets the one for the correct machine. (FIXME: those
# files go in twice; we should be removing them from the main list). # files go in twice; we should be removing them from the main list).

View File

@ -12,11 +12,14 @@ x86 FreeBSD 3.x and 4.x i[3456]86*-freebsd[34]*
* New targets * New targets
* OBSOLETE configurations * OBSOLETE configurations and files
x86 FreeBSD before 2.2 i[3456]86*-freebsd{1,2.[01]}*, x86 FreeBSD before 2.2 i[3456]86*-freebsd{1,2.[01]}*,
Harris/CXUX m88k m88*-harris-cxux* Harris/CXUX m88k m88*-harris-cxux*
stuff.c (Program to stuff files into a specially prepared space in kdb)
kdb-start.c (Main loop for the standalone kernel debugger)
Configurations that have been declared obsolete in this release have Configurations that have been declared obsolete in this release have
been commented out. Unless there is activity to revive these been commented out. Unless there is activity to revive these
configurations, the next release of GDB will have their sources configurations, the next release of GDB will have their sources

View File

@ -1,38 +1,38 @@
/* Main loop for the standalone kernel debugger, for GDB, the GNU Debugger. /* OBSOLETE /* Main loop for the standalone kernel debugger, for GDB, the GNU Debugger. */
Copyright 1989, 1991, 1992, 2000 Free Software Foundation, Inc. /* OBSOLETE Copyright 1989, 1991, 1992, 2000 Free Software Foundation, Inc. */
/* OBSOLETE */
This file is part of GDB. /* OBSOLETE This file is part of GDB. */
/* OBSOLETE */
This program is free software; you can redistribute it and/or modify /* OBSOLETE 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 /* OBSOLETE it under the terms of the GNU General Public License as published by */
the Free Software Foundation; either version 2 of the License, or /* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
(at your option) any later version. /* OBSOLETE (at your option) any later version. */
/* OBSOLETE */
This program is distributed in the hope that it will be useful, /* OBSOLETE This program is distributed in the hope that it will be useful, */
but WITHOUT ANY WARRANTY; without even the implied warranty of /* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the /* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
GNU General Public License for more details. /* OBSOLETE GNU General Public License for more details. */
/* OBSOLETE */
You should have received a copy of the GNU General Public License /* OBSOLETE You should have received a copy of the GNU General Public License */
along with this program; if not, write to the Free Software /* OBSOLETE along with this program; if not, write to the Free Software */
Foundation, Inc., 59 Temple Place - Suite 330, /* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, */
Boston, MA 02111-1307, USA. */ /* OBSOLETE Boston, MA 02111-1307, USA. */ */
/* OBSOLETE */
#include "defs.h" /* OBSOLETE #include "defs.h" */
/* OBSOLETE */
static char *args[] = /* OBSOLETE static char *args[] = */
{"kdb", "kdb-symbols", 0}; /* OBSOLETE {"kdb", "kdb-symbols", 0}; */
/* OBSOLETE */
static char *environment[] = /* OBSOLETE static char *environment[] = */
{0}; /* OBSOLETE {0}; */
/* OBSOLETE */
char **environ; /* OBSOLETE char **environ; */
/* OBSOLETE */
start (void) /* OBSOLETE start (void) */
{ /* OBSOLETE { */
INIT_STACK (kdb_stack_beg, kdb_stack_end); /* OBSOLETE INIT_STACK (kdb_stack_beg, kdb_stack_end); */
/* OBSOLETE */
environ = environment; /* OBSOLETE environ = environment; */
/* OBSOLETE */
main (2, args, environment); /* OBSOLETE main (2, args, environment); */
} /* OBSOLETE } */

View File

@ -1,174 +1,174 @@
/* Program to stuff files into a specially prepared space in kdb. /* OBSOLETE /* Program to stuff files into a specially prepared space in kdb. */
Copyright 1986, 1989, 1991, 1992, 1995, 2000 /* OBSOLETE Copyright 1986, 1989, 1991, 1992, 1995, 2000 */
Free Software Foundation, Inc. /* OBSOLETE Free Software Foundation, Inc. */
/* OBSOLETE */
This file is part of GDB. /* OBSOLETE This file is part of GDB. */
/* OBSOLETE */
This program is free software; you can redistribute it and/or modify /* OBSOLETE 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 /* OBSOLETE it under the terms of the GNU General Public License as published by */
the Free Software Foundation; either version 2 of the License, or /* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
(at your option) any later version. /* OBSOLETE (at your option) any later version. */
/* OBSOLETE */
This program is distributed in the hope that it will be useful, /* OBSOLETE This program is distributed in the hope that it will be useful, */
but WITHOUT ANY WARRANTY; without even the implied warranty of /* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the /* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
GNU General Public License for more details. /* OBSOLETE GNU General Public License for more details. */
/* OBSOLETE */
You should have received a copy of the GNU General Public License /* OBSOLETE You should have received a copy of the GNU General Public License */
along with this program; if not, write to the Free Software /* OBSOLETE along with this program; if not, write to the Free Software */
Foundation, Inc., 59 Temple Place - Suite 330, /* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, */
Boston, MA 02111-1307, USA. */ /* OBSOLETE Boston, MA 02111-1307, USA. */ */
/* OBSOLETE */
/* Written 13-Mar-86 by David Bridgham. */ /* OBSOLETE /* Written 13-Mar-86 by David Bridgham. */ */
/* OBSOLETE */
#include <stdio.h> /* OBSOLETE #include <stdio.h> */
#include <a.out.h> /* OBSOLETE #include <a.out.h> */
#include <sys/types.h> /* OBSOLETE #include <sys/types.h> */
#include "gdb_stat.h" /* OBSOLETE #include "gdb_stat.h" */
#include <sys/file.h> /* OBSOLETE #include <sys/file.h> */
#include <varargs.h> /* OBSOLETE #include <varargs.h> */
/* OBSOLETE */
main (argc, argv) /* OBSOLETE main (argc, argv) */
int argc; /* OBSOLETE int argc; */
char *argv[]; /* OBSOLETE char *argv[]; */
{ /* OBSOLETE { */
register char *cp; /* OBSOLETE register char *cp; */
char *outfile; /* OBSOLETE char *outfile; */
register int i; /* OBSOLETE register int i; */
int offset; /* OBSOLETE int offset; */
int out_fd, in_fd; /* OBSOLETE int out_fd, in_fd; */
struct stat stat_buf; /* OBSOLETE struct stat stat_buf; */
int size, pad; /* OBSOLETE int size, pad; */
char buf[1024]; /* OBSOLETE char buf[1024]; */
static char zeros[4] = /* OBSOLETE static char zeros[4] = */
{0}; /* OBSOLETE {0}; */
/* OBSOLETE */
if (argc < 4) /* OBSOLETE if (argc < 4) */
err ("Not enough arguments\nUsage: %s -o kdb file1 file2 ...\n", /* OBSOLETE err ("Not enough arguments\nUsage: %s -o kdb file1 file2 ...\n", */
argv[0]); /* OBSOLETE argv[0]); */
/* OBSOLETE */
outfile = 0; /* OBSOLETE outfile = 0; */
for (i = 1; i < argc; i++) /* OBSOLETE for (i = 1; i < argc; i++) */
{ /* OBSOLETE { */
if (STREQ (argv[i], "-o")) /* OBSOLETE if (STREQ (argv[i], "-o")) */
outfile = argv[++i]; /* OBSOLETE outfile = argv[++i]; */
} /* OBSOLETE } */
if (outfile == 0) /* OBSOLETE if (outfile == 0) */
err ("Output file not specified\n"); /* OBSOLETE err ("Output file not specified\n"); */
/* OBSOLETE */
offset = get_offset (outfile, "_heap"); /* OBSOLETE offset = get_offset (outfile, "_heap"); */
/* OBSOLETE */
out_fd = open (outfile, O_WRONLY); /* OBSOLETE out_fd = open (outfile, O_WRONLY); */
if (out_fd < 0) /* OBSOLETE if (out_fd < 0) */
err ("Error opening %s for write: %s\n", outfile, strerror (errno)); /* OBSOLETE err ("Error opening %s for write: %s\n", outfile, strerror (errno)); */
if (lseek (out_fd, offset, 0) < 0) /* OBSOLETE if (lseek (out_fd, offset, 0) < 0) */
err ("Error seeking to heap in %s: %s\n", outfile, strerror (errno)); /* OBSOLETE err ("Error seeking to heap in %s: %s\n", outfile, strerror (errno)); */
/* OBSOLETE */
/* For each file listed on the command line, write it into the /* OBSOLETE /* For each file listed on the command line, write it into the */
* 'heap' of the output file. Make sure to skip the arguments /* OBSOLETE * 'heap' of the output file. Make sure to skip the arguments */
* that name the output file. */ /* OBSOLETE * that name the output file. */ */
for (i = 1; i < argc; i++) /* OBSOLETE for (i = 1; i < argc; i++) */
{ /* OBSOLETE { */
if (STREQ (argv[i], "-o")) /* OBSOLETE if (STREQ (argv[i], "-o")) */
continue; /* OBSOLETE continue; */
if ((in_fd = open (argv[i], O_RDONLY)) < 0) /* OBSOLETE if ((in_fd = open (argv[i], O_RDONLY)) < 0) */
err ("Error opening %s for read: %s\n", argv[i], /* OBSOLETE err ("Error opening %s for read: %s\n", argv[i], */
strerror (errno)); /* OBSOLETE strerror (errno)); */
if (fstat (in_fd, &stat_buf) < 0) /* OBSOLETE if (fstat (in_fd, &stat_buf) < 0) */
err ("Error stat'ing %s: %s\n", argv[i], strerror (errno)); /* OBSOLETE err ("Error stat'ing %s: %s\n", argv[i], strerror (errno)); */
size = strlen (argv[i]); /* OBSOLETE size = strlen (argv[i]); */
pad = 4 - (size & 3); /* OBSOLETE pad = 4 - (size & 3); */
size += pad + stat_buf.st_size + sizeof (int); /* OBSOLETE size += pad + stat_buf.st_size + sizeof (int); */
write (out_fd, &size, sizeof (int)); /* OBSOLETE write (out_fd, &size, sizeof (int)); */
write (out_fd, argv[i], strlen (argv[i])); /* OBSOLETE write (out_fd, argv[i], strlen (argv[i])); */
write (out_fd, zeros, pad); /* OBSOLETE write (out_fd, zeros, pad); */
while ((size = read (in_fd, buf, sizeof (buf))) > 0) /* OBSOLETE while ((size = read (in_fd, buf, sizeof (buf))) > 0) */
write (out_fd, buf, size); /* OBSOLETE write (out_fd, buf, size); */
close (in_fd); /* OBSOLETE close (in_fd); */
} /* OBSOLETE } */
size = 0; /* OBSOLETE size = 0; */
write (out_fd, &size, sizeof (int)); /* OBSOLETE write (out_fd, &size, sizeof (int)); */
close (out_fd); /* OBSOLETE close (out_fd); */
return (0); /* OBSOLETE return (0); */
} /* OBSOLETE } */
/* OBSOLETE */
/* Read symbol table from file and returns the offset into the file /* OBSOLETE /* Read symbol table from file and returns the offset into the file */
* where symbol sym_name is located. If error, print message and /* OBSOLETE * where symbol sym_name is located. If error, print message and */
* exit. */ /* OBSOLETE * exit. */ */
get_offset (char *file, char *sym_name) /* OBSOLETE get_offset (char *file, char *sym_name) */
{ /* OBSOLETE { */
int f; /* OBSOLETE int f; */
struct exec file_hdr; /* OBSOLETE struct exec file_hdr; */
struct nlist *symbol_table; /* OBSOLETE struct nlist *symbol_table; */
int size; /* OBSOLETE int size; */
char *strings; /* OBSOLETE char *strings; */
/* OBSOLETE */
f = open (file, O_RDONLY); /* OBSOLETE f = open (file, O_RDONLY); */
if (f < 0) /* OBSOLETE if (f < 0) */
err ("Error opening %s: %s\n", file, strerror (errno)); /* OBSOLETE err ("Error opening %s: %s\n", file, strerror (errno)); */
if (read (f, &file_hdr, sizeof (file_hdr)) < 0) /* OBSOLETE if (read (f, &file_hdr, sizeof (file_hdr)) < 0) */
err ("Error reading exec structure: %s\n", strerror (errno)); /* OBSOLETE err ("Error reading exec structure: %s\n", strerror (errno)); */
if (N_BADMAG (file_hdr)) /* OBSOLETE if (N_BADMAG (file_hdr)) */
err ("File %s not an a.out file\n", file); /* OBSOLETE err ("File %s not an a.out file\n", file); */
/* OBSOLETE */
/* read in symbol table */ /* OBSOLETE /* read in symbol table */ */
if ((symbol_table = (struct nlist *) malloc (file_hdr.a_syms)) == 0) /* OBSOLETE if ((symbol_table = (struct nlist *) malloc (file_hdr.a_syms)) == 0) */
err ("Couldn't allocate space for symbol table\n"); /* OBSOLETE err ("Couldn't allocate space for symbol table\n"); */
if (lseek (f, N_SYMOFF (file_hdr), 0) == -1) /* OBSOLETE if (lseek (f, N_SYMOFF (file_hdr), 0) == -1) */
err ("lseek error: %s\n", strerror (errno)); /* OBSOLETE err ("lseek error: %s\n", strerror (errno)); */
if (read (f, symbol_table, file_hdr.a_syms) == -1) /* OBSOLETE if (read (f, symbol_table, file_hdr.a_syms) == -1) */
err ("Error reading symbol table from %s: %s\n", file, /* OBSOLETE err ("Error reading symbol table from %s: %s\n", file, */
strerror (errno)); /* OBSOLETE strerror (errno)); */
/* OBSOLETE */
/* read in string table */ /* OBSOLETE /* read in string table */ */
if (read (f, &size, 4) == -1) /* OBSOLETE if (read (f, &size, 4) == -1) */
err ("reading string table size: %s\n", strerror (errno)); /* OBSOLETE err ("reading string table size: %s\n", strerror (errno)); */
if ((strings = (char *) malloc (size)) == 0) /* OBSOLETE if ((strings = (char *) malloc (size)) == 0) */
err ("Couldn't allocate memory for string table\n"); /* OBSOLETE err ("Couldn't allocate memory for string table\n"); */
if (read (f, strings, size - 4) == -1) /* OBSOLETE if (read (f, strings, size - 4) == -1) */
err ("reading string table: %s\n", strerror (errno)); /* OBSOLETE err ("reading string table: %s\n", strerror (errno)); */
/* OBSOLETE */
/* Find the core address at which the first byte of kdb text segment /* OBSOLETE /* Find the core address at which the first byte of kdb text segment */
should be loaded into core when kdb is run. */ /* OBSOLETE should be loaded into core when kdb is run. */ */
origin = find_symbol ("_etext", symbol_table, file_hdr.a_syms, strings) /* OBSOLETE origin = find_symbol ("_etext", symbol_table, file_hdr.a_syms, strings) */
- file_hdr.a_text; /* OBSOLETE - file_hdr.a_text; */
/* Find the core address at which the heap will appear. */ /* OBSOLETE /* Find the core address at which the heap will appear. */ */
coreaddr = find_symbol (sym_name, symbol_table, file_hdr.a_syms, strings); /* OBSOLETE coreaddr = find_symbol (sym_name, symbol_table, file_hdr.a_syms, strings); */
/* Return address in file of the heap data space. */ /* OBSOLETE /* Return address in file of the heap data space. */ */
return (N_TXTOFF (file_hdr) + core_addr - origin); /* OBSOLETE return (N_TXTOFF (file_hdr) + core_addr - origin); */
} /* OBSOLETE } */
/* OBSOLETE */
find_symbol (char *sym_name, struct nlist *symbol_table, int length, /* OBSOLETE find_symbol (char *sym_name, struct nlist *symbol_table, int length, */
char *strings) /* OBSOLETE char *strings) */
{ /* OBSOLETE { */
register struct nlist *sym; /* OBSOLETE register struct nlist *sym; */
/* OBSOLETE */
/* Find symbol in question */ /* OBSOLETE /* Find symbol in question */ */
for (sym = symbol_table; /* OBSOLETE for (sym = symbol_table; */
sym != (struct nlist *) ((char *) symbol_table + length); /* OBSOLETE sym != (struct nlist *) ((char *) symbol_table + length); */
sym++) /* OBSOLETE sym++) */
{ /* OBSOLETE { */
if ((sym->n_type & N_TYPE) != N_DATA) /* OBSOLETE if ((sym->n_type & N_TYPE) != N_DATA) */
continue; /* OBSOLETE continue; */
if (sym->n_un.n_strx == 0) /* OBSOLETE if (sym->n_un.n_strx == 0) */
continue; /* OBSOLETE continue; */
if (STREQ (sym_name, strings + sym->n_un.n_strx - 4)) /* OBSOLETE if (STREQ (sym_name, strings + sym->n_un.n_strx - 4)) */
return sym->n_value; /* OBSOLETE return sym->n_value; */
} /* OBSOLETE } */
err ("Data symbol %s not found in %s\n", sym_name, file); /* OBSOLETE err ("Data symbol %s not found in %s\n", sym_name, file); */
} /* OBSOLETE } */
/* OBSOLETE */
/* VARARGS */ /* OBSOLETE /* VARARGS */ */
void /* OBSOLETE void */
err (va_alist) /* OBSOLETE err (va_alist) */
va_dcl /* OBSOLETE va_dcl */
{ /* OBSOLETE { */
va_list args; /* OBSOLETE va_list args; */
char *string; /* OBSOLETE char *string; */
/* OBSOLETE */
va_start (args); /* OBSOLETE va_start (args); */
string = va_arg (args, char *); /* OBSOLETE string = va_arg (args, char *); */
vfprintf (gdb_stderr, string, args); /* OBSOLETE vfprintf (gdb_stderr, string, args); */
va_end (args); /* OBSOLETE va_end (args); */
exit (-1); /* OBSOLETE exit (-1); */
} /* OBSOLETE } */