[gnu.gdb.bug] GDB: support for vanilla System V

ian@UUNET.UU.NET (12/01/88)

(Sorry if you've seen this before but I sent it to bug-gnu-emacs
not realising that bug-gdb existed)

In GDB 2.7 on sibyl (usg-unix-v)

This is not so much a bug report as a contribution to support running
GDB on vanilla system 5 systems (the National Semiconductor port to
be precise). Sorry if this is not the correct address for this sort of
thing but I don't know of any where else to send it.

The changes are as follows:

System V support:
	This has been done rather in the style of emacs. There is a new
	file called sysdep.c which contains routines to emulate under
	system V, BSD specific functions. There is also a new include
	file, config.h, which contains operating system dependent
	definitions. Param.h could have been used for this but it seemed
	cleaner to keep param.h for the really implimentation specific
	stuff.

Floating Point printing:
	The way GDB behaved with INVALID_FLOATS was pretty unfriendly. If
	it found an invalid float while printing a structure, or union etc,
	it printed a message and gave up. The user might at want to know
	a) what is in the other fields of the structure, and b) what the
	hex code of the INVALID_FLOAT is. Both these enhancements have
	been implimented.

Coff file support:
	There was a bug in the handling of COFF symbol tables. It could
	sometimes use the tag field of an auxillary entry when there was
	nothing valid there. That code has been tightened up. Also, at least
	on this (NS Sys V) system it is possible for bad C code to generate
	coff files with bad symbol tables. Gdb, as distributed, contained
	multiple definitions of some variables and cc/as/ld generated a bad
	symbol table. When I did "gdb gdb" I got a core dump.  I have
	added some code which does some sanity checking of tag values
	which makes it possible to still work with such bad files. I have
	also fixed the multiple definitions in GDB.

NS32k Support:
	I have altered ns32k-pinsn.c to support printing invalid
	floating point operands in the style <<invalid float (0x....)>>.

NS System V specific support:
	Such things as function prologs and offsets in the kernal user area
	have been supported by providing m-ns5.h and m-ns5init.h.

I think I have introduced these changes without breaking anything else but
I don't have access to all the other machines/systems so I can't be 100%
certain I haven't stuffed up. I have tried to make changes in keeping
with the style of the rest of the code but feel free to alter/incorporate
these changes as you see fit. (No doubt you will do that anyway :-) ).

There are 5 parts because outgoing overseas mail from here must be
less than 25k. Part 1 contains a shar archive containing the new
files. Parts 2 to 5 contain shar archives of the patch files to make
the changes to the the existing files. The patch files are context
differences.

Part 1 of 5:

--------------Cut Here-----------------------
# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by ian on Thu Nov 24 00:37:11 CST 1988
# Contents:  sysdep.c m-ns5.h m-ns5init.h ns5-config.h
 
echo x - sysdep.c
sed 's/^@//' > "sysdep.c" <<'@//E*O*F sysdep.c//'
#include "config.h"
#include <stdio.h>

char *sys_siglist[] = { "", "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL",
			"SIGTRAP", "SIGIOT", "SIGEMT", "SIGFPE", "SIGKILL",
			"SIGBUS", "SIGSEGV", "SIGSYS", "SIGPIPE", "SIGALRM",
			"SIGTERM", "SIGUSR1", "SIGUSR2", "SIGCLD", "SIGPWR"};

static char *regbuf = NULL;

char *re_comp(s)
     char *s;
{
  char *regcmp();
  if(s == NULL || *s == '\0') return (NULL);
  if(regbuf != NULL) {free(regbuf); regbuf = NULL;}
  return (((regbuf = regcmp(s, (char *)0)) == NULL) ?
	  "Invalid regular expression": NULL);
}

int re_exec(s)
     char *s;
{
  char *regex();
  if (regbuf == NULL) return (-1);
  return((regex(regbuf, s) == NULL) ? 0: 1);
}

struct qelm {
  struct qelm *q_forw;
  struct qelm *q_back;
  char *q_data;
};

int insque(elem, pred)
     struct qelm *elem, *pred;
{
  struct qelm *succ;

  succ = pred->q_forw;
  pred->q_forw = elem;
  elem->q_forw = succ;
  succ->q_back = elem;
  elem->q_back = pred;
}

int remque(elem)
     struct qelm *elem;
{
  elem->q_back->q_forw = elem->q_forw;
  elem->q_forw->q_back = elem->q_back;
}

#ifndef HAVE_DUP2
/*
 *	Emulate BSD dup2(2).  First close newd if it already exists.
 *	Then, attempt to dup oldd.  If not successful, call dup2 recursively
 *	until we are, then close the unsuccessful ones.
 */

dup2 (oldd, newd)
     int oldd;
     int newd;
{
  register int fd;
  
  close (newd);

#ifdef F_DUPFD
  fd = fcntl (oldd, F_DUPFD, newd);
  if (fd != newd)
    error ("cant dup2(%i,%i) : %s", oldd, newd, sys_errlist[errno]);
#else
  while ((fd = dup (oldd)) != newd)
    {
      dup2 (oldd, newd);
      close (fd);
    }
#endif
}

#endif /* not HAVE_DUP2 */
@//E*O*F sysdep.c//
chmod u=rw,g=r,o=r sysdep.c
 
echo x - m-ns5.h
sed 's/^@//' > "m-ns5.h" <<'@//E*O*F m-ns5.h//'
/* Definitions to make GDB run on a ICM-3216
   Copyright (C) 1986, 1987 Free Software Foundation, Inc.

GDB is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY.  No author or distributor accepts responsibility to anyone
for the consequences of using it or for whether it serves any
particular purpose or works at all, unless he says so in writing.
Refer to the GDB General Public License for full details.

Everyone is granted permission to copy, modify and redistribute GDB,
but only under the conditions described in the GDB General Public
License.  A copy of this license is supposed to have been given to you
along with GDB so you can know your rights and responsibilities.  It
should be in a file named COPYING.  Among other things, the copyright
notice and this notice must be preserved on all copies.

In other words, go ahead and share GDB, but don't try to stop
anyone else from sharing it farther.  Help stamp out software hoarding!
*/

#ifndef ns16000
#define ns16000
#endif


# include	<sys/reg.h>

/* Define this if the C compiler puts an underscore at the front
   of external names before giving them to the linker.  */

#define NAMES_HAVE_UNDERSCORE

/* Debugger information will be in DBX format.  */

/* #define READ_DBX_FORMAT */

/* Offset from address of function to start of its code.
   Zero on most machines.  */

#define FUNCTION_START_OFFSET 0

/* Advance PC across any function entry prologue instructions
   to reach some "real" code.  */

#define SKIP_PROLOGUE(pc)   				\
{ register unsigned char op = read_memory_integer (pc, 1);	\
  /* There might be an ENTER instruction to set up the stack frame */  \
  if (op == 0x82)					\
    { op = read_memory_integer (pc+2,1);		\
      if ((op & 0x80) == 0) pc += 3;			\
      else if ((op & 0xc0) == 0x80) pc += 4;		\
      else pc += 6;					\
    }		        						\
  /* Otherwise there might be a branch to the ENTER instruction to set  \
     up the stack frame */ 						\
  else if (op == 0xea)							\
    {									\
      int disp, off = 0;						\
      read_memory (pc+1, &disp, 4);					\
      disp = get_displacement (&disp, &off);				\
      if ( (op = read_memory_integer (pc + disp, 1)) == 0x82)		\
	pc += (off/8 + 1);						\
    }									\
}

/* Immediately after a function call, return the saved pc.
   Can't always go through the frames for this because on some machines
   the new frame is not set up until the new function executes
   some instructions.  */

#define SAVED_PC_AFTER_CALL(frame) \
	read_memory_integer (read_register (SP_REGNUM), 4)

/* This is the amount to subtract from u.u_ar0
   to get the offset in the core file of the register values.  */

#define KERNEL_U_ADDR (0x810000)	/* This is the start of the user area */

/* Address of end of stack space.  */

#define STACK_END_ADDR (0x1000000)

/* Stack grows downward.  */

#define INNER_THAN <

/* Sequence of bytes for breakpoint instruction.  */

#define BREAKPOINT {0xf2}

/* Amount PC must be decremented by after a breakpoint.
   This is often the number of bytes in BREAKPOINT
   but not always.  */

#define DECR_PC_AFTER_BREAK 0

/* Nonzero if instruction at PC is a return instruction.  */

#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0x12)

#define IEEE_FLOAT

/* Return 1 if P points to an invalid floating point value.  */

#define INVALID_FLOAT invalid_float /* A function in ns32k-pinsin.c */

/* Define this to say that the "svc" insn is followed by
   codes in memory saying which kind of system call it is.  */

/* #define NS32K_SVC_IMMED_OPERANDS */

/* Say how long (ordinary) registers are.  */

#define REGISTER_TYPE long

/* Number of machine registers */

#define NUM_REGS		25

#define NUM_GENERAL_REGS	8

/* Initializer for an array of names of registers.
   There should be NUM_REGS strings in this initializer.  */

#define REGISTER_NAMES {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",	\
			"pc", "sp", "fp", "ps",				\
 			"fsr",						\
 			"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",	\
			"l0", "l1", "l2", "l3", "l4",			\
 			}

/* Register numbers of various important registers.
   Note that some of these values are "real" register numbers,
   and correspond to the general registers of the machine,
   and some are "phony" register numbers which are too large
   to be actual register numbers as far as the user is concerned
   but do serve to get the desired values when passed to read_register.  */

#define AP_REGNUM FP_REGNUM
#define FP_REGNUM 10		/* Contains address of executing stack frame */
#define SP_REGNUM 9		/* Contains address of top of stack */
#define PC_REGNUM 8		/* Contains program counter */
#define PS_REGNUM 11		/* Contains processor status */
#define FPS_REGNUM 12		/* Floating point status register */
#define FP0_REGNUM 13		/* Floating point register 0 */
#define LP0_REGNUM 21		/* Double register 0 (same as FP0) */
#define FS 0x208		/* Guess at the moment */
#define F0 0x20c		/* where the floating point registers go*/

#define REGISTER_U_ADDR(addr, blockend, regno) \
{ 									\
  switch (regno) {							\
  case 0:                                                               \
        addr = blockend + R0 * sizeof (int); break;			\
  case 1:                                                               \
        addr = blockend + R1 * sizeof (int); break;			\
  case 2:                                                               \
        addr = blockend + R2 * sizeof (int); break;			\
  case 3:                                                               \
        addr = blockend + R3 * sizeof (int); break;			\
  case 4:                                                               \
        addr = blockend + R4 * sizeof (int); break;			\
  case 5:                                                               \
        addr = blockend + R5 * sizeof (int); break;			\
  case 6:                                                               \
        addr = blockend + R6 * sizeof (int); break;			\
  case 7:                                                               \
        addr = blockend + R7 * sizeof (int); break;			\
  case PC_REGNUM:							\
  	addr = blockend + PC * sizeof (int); break;			\
  case SP_REGNUM:							\
  	addr = blockend + SP * sizeof (int); break;			\
  case FP_REGNUM:							\
  	addr = blockend + FP * sizeof (int); break;			\
  case PS_REGNUM:							\
  	addr = blockend + PSR_MOD * sizeof (int); break;		\
  case FPS_REGNUM:							\
       addr = FS; break;						\
  case FP0_REGNUM + 0: case FP0_REGNUM + 1:				\
  case FP0_REGNUM + 2: case FP0_REGNUM + 3: 				\
  case FP0_REGNUM + 4: case FP0_REGNUM + 5: 				\
  case FP0_REGNUM + 6: case FP0_REGNUM + 7: 				\
  	addr = F0 + (regno - FP0_REGNUM) * sizeof (float);	\
        break;								\
  case LP0_REGNUM + 0: case LP0_REGNUM + 1:				\
  case LP0_REGNUM + 2: case LP0_REGNUM + 3:				\
  	addr = F0 + (regno - LP0_REGNUM) * sizeof (double); \
        break;								\
  default:								\
  	printf ("bad argument to REGISTER_U_ADDR %d\n", regno);		\
	abort ();							\
  }									\
}

/* Total amount of space needed to store our copies of the machine's
   register state, the array `registers'.  */
#define REGISTER_BYTES ((NUM_REGS - 4) * sizeof (int) + 4 * sizeof (double))

/* Index within `registers' of the first byte of the space for
   register N.  */

#define REGISTER_BYTE(N) ((N) >= LP0_REGNUM ? \
	LP0_REGNUM * 4 + ((N) - LP0_REGNUM) * 8 : (N) * 4)

/* Number of bytes of storage in the actual machine representation
   for register N.  On the 32000, all regs are 4 bytes
   except for the doubled floating registers. */

#define REGISTER_RAW_SIZE(N) ((N) >= LP0_REGNUM ? 8 : 4)

/* Number of bytes of storage in the program's representation
   for register N.  On the 32000, all regs are 4 bytes
   except for the doubled floating registers. */

#define REGISTER_VIRTUAL_SIZE(N) ((N) >= LP0_REGNUM ? 8 : 4)

/* Largest value REGISTER_RAW_SIZE can have.  */

#define MAX_REGISTER_RAW_SIZE 8

/* Largest value REGISTER_VIRTUAL_SIZE can have.  */

#define MAX_REGISTER_VIRTUAL_SIZE 8

/* Nonzero if register N requires conversion
   from raw format to virtual format.  */

#define REGISTER_CONVERTIBLE(N) 0

/* Convert data from raw format for register REGNUM
   to virtual format for register REGNUM.  */

#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO)	\
  bcopy ((FROM), (TO), REGISTER_VIRTUAL_SIZE(REGNUM));

/* Convert data from virtual format for register REGNUM
   to raw format for register REGNUM.  */

#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO)	\
  bcopy ((FROM), (TO), REGISTER_VIRTUAL_SIZE(REGNUM));

/* Return the GDB type object for the "standard" data type
   of data in register N.  */

#define REGISTER_VIRTUAL_TYPE(N) \
  ((N) >= FP0_REGNUM ?		\
    ((N) >= LP0_REGNUM ?	\
     builtin_type_double	\
     : builtin_type_float)	\
   : builtin_type_int)

/* Extract from an array REGBUF containing the (raw) register state
   a function return value of type TYPE, and copy that, in virtual format,
   into VALBUF.  */

#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
  bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE))

/* Write into appropriate registers a function return value
   of type TYPE, given in virtual format.  */

#define STORE_RETURN_VALUE(TYPE,VALBUF) \
  write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))

/* Extract from an array REGBUF containing the (raw) register state
   the address in which a function should return its structure value,
   as a CORE_ADDR (or an expression that can be used as one).  */

#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))

/* Describe the pointer in each stack frame to the previous stack frame
   (its caller).  */

/* FRAME_CHAIN takes a frame's nominal address
   and produces the frame's chain-pointer.

   FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address
   and produces the nominal address of the caller frame.

   However, if FRAME_CHAIN_VALID returns zero,
   it means the given frame is the outermost one and has no caller.
   In that case, FRAME_CHAIN_COMBINE is not used.  */

/* In the case of the Merlin, the frame's nominal address is the FP value,
   and at that address is saved previous FP value as a 4-byte word.  */

#define FRAME_CHAIN(thisframe)  (read_memory_integer (thisframe, 4))

#define FRAME_CHAIN_VALID(chain, thisframe) \
  (chain != 0 && (FRAME_SAVED_PC (thisframe) >= first_object_file_end))

#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain)

/* Define other aspects of the stack frame.  */

#define FRAME_SAVED_PC(frame) (read_memory_integer (frame + 4, 4))

/* compute base of arguments */
#define FRAME_ARGS_ADDRESS(fi) ((fi).frame)

#define FRAME_LOCALS_ADDRESS(fi) ((fi).frame)

/* Return number of args passed to a frame.
   Can return -1, meaning no way to tell.  */

#define FRAME_NUM_ARGS(numargs, fi)			\
{ CORE_ADDR pc;						\
  int insn;						\
  int addr_mode;					\
  int width;						\
							\
  pc = FRAME_SAVED_PC (fi.frame);			\
  insn = read_memory_integer (pc,2);			\
  addr_mode = (insn >> 11) & 0x1f;			\
  insn = insn & 0x7ff;					\
  if ((insn & 0x7fc) == 0x57c				\
      && addr_mode == 0x14) /* immediate */		\
    { if (insn == 0x57c) /* adjspb */			\
	width = 1;					\
      else if (insn == 0x57d) /* adjspw */		\
	width = 2;					\
      else if (insn == 0x57f) /* adjspd */		\
	width = 4;					\
      numargs = read_memory_integer (pc+2,width);	\
      if (width > 1)					\
	flip_bytes (&numargs, width);			\
      numargs = - sign_extend (numargs, width*8) / 4; }	\
  else numargs = -1;					\
}

/* Return number of bytes at start of arglist that are not really args.  */

#define FRAME_ARGS_SKIP 8

/* Put here the code to store, into a struct frame_saved_regs,
   the addresses of the saved registers of frame described by FRAME_INFO.
   This includes special registers such as pc and fp saved in special
   ways in the stack frame.  sp is even more special:
   the address we return for it IS the sp for the next frame.  */

#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
{ int regmask,regnum;						\
  int localcount;						\
  CORE_ADDR enter_addr;						\
  CORE_ADDR next_addr;						\
								\
  enter_addr = get_pc_function_start ((frame_info).pc);		\
  regmask = read_memory_integer (enter_addr+1, 1);		\
  localcount = ns32k_localcount (enter_addr);			\
  next_addr = (frame_info).frame + localcount;			\
  for (regnum = 0; regnum < 8; regnum++, regmask >>= 1)		\
    (frame_saved_regs).regs[regnum]				\
      = (regmask & 1) ? (next_addr -= 4) : 0;			\
  (frame_saved_regs).regs[SP_REGNUM] = (frame_info).frame + 4;	\
  (frame_saved_regs).regs[PC_REGNUM] = (frame_info).frame + 4;	\
  (frame_saved_regs).regs[FP_REGNUM]				\
     = read_memory_integer ((frame_info).frame, 4); }

/* Compensate for lack of `vprintf' function.  */
/* #define vprintf(format, ap) _doprnt (format, ap, stdout) */

/* Things needed for making the inferior call functions.  */

/* Push an empty stack frame, to record the current PC, etc.  */

#define PUSH_DUMMY_FRAME \
{ register CORE_ADDR sp = read_register (SP_REGNUM);	\
  register int regnum;					\
  sp = push_word (sp, read_register (PC_REGNUM));	\
  sp = push_word (sp, read_register (FP_REGNUM));	\
  write_register (FP_REGNUM, sp);			\
  for (regnum = 0; regnum < 8; regnum++)  		\
    sp = push_word (sp, read_register (regnum));	\
  write_register (SP_REGNUM, sp);  			\
}

/* Discard from the stack the innermost frame, restoring all registers.  */

#define POP_FRAME  \
{ register CORE_ADDR fp = read_register (FP_REGNUM);		 \
  register int regnum;						 \
  struct frame_saved_regs fsr;					 \
  struct frame_info fi;						 \
  fi = get_frame_info (fp);					 \
  get_frame_saved_regs (&fi, &fsr);				 \
  for (regnum = 0; regnum < 8; regnum++)			 \
    if (fsr.regs[regnum])					 \
      write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \
  write_register (FP_REGNUM, read_memory_integer (fp, 4));	 \
  write_register (PC_REGNUM, read_memory_integer (fp + 4, 4));   \
  write_register (SP_REGNUM, fp + 8);				 \
}

/* This sequence of words is the instructions
     enter	0xff,0		82 ff 00
     jsr	@0x00010203	7f ae c0 01 02 03
     adjspd	0x69696969	7f a5 01 02 03 04
     bpt			f2
   Note this is 16 bytes.  */

#define CALL_DUMMY { 0x7f00ff82, 0x0201c0ae, 0x01a57f03, 0xf2040302 }

#define CALL_DUMMY_START_OFFSET	3
#define CALL_DUMMY_LENGTH	16
#define CALL_DUMMY_ADDR		5
#define CALL_DUMMY_NARGS	11

/* Insert the specified number of args and function address
   into a call sequence of the above form stored at DUMMYNAME.  */

#define FIX_CALL_DUMMY(dummyname, fun, nargs)   		\
{ int flipped = fun | 0xc0000000;				\
  flip_bytes (&flipped, 4);					\
  *((int *) (((char *) dummyname)+CALL_DUMMY_ADDR)) = flipped;	\
  flipped = - nargs * 4;					\
  flip_bytes (&flipped, 4);					\
  *((int *) (((char *) dummyname)+CALL_DUMMY_NARGS)) = flipped;	\
}

#ifdef notdef
/* Interface definitions for kernel debugger KDB.  */

/* Map machine fault codes into signal numbers.
   First subtract 0, divide by 4, then index in a table.
   Faults for which the entry in this table is 0
   are not handled by KDB; the program's own trap handler
   gets to handle then.  */

#define FAULT_CODE_ORIGIN 0
#define FAULT_CODE_UNITS 4
#define FAULT_TABLE    \
{ 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
  0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
  0, 0, 0, 0, 0, 0, 0, 0}

/* Start running with a stack stretching from BEG to END.
   BEG and END should be symbols meaningful to the assembler.
   This is used only for kdb.  */

#define INIT_STACK(beg, end)  \
{ asm (".globl end");         \
  asm ("movl $ end, sp");      \
  asm ("clrl fp"); }

/* Push the frame pointer register on the stack.  */
#define PUSH_FRAME_PTR        \
  asm ("pushl fp");

/* Copy the top-of-stack to the frame pointer register.  */
#define POP_FRAME_PTR  \
  asm ("movl (sp), fp");

/* After KDB is entered by a fault, push all registers
   that GDB thinks about (all NUM_REGS of them),
   so that they appear in order of ascending GDB register number.
   The fault code will be on the stack beyond the last register.  */

#define PUSH_REGISTERS        \
{ asm ("pushl 8(sp)");        \
  asm ("pushl 8(sp)");        \
  asm ("pushal 0x14(sp)");    \
  asm ("pushr $037777"); }

/* Assuming the registers (including processor status) have been
   pushed on the stack in order of ascending GDB register number,
   restore them and return to the address in the saved PC register.  */

#define POP_REGISTERS      \
{ asm ("popr $037777");    \
  asm ("subl2 $8,(sp)");   \
  asm ("movl (sp),sp");    \
  asm ("rei"); }
#endif
@//E*O*F m-ns5.h//
chmod u=rw,g=r,o=r m-ns5.h
 
echo x - m-ns5init.h
sed 's/^@//' > "m-ns5init.h" <<'@//E*O*F m-ns5init.h//'
/* This is how the size of an individual .o file's text segment
   is rounded on the multimax.  */

#define FILEADDR_ROUND(addr) ((addr + 3) & -4)
@//E*O*F m-ns5init.h//
chmod u=rw,g=r,o=r m-ns5init.h
 
echo x - ns5-config.h
sed 's/^@//' > "ns5-config.h" <<'@//E*O*F ns5-config.h//'
/* Configuration file for National Semiconductors Sys V.2.2 (should be pretty
   much right for generic Sys V. This file contains
   system dependencies of the conventional BSD-SysV type. Dependencies of a
   particular implimentation such as machine dependencies, calling conventions
   etc are in param.h
*/

#ifndef NS5
#define NS5
#endif

#define COFF_FORMAT

#define PAGESIZE NBPC

#define HAVE_TERMIO

#define MAXPATHLEN BUFSIZ

char *getcwd();
#define getwd(path) getcwd(path,MAXPATHLEN)

#include <memory.h>

#define bcopy(a,b,s)	memcpy(b,a,s)
#define bzero(a,s)	memset(a,0,s)
#define bcmp		memcmp

#include <string.h>
#define index strchr
#define rindex strrchr

extern int fork();
#define vfork fork
@//E*O*F ns5-config.h//
chmod u=rw,g=r,o=r ns5-config.h
 
echo Inspecting for damage in transit...
temp=/tmp/shar$$; dtemp=/tmp/.shar$$
trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
cat > $temp <<\!!!
     82    234   1657 sysdep.c
    473   2485  16660 m-ns5.h
      4     26    147 m-ns5init.h
     34     88    710 ns5-config.h
    593   2833  19174 total
!!!
wc  sysdep.c m-ns5.h m-ns5init.h ns5-config.h | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
if [ -s $dtemp ]
then echo "Ouch [diff of wc output]:" ; cat $dtemp
else echo "No problems found."
fi
exit 0

ian@UUNET.UU.NET (12/01/88)

(Sorry if you've seen this before but I sent it to bug-gnu-emacs
not realising that bug-gdb existed)

In GDB 2.7 on sibyl (usg-unix-v)

There are 5 parts because outgoing overseas mail from here must be
less than 25k. Part 1 contains a shar archive containing the new
files. Parts 2 to 5 contain shar archives of the patch files to make
the changes to the the existing files. The patch files are context
differences.

Part 2 of 5:

--------------Cut Here-----------------------
# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by ian on Thu Nov 24 11:18:52 CST 1988
# Contents:  patch#1
 
echo x - patch#1
sed 's/^@//' > "patch#1" <<'@//E*O*F patch#1//'
*** ../gdb.dist/Makefile	Sun Sep  4 02:06:58 1988
--- Makefile	Fri Nov 18 10:07:55 1988
***************
*** 23,28
  # and tell GDB to use BSD executable file format.
  # You also need to add -lGNU to CLIBS, and perhaps CC = gcc.
  
  # -I. for "#include <obstack.h>"
  CFLAGS = -g -I.
  # NOTE!!! -O  may FAIL TO WORK!  See initialize.h for some weird hacks.

--- 23,30 -----
  # and tell GDB to use BSD executable file format.
  # You also need to add -lGNU to CLIBS, and perhaps CC = gcc.
  
+ SHELL = /bin/sh
+ 
  # -I. for "#include <obstack.h>"
  CFLAGS = -g -I.
  # NOTE!!! -O  may FAIL TO WORK!  See initialize.h for some weird hacks.
***************
*** 26,31
  # -I. for "#include <obstack.h>"
  CFLAGS = -g -I.
  # NOTE!!! -O  may FAIL TO WORK!  See initialize.h for some weird hacks.
  
  # define this to be "obstack.o" if you don't have the obstack library installed
  # you must at the same time define OBSTACK1 as "obstack.o" 

--- 28,34 -----
  # -I. for "#include <obstack.h>"
  CFLAGS = -g -I.
  # NOTE!!! -O  may FAIL TO WORK!  See initialize.h for some weird hacks.
+ LFLAGS = 
  
  .SUFFIXES:
  .SUFFIXES: .o .ln .c .y .l .s
***************
*** 27,32
  CFLAGS = -g -I.
  # NOTE!!! -O  may FAIL TO WORK!  See initialize.h for some weird hacks.
  
  # define this to be "obstack.o" if you don't have the obstack library installed
  # you must at the same time define OBSTACK1 as "obstack.o" 
  # so that the dependencies work right.

--- 30,41 -----
  # NOTE!!! -O  may FAIL TO WORK!  See initialize.h for some weird hacks.
  LFLAGS = 
  
+ .SUFFIXES:
+ .SUFFIXES: .o .ln .c .y .l .s
+ 
+ .c.ln:
+ 	lint -c  $(CFLAGS) $(LFLAGS) $<
+ 
  # define this to be "obstack.o" if you don't have the obstack library installed
  # you must at the same time define OBSTACK1 as "obstack.o" 
  # so that the dependencies work right.
***************
*** 33,39
  OBSTACK = obstack.o
  OBSTACK1 = obstack.o
  
! CLIBS = $(OBSTACK)
  
  STARTOBS = main.o firstfile.o
  

--- 42,48 -----
  OBSTACK = obstack.o
  OBSTACK1 = obstack.o
  
! OBSTACKLNT = obstack.ln
  
  CPP = $(CC) -E
  
***************
*** 35,40
  
  CLIBS = $(OBSTACK)
  
  STARTOBS = main.o firstfile.o
  
  OBS = blockframe.o breakpoint.o findvar.o stack.o source.o \

--- 44,55 -----
  
  OBSTACKLNT = obstack.ln
  
+ CPP = $(CC) -E
+ 
+ CLIBS = $(OBSTACK) -lPW
+ 
+ LNTLIBS = $(OBSTACKLNT) -lPW
+ 
  STARTOBS = main.o firstfile.o
  
  STARTLNT = main.ln firstfile.ln
***************
*** 37,42
  
  STARTOBS = main.o firstfile.o
  
  OBS = blockframe.o breakpoint.o findvar.o stack.o source.o \
      values.o eval.o valops.o valarith.o valprint.o printcmd.o \
      symtab.o symmisc.o coffread.o dbxread.o infcmd.o infrun.o remote.o

--- 52,59 -----
  
  STARTOBS = main.o firstfile.o
  
+ STARTLNT = main.ln firstfile.ln
+ 
  OBS = blockframe.o breakpoint.o findvar.o stack.o source.o \
      values.o eval.o valops.o valarith.o valprint.o printcmd.o \
      symtab.o symmisc.o coffread.o dbxread.o infcmd.o infrun.o remote.o
***************
*** 41,46
      values.o eval.o valops.o valarith.o valprint.o printcmd.o \
      symtab.o symmisc.o coffread.o dbxread.o infcmd.o infrun.o remote.o
  
  TSOBS = core.o inflow.o
  
  NTSOBS = standalone.o

--- 58,67 -----
      values.o eval.o valops.o valarith.o valprint.o printcmd.o \
      symtab.o symmisc.o coffread.o dbxread.o infcmd.o infrun.o remote.o
  
+ LNT = blockframe.ln breakpoint.ln findvar.ln stack.ln source.ln \
+     values.ln eval.ln valops.ln valarith.ln valprint.ln printcmd.ln \
+     symtab.ln symmisc.ln coffread.ln dbxread.ln infcmd.ln infrun.ln remote.ln
+ 
  TSOBS = core.o inflow.o
  TSLNT = core.ln inflow.ln
  
***************
*** 42,47
      symtab.o symmisc.o coffread.o dbxread.o infcmd.o infrun.o remote.o
  
  TSOBS = core.o inflow.o
  
  NTSOBS = standalone.o
  

--- 63,69 -----
      symtab.ln symmisc.ln coffread.ln dbxread.ln infcmd.ln infrun.ln remote.ln
  
  TSOBS = core.o inflow.o
+ TSLNT = core.ln inflow.ln
  
  NTSOBS = standalone.o
  NTSLNT = standalone.ln
***************
*** 44,49
  TSOBS = core.o inflow.o
  
  NTSOBS = standalone.o
  
  ENDOBS = lastfile.o command.o utils.o expread.o expprint.o pinsn.o \
  	environ.o version.o

--- 66,72 -----
  TSLNT = core.ln inflow.ln
  
  NTSOBS = standalone.o
+ NTSLNT = standalone.ln
  
  
  ENDOBS = lastfile.o command.o utils.o expread.o expprint.o pinsn.o \
***************
*** 45,50
  
  NTSOBS = standalone.o
  
  ENDOBS = lastfile.o command.o utils.o expread.o expprint.o pinsn.o \
  	environ.o version.o
  

--- 68,74 -----
  NTSOBS = standalone.o
  NTSLNT = standalone.ln
  
+ 
  ENDOBS = lastfile.o command.o utils.o expread.o expprint.o pinsn.o \
  	environ.o version.o alloca.o sysdep.o
  
***************
*** 46,52
  NTSOBS = standalone.o
  
  ENDOBS = lastfile.o command.o utils.o expread.o expprint.o pinsn.o \
! 	environ.o version.o
  
  TSSTART = /lib/crt0.o
  

--- 70,76 -----
  
  
  ENDOBS = lastfile.o command.o utils.o expread.o expprint.o pinsn.o \
! 	environ.o version.o alloca.o sysdep.o
  
  ENDLNT = lastfile.ln command.ln utils.ln expread.ln expprint.ln pinsn.ln \
  	environ.ln version.ln sysdep.ln
***************
*** 48,53
  ENDOBS = lastfile.o command.o utils.o expread.o expprint.o pinsn.o \
  	environ.o version.o
  
  TSSTART = /lib/crt0.o
  
  NTSSTART = kdb-start.o

--- 72,80 -----
  ENDOBS = lastfile.o command.o utils.o expread.o expprint.o pinsn.o \
  	environ.o version.o alloca.o sysdep.o
  
+ ENDLNT = lastfile.ln command.ln utils.ln expread.ln expprint.ln pinsn.ln \
+ 	environ.ln version.ln sysdep.ln
+ 
  TSSTART = /lib/crt0.o
  
  NTSSTART = kdb-start.o
***************
*** 53,59
  NTSSTART = kdb-start.o
  
  gdb : $(STARTOBS) $(OBS) $(TSOBS) $(ENDOBS) $(OBSTACK1)
! 	$(CC) $(LDFLAGS) -o gdb $(STARTOBS) $(OBS) $(TSOBS) $(ENDOBS) $(CLIBS)
  
  xgdb : $(STARTOBS) $(OBS) $(TSOBS) xgdb.o $(ENDOBS) $(OBSTACK1)
  	$(CC) $(LDFLAGS) -o xgdb $(STARTOBS) $(OBS) $(TSOBS) xgdb.o $(ENDOBS) \

--- 80,86 -----
  NTSSTART = kdb-start.o
  
  gdb : $(STARTOBS) $(OBS) $(TSOBS) $(ENDOBS) $(OBSTACK1)
! 	$(CC) $(LDFLAGS) -o gdb $(STARTOBS) $(OBS) $(TSOBS) $(ENDOBS) $(CLIBS) $(OBSTACKSRC)
  
  lint: $(STARTLNT) $(LNT) $(TSLNT) $(ENDLNT) $(OBSTACKLNT)
  	lint $(CFLAGS) $(LFLAGS) $(STARTLNT) $(LNT) $(TSLNT) $(ENDLNT) $(LNTLIBS)
***************
*** 55,60
  gdb : $(STARTOBS) $(OBS) $(TSOBS) $(ENDOBS) $(OBSTACK1)
  	$(CC) $(LDFLAGS) -o gdb $(STARTOBS) $(OBS) $(TSOBS) $(ENDOBS) $(CLIBS)
  
  xgdb : $(STARTOBS) $(OBS) $(TSOBS) xgdb.o $(ENDOBS) $(OBSTACK1)
  	$(CC) $(LDFLAGS) -o xgdb $(STARTOBS) $(OBS) $(TSOBS) xgdb.o $(ENDOBS) \
             -lXaw -lXt -lX11 $(CLIBS)

--- 82,90 -----
  gdb : $(STARTOBS) $(OBS) $(TSOBS) $(ENDOBS) $(OBSTACK1)
  	$(CC) $(LDFLAGS) -o gdb $(STARTOBS) $(OBS) $(TSOBS) $(ENDOBS) $(CLIBS) $(OBSTACKSRC)
  
+ lint: $(STARTLNT) $(LNT) $(TSLNT) $(ENDLNT) $(OBSTACKLNT)
+ 	lint $(CFLAGS) $(LFLAGS) $(STARTLNT) $(LNT) $(TSLNT) $(ENDLNT) $(LNTLIBS)
+ 
  xgdb : $(STARTOBS) $(OBS) $(TSOBS) xgdb.o $(ENDOBS) $(OBSTACK1)
  	$(CC) $(LDFLAGS) -o xgdb $(STARTOBS) $(OBS) $(TSOBS) xgdb.o $(ENDOBS) \
             -lXaw -lXt -lX11 $(CLIBS)
***************
*** 62,75
  kdb : $(NTSSTART) $(STARTOBS) $(OBS) $(NTSOBS) $(ENDOBS) $(OBSTACK1)
  	ld -o kdb $(NTSSTART) $(STARTOBS) $(OBS) $(NTSOBS) $(ENDOBS) -lc $(CLIBS)
  
! blockframe.o : blockframe.c defs.h initialize.h param.h symtab.h frame.h
! breakpoint.o : breakpoint.c defs.h initialize.h param.h symtab.h frame.h
! command.o : command.c command.h
! coffread.o : coffread.c defs.h initialize.h param.h symtab.h
! core.o : core.c defs.h initialize.h param.h
! dbxread.o : dbxread.c defs.h initialize.h param.h symtab.h
! environ.o : environ.c environ.h
! expprint.o : expprint.c defs.h symtab.h expression.h
  expread.tab.c : expread.y
  	@echo 'Expect 96 shift/reduce conflicts.'
  	yacc expread.y

--- 92,117 -----
  kdb : $(NTSSTART) $(STARTOBS) $(OBS) $(NTSOBS) $(ENDOBS) $(OBSTACK1)
  	ld -o kdb $(NTSSTART) $(STARTOBS) $(OBS) $(NTSOBS) $(ENDOBS) -lc $(CLIBS)
  
! alloca.o : alloca.s config.h
! 	cp alloca.s allocatem.c
! 	$(CPP) allocatem.c | \
! 	sed -e 's///' -e 's/^#.*//' | \
! 	sed -n -e '/^..*$$/p' > allocatem.s
! 	-rm -f alloca.o
! 	cc -c allocatem.s
! 	mv allocatem.o alloca.o
! 	rm allocatem.s allocatem.c
! blockframe.o blockframe.ln : blockframe.c defs.h initialize.h param.h\
! 		symtab.h frame.h config.h
! breakpoint.o breakpoint.ln : breakpoint.c defs.h initialize.h param.h\
! 		symtab.h frame.h config.h
! command.o command.ln : command.c command.h config.h
! coffread.o coffread.ln : coffread.c defs.h initialize.h param.h symtab.h\
! 		config.h
! core.o core.ln : core.c defs.h initialize.h param.h config.h
! dbxread.o dbxread.ln : dbxread.c defs.h initialize.h param.h symtab.h config.h
! environ.o environ.ln : environ.c environ.h config.h
! expprint.o expprint.ln : expprint.c defs.h symtab.h expression.h config.h
  expread.tab.c : expread.y
  	@echo 'Expect 96 shift/reduce conflicts.'
  	yacc expread.y
***************
*** 74,80
  	@echo 'Expect 96 shift/reduce conflicts.'
  	yacc expread.y
  	mv y.tab.c expread.tab.c
! expread.o : expread.tab.c defs.h param.h symtab.h frame.h expression.h
  	$(CC) -c ${CFLAGS} expread.tab.c
  	mv expread.tab.o expread.o
  eval.o : eval.c defs.h initialize.h symtab.h value.h expression.h

--- 116,123 -----
  	@echo 'Expect 96 shift/reduce conflicts.'
  	yacc expread.y
  	mv y.tab.c expread.tab.c
! expread.o expread.ln : expread.tab.c defs.h param.h symtab.h frame.h\
! 		expression.h config.h
  	$(CC) -c ${CFLAGS} expread.tab.c
  	mv expread.tab.o expread.o
  eval.o eval.ln : eval.c defs.h initialize.h symtab.h value.h expression.h\
***************
*** 77,91
  expread.o : expread.tab.c defs.h param.h symtab.h frame.h expression.h
  	$(CC) -c ${CFLAGS} expread.tab.c
  	mv expread.tab.o expread.o
! eval.o : eval.c defs.h initialize.h symtab.h value.h expression.h
! findvar.o : findvar.c defs.h initialize.h param.h symtab.h frame.h value.h
! firstfile.o : firstfile.c initialize.h
! infcmd.o : infcmd.c defs.h initialize.h param.h symtab.h frame.h inferior.h environ.h value.h
! inflow.o : inflow.c defs.h initialize.h param.h frame.h inferior.h
! infrun.o : infrun.c defs.h initialize.h param.h symtab.h frame.h inferior.h wait.h
! kdb-start.o : kdb-start.c defs.h param.h
! lastfile.o : lastfile.c
! main.o : main.c defs.h command.h
  # pinsn.o depends on ALL the opcode printers
  # since we don't know which one is really being used.
  pinsn.o : pinsn.c defs.h param.h symtab.h \

--- 120,139 -----
  		expression.h config.h
  	$(CC) -c ${CFLAGS} expread.tab.c
  	mv expread.tab.o expread.o
! eval.o eval.ln : eval.c defs.h initialize.h symtab.h value.h expression.h\
! 		config.h
! findvar.o findvar.ln : findvar.c defs.h initialize.h param.h symtab.h\
! 		frame.h value.h config.h
! firstfile.o firstfile.ln : firstfile.c initialize.h config.h
! infcmd.o infcmd.ln : infcmd.c defs.h initialize.h param.h symtab.h frame.h\
! 		inferior.h environ.h value.h config.h
! inflow.o inflow.ln : inflow.c defs.h initialize.h param.h frame.h inferior.h\
! 		config.h
! infrun.o infrun.ln : infrun.c defs.h initialize.h param.h symtab.h frame.h\
! 		inferior.h wait.h config.h
! kdb-start.o kdb-start.ln : kdb-start.c defs.h param.h config.h
! lastfile.o lastfile.ln : lastfile.c config.h
! main.o main.ln : main.c defs.h command.h config.h
  # pinsn.o depends on ALL the opcode printers
  # since we don't know which one is really being used.
  pinsn.o pinsn.ln : pinsn.c opcode.h defs.h param.h symtab.h config.h\
***************
*** 88,109
  main.o : main.c defs.h command.h
  # pinsn.o depends on ALL the opcode printers
  # since we don't know which one is really being used.
! pinsn.o : pinsn.c defs.h param.h symtab.h \
!     vax-opcode.h vax-pinsn.c m68k-opcode.h m68k-pinsn.c
! printcmd.o : printcmd.c defs.h initialize.h param.h symtab.h value.h expression.h
! remote.o : remote.c defs.h initialize.h param.h frame.h inferior.h
! source.o : source.c defs.h initialize.h symtab.h
! stack.o : stack.c defs.h initialize.h param.h symtab.h frame.h
! standalone.o : standalone.c defs.h initialize.h param.h symtab.h frame.h inferior.h wait.h
! symmisc.o : symmisc.c defs.h initialize.h symtab.h
! symtab.o : symtab.c defs.h initialize.h param.h symtab.h
! utils.o : utils.c defs.h
! valarith.o : valarith.c defs.h initialize.h param.h symtab.h value.h expression.h
! valops.o : valops.c defs.h initialize.h param.h symtab.h value.h
! valprint.o : valprint.c defs.h initialize.h param.h symtab.h value.h
! values.o : values.c defs.h initialize.h param.h symtab.h value.h
! version.o : version.c
! xgdb.o : xgdb.c defs.h initialize.h param.h symtab.h frame.h
  	$(CC) -c $(CFLAGS) xgdb.c -o $@
  
  obstack.o : obstack.c

--- 136,165 -----
  main.o main.ln : main.c defs.h command.h config.h
  # pinsn.o depends on ALL the opcode printers
  # since we don't know which one is really being used.
! pinsn.o pinsn.ln : pinsn.c opcode.h defs.h param.h symtab.h config.h\
! 		vax-opcode.h vax-pinsn.c m68k-opcode.h m68k-pinsn.c
! printcmd.o printcmd.ln : printcmd.c defs.h initialize.h param.h symtab.h\
! 		value.h expression.h config.h
! remote.o remote.ln : remote.c defs.h initialize.h param.h frame.h inferior.h\
! 		config.h
! source.o source.ln : source.c defs.h initialize.h symtab.h config.h
! stack.o stack.ln : stack.c defs.h initialize.h param.h symtab.h frame.h\
! 		config.h
! standalone.o standalone.ln : standalone.c defs.h initialize.h param.h\
! 		symtab.h frame.h inferior.h wait.h config.h
! symmisc.o symmisc.ln : symmisc.c defs.h initialize.h symtab.h config.h
! symtab.o symtab.ln : symtab.c defs.h initialize.h param.h symtab.h config.h
! utils.o utils.ln : utils.c defs.h config.h
! valarith.o valarith.ln : valarith.c defs.h initialize.h param.h symtab.h\
! 		value.h expression.h config.h
! valops.o valops.ln : valops.c defs.h initialize.h param.h symtab.h value.h\
! 		config.h
! valprint.o valprint.ln : valprint.c defs.h initialize.h param.h symtab.h\
! 		value.h config.h
! values.o values.ln : values.c defs.h initialize.h param.h symtab.h value.h\
! 		config.h
! version.o version.ln : version.c config.h
! xgdb.o xgdb.ln : xgdb.c defs.h initialize.h param.h symtab.h frame.h config.h
  	$(CC) -c $(CFLAGS) xgdb.c -o $@
  obstack.o obstack.ln : obstack.c config.h
  sysdep.o sysdep.ln : sysdep.c config.h
***************
*** 105,109
  version.o : version.c
  xgdb.o : xgdb.c defs.h initialize.h param.h symtab.h frame.h
  	$(CC) -c $(CFLAGS) xgdb.c -o $@
! 
! obstack.o : obstack.c

--- 161,165 -----
  version.o version.ln : version.c config.h
  xgdb.o xgdb.ln : xgdb.c defs.h initialize.h param.h symtab.h frame.h config.h
  	$(CC) -c $(CFLAGS) xgdb.c -o $@
! obstack.o obstack.ln : obstack.c config.h
! sysdep.o sysdep.ln : sysdep.c config.h
*** ../gdb.dist/config.gdb	Fri Sep  2 03:21:50 1988
--- config.gdb	Wed Nov 23 20:51:42 1988
***************
*** 20,25
  	initfile=m-${machine}init.h
  	pinsnfile=${machine}-pinsn.c
  	opcodefile=${machine}-opcode.h
  
  	case $machine in
  	hp9k320)

--- 20,26 -----
  	initfile=m-${machine}init.h
  	pinsnfile=${machine}-pinsn.c
  	opcodefile=${machine}-opcode.h
+ 	configfile=${machine}-config.h
  
  	# If no config file try a null config file for backward compatability
  	if [ ! -r $configfile ]
***************
*** 21,26
  	pinsnfile=${machine}-pinsn.c
  	opcodefile=${machine}-opcode.h
  
  	case $machine in
  	hp9k320)
  		initfile=m-sun3init.h

--- 22,33 -----
  	opcodefile=${machine}-opcode.h
  	configfile=${machine}-config.h
  
+ 	# If no config file try a null config file for backward compatability
+ 	if [ ! -r $configfile ]
+ 	then
+ 	    touch $configfile
+ 	fi	
+ 
  	case $machine in
  	hp9k320)
  		initfile=m-sun3init.h
***************
*** 65,70
  		pinsnfile=ns32k-pinsn.c
  		opcodefile=ns32k-opcode.h
  		;;
  	test)
  		paramfile=one
  		initfile=two

--- 72,82 -----
  		pinsnfile=ns32k-pinsn.c
  		opcodefile=ns32k-opcode.h
  		;;
+ 	ns5)
+ 		pinsnfile=ns32k-pinsn.c
+ 		opcodefile=ns32k-opcode.h
+ 		;;
+ 		
  	test)
  		paramfile=one
  		initfile=two
***************
*** 73,80
  		;;
  	esac
  
! 	files="$paramfile $initfile $pinsnfile $opcodefile"
! 	links="param.h m-init.h pinsn.c opcode.h"	
  
  	while [ -n "$files" ]
  	do

--- 85,92 -----
  		;;
  	esac
  
! 	files="$paramfile $initfile $pinsnfile $opcodefile $configfile"
! 	links="param.h m-init.h pinsn.c opcode.h config.h"	
  
  	while [ -n "$files" ]
  	do
*** ../gdb.dist/blockframe.c	Fri Mar 25 17:01:18 1988
--- blockframe.c	Wed Nov 16 01:02:48 1988
***************
*** 19,24
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"

--- 19,25 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"
***************
*** 31,36
     are treated as nonexistent.  */
  
  CORE_ADDR first_object_file_end;
  
  /* Address of innermost stack frame (contents of FP register) */
  

--- 32,39 -----
     are treated as nonexistent.  */
  
  CORE_ADDR first_object_file_end;
+ 
+ CORE_ADDR read_pc();
  
  /* Address of innermost stack frame (contents of FP register) */
  
*** ../gdb.dist/breakpoint.c	Thu Jun  9 19:43:13 1988
--- breakpoint.c	Wed Nov 16 10:28:04 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"
***************
*** 102,107
  static void delete_breakpoint ();
  void clear_momentary_breakpoints ();
  void breakpoint_auto_delete ();
  
  /* condition N EXP -- set break condition of breakpoint N to EXP.  */
  

--- 103,112 -----
  static void delete_breakpoint ();
  void clear_momentary_breakpoints ();
  void breakpoint_auto_delete ();
+ struct block *block_for_pc();
+ void free_command_lines();
+ void execute_command(), free_all_values(), print_expression();
+ void set_next_address();
  
  /* condition N EXP -- set break condition of breakpoint N to EXP.  */
  
@//E*O*F patch#1//
chmod u=rw,g=r,o=r patch#1
 
echo Inspecting for damage in transit...
temp=/tmp/shar$$; dtemp=/tmp/.shar$$
trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
cat > $temp <<\!!!
    592   2373  18278 patch#1
!!!
wc  patch#1 | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
if [ -s $dtemp ]
then echo "Ouch [diff of wc output]:" ; cat $dtemp
else echo "No problems found."
fi
exit 0

ian@UUNET.UU.NET (12/01/88)

(Sorry if you've seen this before but I sent it to bug-gnu-emacs
not realising that bug-gdb existed)

In GDB 2.7 on sibyl (usg-unix-v)

There are 5 parts because outgoing overseas mail from here must be
less than 25k. Part 1 contains a shar archive containing the new
files. Parts 2 to 5 contain shar archives of the patch files to make
the changes to the the existing files. The patch files are context
differences.

Part 3 of 5:

--------------Cut Here-----------------------
# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by ian on Thu Nov 24 11:20:05 CST 1988
# Contents:  patch#2
 
echo x - patch#2
sed 's/^@//' > "patch#2" <<'@//E*O*F patch#2//'
*** ../gdb.dist/coffread.c	Wed Jul 13 14:12:46 1988
--- coffread.c	Wed Nov 23 10:33:11 1988
***************
*** 21,26
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "param.h"
  #ifdef COFF_FORMAT

--- 21,27 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "param.h"
  #ifdef COFF_FORMAT
***************
*** 28,33
  #include "symtab.h"
  
  #include <a.out.h>
  #include <stdio.h>
  #include <obstack.h>
  #include <sys/param.h>

--- 29,35 -----
  #include "symtab.h"
  
  #include <a.out.h>
+ #include <storclass.h>
  #include <stdio.h>
  #include <obstack.h>
  #include <sys/param.h>
***************
*** 31,36
  #include <stdio.h>
  #include <obstack.h>
  #include <sys/param.h>
  #include <sys/file.h>
  
  static void add_symbol_to_list ();

--- 33,44 -----
  #include <stdio.h>
  #include <obstack.h>
  #include <sys/param.h>
+ #ifdef NS5
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #define NS32GMAGIC (0524)
+ #define NS32SMAGIC (0525)
+ #endif
  #include <sys/file.h>
  
  static void add_symbol_to_list ();
***************
*** 77,82
  static FILE *nlist_stream_global;
  static int nlist_nsyms_global;
  
  /* The file and text section headers of the symbol file */
  
  static FILHDR file_hdr;

--- 85,93 -----
  static FILE *nlist_stream_global;
  static int nlist_nsyms_global;
  
+ /* Total number of symbols in the coff executable */
+ static int num_symbols;
+ 
  /* The file and text section headers of the symbol file */
  
  static FILHDR file_hdr;
***************
*** 635,641
       char *name;
  {
    int desc;
-   int num_symbols;
    int num_sections;
    int symtab_offset;
    extern void close ();

--- 646,651 -----
       char *name;
  {
    int desc;
    int num_sections;
    int symtab_offset;
    extern void close ();
***************
*** 683,689
        return;
      }
  
!   printf ("Reading symbol data from %s...", name);
    fflush (stdout);
  
    /* Throw away the old symbol table.  */

--- 693,699 -----
        return;
      }
  
!   printf ("Reading symbol data from %s...\n", name);
    fflush (stdout);
  
    /* Throw away the old symbol table.  */
***************
*** 694,700
    symtab_offset = file_hdr.f_symptr;
  
    if (read_section_hdr (desc, _TEXT, &text_hdr, num_sections) < 0)
!     error ("\"%s\": can't read text section header", name);
  
    /* Read the line number table, all at once.  */
  

--- 704,710 -----
    symtab_offset = file_hdr.f_symptr;
  
    if (read_section_hdr (desc, _TEXT, &text_hdr, num_sections) < 0)
!       error ("\"%s\": can't read text section header", name);
  
    /* Read the line number table, all at once.  */
  
***************
*** 700,706
  
    val = init_lineno (desc, text_hdr.s_lnnoptr, text_hdr.s_nlnno);
    if (val < 0)
!     error ("\"%s\": error reading line numbers\n", name);
  
    /* Now read the string table, all at once.  */
  

--- 710,716 -----
  
    val = init_lineno (desc, text_hdr.s_lnnoptr, text_hdr.s_nlnno);
    if (val < 0)
!       error ("\"%s\": error reading line numbers\n", name);
  
    /* Now read the string table, all at once.  */
  
***************
*** 1531,1538
        return type;
      }
  
!   /* Reference to existing type */
!   if (cs->c_nsyms > 1 && aux->x_sym.x_tagndx != 0)
      {
        type = coff_alloc_type (aux->x_sym.x_tagndx);
        return type;

--- 1541,1553 -----
        return type;
      }
  
!   /* Reference to existing type (base type)*/
! 
!   if (cs->c_nsyms > 1
!       && cs->c_sclass != C_FILE && cs->c_sclass != C_STAT
!       && cs->c_sclass != C_STRTAG && cs->c_sclass != C_UNTAG
!       && cs->c_sclass != C_ENTAG && cs->c_sclass != C_BLOCK
!       && aux->x_sym.x_tagndx != 0)
      {
        /* Do some sanity checking */
        if ( aux->x_sym.x_tagndx < num_symbols)
***************
*** 1534,1541
    /* Reference to existing type */
    if (cs->c_nsyms > 1 && aux->x_sym.x_tagndx != 0)
      {
!       type = coff_alloc_type (aux->x_sym.x_tagndx);
!       return type;
      }
  
    return decode_base_type (cs, BTYPE (c_type), aux);

--- 1549,1562 -----
        && cs->c_sclass != C_ENTAG && cs->c_sclass != C_BLOCK
        && aux->x_sym.x_tagndx != 0)
      {
!       /* Do some sanity checking */
!       if ( aux->x_sym.x_tagndx < num_symbols)
! 	{
! 	  type = coff_alloc_type (aux->x_sym.x_tagndx);
! 	  return type;
! 	}
!       else
! 	printf ("Warning: bad symbol table. Ignoring aux entry for %s ( %d )\n", cs->c_name, aux->x_sym.x_tagndx);
      }
  
    return decode_base_type (cs, BTYPE (c_type), aux);
***************
*** 1571,1578
    switch (c_type)
      {
        case T_NULL:
! 	/* shouldn't show up here */
! 	break;
  
        case T_ARG:
  	/* shouldn't show up here */

--- 1592,1598 -----
    switch (c_type)
      {
        case T_NULL:
!         return builtin_type_void; /* Functions might have this */
  
        case T_ARG:
  	/* shouldn't show up here */
***************
*** 1655,1661
        case T_ULONG:
  	return builtin_type_unsigned_long;
      }
!   printf ("unexpected type %d at symnum %d\n", c_type, cs->c_symnum);
    return builtin_type_void;
  }
  

--- 1675,1682 -----
        case T_ULONG:
  	return builtin_type_unsigned_long;
      }
!   printf ("unexpected type %d of %s ( symnum %d ), class %d\n"
! 	  , c_type, cs->c_name, cs->c_symnum, cs->c_sclass);
    return builtin_type_void;
  }
  
*** ../gdb.dist/command.c	Sat Mar 26 10:12:00 1988
--- command.c	Wed Nov  9 02:03:33 1988
***************
*** 103,108
  what you give them.   Help stamp out software-hoarding!  */
  
  
  #include "command.h"
  #include <stdio.h>
  

--- 103,109 -----
  what you give them.   Help stamp out software-hoarding!  */
  
  
+ #include "config.h"
  #include "command.h"
  #include <stdio.h>
  
*** ../gdb.dist/core.c	Wed May  4 01:20:35 1988
--- core.c	Thu Nov 24 00:07:08 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "initialize.h"
  #include "defs.h"
  #include "param.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "initialize.h"
  #include "defs.h"
  #include "param.h"
***************
*** 26,31
  #include <stdio.h>
  #include <signal.h>
  #include <sys/param.h>
  #include <sys/dir.h>
  #include <sys/file.h>
  #include <sys/stat.h>

--- 27,36 -----
  #include <stdio.h>
  #include <signal.h>
  #include <sys/param.h>
+ #ifdef NS5
+ #include <fcntl.h>
+ #include <sys/types.h>
+ #endif
  #include <sys/dir.h>
  #include <sys/file.h>
  #include <sys/stat.h>
***************
*** 33,38
  /* Recognize COFF format systems because a.out.h defines AOUTHDR.  */
  #ifdef AOUTHDR
  #define COFF_FORMAT
  #endif
  
  #ifdef NEW_SUN_CORE

--- 38,45 -----
  /* Recognize COFF format systems because a.out.h defines AOUTHDR.  */
  #ifdef AOUTHDR
  #define COFF_FORMAT
+ #ifndef PAGESIZE
+ #define PAGESIZE NBPG
  #endif
  #endif
  
***************
*** 34,39
  #ifdef AOUTHDR
  #define COFF_FORMAT
  #endif
  
  #ifdef NEW_SUN_CORE
  #include <sys/core.h>

--- 41,47 -----
  #ifndef PAGESIZE
  #define PAGESIZE NBPG
  #endif
+ #endif
  
  #ifdef NEW_SUN_CORE
  #include <sys/core.h>
***************
*** 149,155
  static void validate_files ();
  unsigned int register_addr ();
  
! core_file_command (filename, from_tty)
       char *filename;
       int from_tty;
  {

--- 157,163 -----
  static void validate_files ();
  unsigned int register_addr ();
  
! void core_file_command (filename, from_tty)
       char *filename;
       int from_tty;
  {
***************
*** 252,261
  			? sys_siglist[u.pt_signal]
  			: "(undocumented)");
  #else /* not UMAX_CORE */
! 	data_end = data_start + NBPG * u.u_dsize;
! 	stack_start = stack_end - NBPG * u.u_ssize;
! 	data_offset = NBPG * UPAGES;
! 	stack_offset = NBPG * (UPAGES + u.u_dsize);
  	reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR;
  
  	/* I don't know where to find this info.

--- 260,278 -----
  			? sys_siglist[u.pt_signal]
  			: "(undocumented)");
  #else /* not UMAX_CORE */
! 
!         /* At this point data_start will be zero if we haven't loaded an
! 	   executable file */
! #ifdef  NS5
! 	if (! data_start) data_start = u.u_datorg;
! #endif
! 	data_end = data_start + PAGESIZE * u.u_dsize;
! 	stack_start = stack_end - PAGESIZE * u.u_ssize;
! 	data_offset = PAGESIZE * USIZE;
! #ifdef NS5
! 	data_offset += data_start & (PAGESIZE - 1);
! #endif	
! 	stack_offset = PAGESIZE * (u.u_dsize + USIZE);
  	reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR;
  
  	/* I don't know where to find this info.
***************
*** 333,338
    else if (from_tty)
      printf ("No core file now.\n");
  }
  
  exec_file_command (filename, from_tty)
       char *filename;

--- 350,356 -----
    else if (from_tty)
      printf ("No core file now.\n");
  }
+ 
  
  void exec_file_command (filename, from_tty)
       char *filename;
***************
*** 334,340
      printf ("No core file now.\n");
  }
  
! exec_file_command (filename, from_tty)
       char *filename;
       int from_tty;
  {

--- 352,358 -----
  }
  
  
! void exec_file_command (filename, from_tty)
       char *filename;
       int from_tty;
  {
*** ../gdb.dist/dbxread.c	Thu Jul  7 16:02:06 1988
--- dbxread.c	Wed Nov  9 02:03:28 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "param.h"
  
  #ifdef READ_DBX_FORMAT

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "param.h"
  
  #ifdef READ_DBX_FORMAT
*** ../gdb.dist/environ.c	Fri Feb 12 10:24:40 1988
--- environ.c	Wed Nov  9 02:03:21 1988
***************
*** 100,105
  In other words, feel free to share this program, but don't try to
  stop anyone else from sharing it.  */
  
  #define min(a, b) ((a) < (b) ? (a) : (b))
  #define max(a, b) ((a) > (b) ? (a) : (b))
  

--- 100,107 -----
  In other words, feel free to share this program, but don't try to
  stop anyone else from sharing it.  */
  
+ #include "config.h"
+ 
  #define min(a, b) ((a) < (b) ? (a) : (b))
  #define max(a, b) ((a) > (b) ? (a) : (b))
  
*** ../gdb.dist/eval.c	Thu Feb  4 04:33:36 1988
--- eval.c	Wed Nov  9 02:03:19 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "symtab.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "symtab.h"
*** ../gdb.dist/expprint.c	Tue May 31 12:57:28 1988
--- expprint.c	Wed Nov  9 02:03:12 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "symtab.h"
  #include "expression.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "symtab.h"
  #include "expression.h"
*** ../gdb.dist/findvar.c	Tue Jun 28 13:23:27 1988
--- findvar.c	Wed Nov  9 02:03:06 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"
*** ../gdb.dist/firstfile.c	Fri Feb 12 10:24:25 1988
--- firstfile.c	Wed Nov  9 02:03:03 1988
***************
*** 127,132
     After the files to be found must come the file `lastfile'
     which ends the chain of calls.  */
  
  #include "initialize.h"
  
  static initialize_next_file ();

--- 127,133 -----
     After the files to be found must come the file `lastfile'
     which ends the chain of calls.  */
  
+ #include "config.h"
  #include "initialize.h"
  
  static initialize_next_file ();
*** ../gdb.dist/gld-pinsn.c	Wed Jun 22 13:14:01 1988
--- gld-pinsn.c	Wed Nov  9 02:03:01 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  #include <a.out.h>
  

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  #include <a.out.h>
  
*** ../gdb.dist/infcmd.c	Tue Jun 28 13:26:13 1988
--- infcmd.c	Wed Nov  9 02:02:59 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "symtab.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "symtab.h"
*** ../gdb.dist/inflow.c	Sun Sep  4 01:40:48 1988
--- inflow.c	Thu Nov 10 14:58:45 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"
***************
*** 26,31
  
  #include <stdio.h>
  #include <sys/param.h>
  #include <sys/dir.h>
  #ifndef UMAX_PTRACE
  #include <sys/user.h>

--- 27,36 -----
  
  #include <stdio.h>
  #include <sys/param.h>
+ #ifdef NS5
+ #include <sys/types.h>
+ #include <signal.h>
+ #endif
  #include <sys/dir.h>
  #ifndef UMAX_PTRACE
  #include <sys/user.h>
*** ../gdb.dist/infrun.c	Sat Jun 25 18:23:50 1988
--- infrun.c	Wed Nov  9 02:02:54 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"
***************
*** 29,34
  #include <stdio.h>
  #include <signal.h>
  #include <a.out.h>
  #include <sys/file.h>
  
  #ifdef UMAX_PTRACE

--- 30,41 -----
  #include <stdio.h>
  #include <signal.h>
  #include <a.out.h>
+ #ifdef NS5
+ #include <sys/types.h>
+ #ifndef X_OK
+ #define X_OK 01
+ #endif
+ #endif
  #include <sys/file.h>
  
  #ifdef UMAX_PTRACE
*** ../gdb.dist/kdb-start.c	Wed Jul 16 10:25:52 1986
--- kdb-start.c	Wed Nov  9 02:02:52 1988
***************
*** 1,3
  #include "defs.h"
  #include "param.h"
  

--- 1,4 -----
+ #include "config.h"
  #include "defs.h"
  #include "param.h"
  
*** ../gdb.dist/m68k-pinsn.c	Wed Jun 22 13:14:41 1988
--- m68k-pinsn.c	Wed Nov  9 02:02:50 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  
  #include "defs.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  
  #include "defs.h"
@//E*O*F patch#2//
chmod u=rw,g=r,o=r patch#2
 
echo Inspecting for damage in transit...
temp=/tmp/shar$$; dtemp=/tmp/.shar$$
trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
cat > $temp <<\!!!
    681   1995  15277 patch#2
!!!
wc  patch#2 | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
if [ -s $dtemp ]
then echo "Ouch [diff of wc output]:" ; cat $dtemp
else echo "No problems found."
fi
exit 0

ian@UUNET.UU.NET (12/01/88)

(Sorry if you've seen this before but I sent it to bug-gnu-emacs
not realising that bug-gdb existed)

In GDB 2.7 on sibyl (usg-unix-v)

There are 5 parts because outgoing overseas mail from here must be
less than 25k. Part 1 contains a shar archive containing the new
files. Parts 2 to 5 contain shar archives of the patch files to make
the changes to the the existing files. The patch files are context
differences.

Part 4 of 5:

--------------Cut Here-----------------------
# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by ian on Thu Nov 24 11:20:13 CST 1988
# Contents:  patch#3
 
echo x - patch#3
sed 's/^@//' > "patch#3" <<'@//E*O*F patch#3//'
*** ../gdb.dist/main.c	Thu Jul 21 05:21:34 1988
--- main.c	Wed Nov 16 01:02:16 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <sys/file.h>
  #include <stdio.h>
  #include <setjmp.h>

--- 18,28 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
+ #include "param.h"
+ #ifdef NS5
+ #include <sys/types.h>
+ #endif
  #include <sys/file.h>
  #include <stdio.h>
  #include <setjmp.h>
***************
*** 25,31
  #include <sys/param.h>
  #include "defs.h"
  #include "command.h"
- #include "param.h"
  
  #ifdef SET_STACK_LIMIT_HUGE
  #include <sys/time.h>

--- 30,35 -----
  #include <sys/param.h>
  #include "defs.h"
  #include "command.h"
  
  #ifdef SET_STACK_LIMIT_HUGE
  #include <sys/time.h>
***************
*** 32,37
  #include <sys/resource.h>
  #endif
  
  /* Version number of GDB, as a string.  */
  
  extern char *version;

--- 36,47 -----
  #include <sys/resource.h>
  #endif
  
+ #ifdef NS5
+ #ifndef R_OK
+ #define R_OK (04)
+ #endif
+ #endif
+ 
  /* Version number of GDB, as a string.  */
  
  extern char *version;
***************
*** 148,153
       char **envp;
  {
    extern void request_quit ();
    int count;
    int inhibit_gdbinit = 0;
    int quiet = 0;

--- 158,164 -----
       char **envp;
  {
    extern void request_quit ();
+   char *getenv();
    int count;
    int inhibit_gdbinit = 0;
    int quiet = 0;
***************
*** 871,877
  automatically terminated.  However, parties who have received computer\n\
  software programs from you with this License Agreement will not have\n\
  their licenses terminated so long as such parties remain in full compliance.\n\
! \n\
    5. If you wish to incorporate parts of GDB into other free\n\
  programs whose distribution conditions are different, write to the Free\n\
  Software Foundation at 675 Mass Ave, Cambridge, MA 02139.  We have not yet\n\

--- 882,889 -----
  automatically terminated.  However, parties who have received computer\n\
  software programs from you with this License Agreement will not have\n\
  their licenses terminated so long as such parties remain in full compliance.\n\
! \n");
!   printf ("\
    5. If you wish to incorporate parts of GDB into other free\n\
  programs whose distribution conditions are different, write to the Free\n\
  Software Foundation at 675 Mass Ave, Cambridge, MA 02139.  We have not yet\n\
***************
*** 986,991
  static void
  quit_command ()
  {
    if (have_inferior_p ())
      {
        if (query ("The program is running.  Quit anyway? "))

--- 998,1004 -----
  static void
  quit_command ()
  {
+   void exit();
    if (have_inferior_p ())
      {
        if (query ("The program is running.  Quit anyway? "))
*** ../gdb.dist/ns32k-pinsn.c	Wed Jun 22 13:15:44 1988
--- ns32k-pinsn.c	Fri Nov 18 02:07:28 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  
  #include "defs.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  
  #include "defs.h"
***************
*** 40,48
   * into buffer
   */
  
! int
! bit_extract (buffer, offset, count)
!      char *buffer;
       int offset;
       int count;
  {

--- 41,49 -----
   * into buffer
   */
  
! void
! bit_extract (buffer, offset, count, result)
!      char *buffer, *result;
       int offset;
       int count;
  {
***************
*** 46,52
       int offset;
       int count;
  {
!   int result;
    int mask;
    int bit;
  

--- 47,53 -----
       int offset;
       int count;
  {
!   int i;
    int mask;
    int bit;
  
***************
*** 52,60
  
    buffer += offset >> 3;
    offset &= 7;
!   bit = 1;
!   result = 0;
!   while (count--) 
      {
        if ((*buffer & (1 << offset)))
  	result |= bit;

--- 53,59 -----
  
    buffer += offset >> 3;
    offset &= 7;
!   while (count)
      {
        for (i = min(8, count), bit = 1, *result = 0; i--; count--, bit <<= 1)
  	{
***************
*** 56,64
    result = 0;
    while (count--) 
      {
!       if ((*buffer & (1 << offset)))
! 	result |= bit;
!       if (++offset == 8)
  	{
  	  offset = 0;
  	  buffer++;

--- 55,61 -----
    offset &= 7;
    while (count)
      {
!       for (i = min(8, count), bit = 1, *result = 0; i--; count--, bit <<= 1)
  	{
  	  if ((*buffer & (1 << offset)))
  	    *result |= bit;
***************
*** 60,67
  	result |= bit;
        if (++offset == 8)
  	{
! 	  offset = 0;
! 	  buffer++;
  	}
        bit <<= 1;
      }

--- 57,69 -----
      {
        for (i = min(8, count), bit = 1, *result = 0; i--; count--, bit <<= 1)
  	{
! 	  if ((*buffer & (1 << offset)))
! 	    *result |= bit;
! 	  if (++offset == 8)
! 	    {
! 	      offset = 0;
! 	      buffer++;
! 	    }
  	}
        result++;
      }
***************
*** 63,69
  	  offset = 0;
  	  buffer++;
  	}
!       bit <<= 1;
      }
    return result;
  }

--- 65,71 -----
  	      buffer++;
  	    }
  	}
!       result++;
      }
  }
  
***************
*** 65,71
  	}
        bit <<= 1;
      }
-   return result;
  }
  
  float

--- 67,72 -----
  	}
        result++;
      }
  }
  
  
***************
*** 68,80
    return result;
  }
  
- float
- fbit_extract (buffer, offset, count)
- {
-   union {
-     int ival;
-     float fval;
-   } foo;
  
    foo.ival = bit_extract (buffer, offset, 32);
    return foo.fval;

--- 69,74 -----
      }
  }
  
  
  sign_extend (value, bits)
       int value, bits;
***************
*** 76,98
      float fval;
    } foo;
  
-   foo.ival = bit_extract (buffer, offset, 32);
-   return foo.fval;
- }
- 
- double
- dbit_extract (buffer, offset, count)
- {
-   union {
-     struct {int low, high; } ival;
-     double dval;
-   } foo;
- 
-   foo.ival.low = bit_extract (buffer, offset, 32);
-   foo.ival.high = bit_extract (buffer, offset+32, 32);
-   return foo.dval;
- }
- 
  sign_extend (value, bits)
  {
    value = value & ((1 << bits) - 1);

--- 70,75 -----
  }
  
  
  sign_extend (value, bits)
       int value, bits;
  {
***************
*** 94,99
  }
  
  sign_extend (value, bits)
  {
    value = value & ((1 << bits) - 1);
    return (value & (1 << (bits-1))

--- 71,77 -----
  
  
  sign_extend (value, bits)
+      int value, bits;
  {
    value = value & ((1 << bits) - 1);
    return (value & (1 << (bits-1))
***************
*** 222,228
      case 'W':
      case 'D':
      case 'A':
!       addr_mode = bit_extract (buffer, ioffset-5, 5);
        ioffset -= 5;
        switch (addr_mode)
  	{

--- 200,207 -----
      case 'W':
      case 'D':
      case 'A':
!       bit_extract (buffer, ioffset-5, 5, (char *) &addr_mode);
!       addr_mode &= ((1 << 5) - 1);
        ioffset -= 5;
        switch (addr_mode)
  	{
***************
*** 258,264
  	  switch (d)
  	    {
  	    case 'B':
! 	      Ivalue = bit_extract (buffer, *aoffsetp, 8);
  	      Ivalue = sign_extend (Ivalue, 8);
  	      *aoffsetp += 8;
  	      sprintf (result, "$%d", Ivalue);

--- 237,244 -----
  	  switch (d)
  	    {
  	    case 'B':
! 	      bit_extract (buffer, *aoffsetp, 8, (char *) &Ivalue);
! 	      Ivalue &= ((1 << 8) - 1);
  	      Ivalue = sign_extend (Ivalue, 8);
  	      *aoffsetp += 8;
  	      sprintf (result, "$%d", Ivalue);
***************
*** 264,270
  	      sprintf (result, "$%d", Ivalue);
  	      break;
  	    case 'W':
! 	      Ivalue = bit_extract (buffer, *aoffsetp, 16);
  	      flip_bytes (&Ivalue, 2);
  	      *aoffsetp += 16;
  	      Ivalue = sign_extend (Ivalue, 16);

--- 244,251 -----
  	      sprintf (result, "$%d", Ivalue);
  	      break;
  	    case 'W':
! 	      bit_extract (buffer, *aoffsetp, 16, (char *) &Ivalue);
! 	      Ivalue &= ((1 << 16) - 1);
  	      flip_bytes (&Ivalue, 2);
  	      *aoffsetp += 16;
  	      Ivalue = sign_extend (Ivalue, 16);
***************
*** 271,277
  	      sprintf (result, "$%d", Ivalue);
  	      break;
  	    case 'D':
! 	      Ivalue = bit_extract (buffer, *aoffsetp, 32);
  	      flip_bytes (&Ivalue, 4);
  	      *aoffsetp += 32;
  	      sprintf (result, "$%d", Ivalue);

--- 252,258 -----
  	      sprintf (result, "$%d", Ivalue);
  	      break;
  	    case 'D':
! 	      bit_extract (buffer, *aoffsetp, 32, (char *) &Ivalue);
  	      flip_bytes (&Ivalue, 4);
  	      *aoffsetp += 32;
  	      sprintf (result, "$%d", Ivalue);
***************
*** 277,283
  	      sprintf (result, "$%d", Ivalue);
  	      break;
  	    case 'A':
! 	      Ivalue = bit_extract (buffer, *aoffsetp, 32);
  	      flip_bytes (&Ivalue, 4);
  	      *aoffsetp += 32;
  	      sprintf (result, "$|%d|", Ivalue);

--- 258,264 -----
  	      sprintf (result, "$%d", Ivalue);
  	      break;
  	    case 'A':
! 	      bit_extract (buffer, *aoffsetp, 32, (char *) &Ivalue);
  	      flip_bytes (&Ivalue, 4);
  	      *aoffsetp += 32;
  	      sprintf (result, "$|%d|", Ivalue);
***************
*** 283,289
  	      sprintf (result, "$|%d|", Ivalue);
  	      break;
  	    case 'F':
! 	      Fvalue = fbit_extract (buffer, *aoffsetp, 32);
  	      flip_bytes (&Fvalue, 4);
  	      *aoffsetp += 32;
  	      sprintf (result, "$%g", Fvalue);

--- 264,270 -----
  	      sprintf (result, "$|%d|", Ivalue);
  	      break;
  	    case 'F':
! 	      bit_extract (buffer, *aoffsetp, 32, (char *) &Fvalue);
  	      flip_bytes (&Fvalue, 4);
  	      *aoffsetp += 32;
  	      if (INVALID_FLOAT (&Fvalue, 4))
***************
*** 286,292
  	      Fvalue = fbit_extract (buffer, *aoffsetp, 32);
  	      flip_bytes (&Fvalue, 4);
  	      *aoffsetp += 32;
! 	      sprintf (result, "$%g", Fvalue);
  	      break;
  	    case 'L':
  	      Lvalue = dbit_extract (buffer, *aoffsetp, 64);

--- 267,276 -----
  	      bit_extract (buffer, *aoffsetp, 32, (char *) &Fvalue);
  	      flip_bytes (&Fvalue, 4);
  	      *aoffsetp += 32;
! 	      if (INVALID_FLOAT (&Fvalue, 4))
! 		sprintf (result, "<<invalid float 0x%.8x>>", *(int *) &Fvalue);
! 	      else
! 		sprintf (result, "$%g", Fvalue);
  	      break;
  	    case 'L':
  	      bit_extract (buffer, *aoffsetp, 64, (char *) &Lvalue);
***************
*** 289,295
  	      sprintf (result, "$%g", Fvalue);
  	      break;
  	    case 'L':
! 	      Lvalue = dbit_extract (buffer, *aoffsetp, 64);
  	      flip_bytes (&Lvalue, 8);
  	      *aoffsetp += 64;
  	      sprintf (result, "$%g", Lvalue);

--- 273,279 -----
  		sprintf (result, "$%g", Fvalue);
  	      break;
  	    case 'L':
! 	      bit_extract (buffer, *aoffsetp, 64, (char *) &Lvalue);
  	      flip_bytes (&Lvalue, 8);
  	      *aoffsetp += 64;
  	      if (INVALID_FLOAT (&Lvalue, 8))
***************
*** 292,298
  	      Lvalue = dbit_extract (buffer, *aoffsetp, 64);
  	      flip_bytes (&Lvalue, 8);
  	      *aoffsetp += 64;
! 	      sprintf (result, "$%g", Lvalue);
  	      break;
  	    }
  	  break;

--- 276,286 -----
  	      bit_extract (buffer, *aoffsetp, 64, (char *) &Lvalue);
  	      flip_bytes (&Lvalue, 8);
  	      *aoffsetp += 64;
! 	      if (INVALID_FLOAT (&Lvalue, 8))
! 		sprintf (result, "<<invalid long 0x%.8x%.8x>>",
! 			 *(((int *) &Lvalue) + 1), *(int *) &Lvalue);
! 	      else
! 		sprintf (result, "$%g", Lvalue);
  	      break;
  	    }
  	  break;
***************
*** 328,334
  	case 0x1d:
  	case 0x1e:
  	case 0x1f:
! 	  index = bit_extract (buffer, *aoffsetp, 8);
  	  *aoffsetp += 8;
  	  print_insn_arg (d, *aoffsetp, aoffsetp, buffer, addr,
  			  result);

--- 316,323 -----
  	case 0x1d:
  	case 0x1e:
  	case 0x1f:
! 	  bit_extract (buffer, *aoffsetp, 8, (char *) &index);
! 	  index &= ((1 << 8) - 1);
  	  *aoffsetp += 8;
  	  print_insn_arg (d, *aoffsetp, aoffsetp, buffer, addr,
  			  result);
***************
*** 344,350
  	}
        break;
      case 'q':
!       Ivalue = bit_extract (buffer, ioffset-4, 4);
        Ivalue = sign_extend (Ivalue, 4);
        sprintf (result, "%d", Ivalue);
        ioffset -= 4;

--- 333,340 -----
  	}
        break;
      case 'q':
!       bit_extract (buffer, ioffset-4, 4, (char *) &Ivalue);
!       Ivalue &= ((1 << 4) - 1);
        Ivalue = sign_extend (Ivalue, 4);
        sprintf (result, "%d", Ivalue);
        ioffset -= 4;
***************
*** 350,356
        ioffset -= 4;
        break;
      case 'r':
!       Ivalue = bit_extract (buffer, ioffset-3, 3);
        sprintf (result, "r%d", Ivalue&7);
        ioffset -= 3;
        break;

--- 340,347 -----
        ioffset -= 4;
        break;
      case 'r':
!       bit_extract (buffer, ioffset-3, 3, (char *) &Ivalue);
!       Ivalue &= ((1 << 3) - 1);
        sprintf (result, "r%d", Ivalue&7);
        ioffset -= 3;
        break;
***************
*** 363,369
  	       NEXT_IS_ADDR);
        break;
      case 'i':
!       Ivalue = bit_extract (buffer, *aoffsetp, 8);
        *aoffsetp += 8;
        sprintf (result, "0x%x", Ivalue);
        break;

--- 354,361 -----
  	       NEXT_IS_ADDR);
        break;
      case 'i':
!       bit_extract (buffer, *aoffsetp, 8, (char *) &Ivalue);
!       Ivalue &= ((1 << 8) - 1);
        *aoffsetp += 8;
        sprintf (result, "0x%x", Ivalue);
        break;
***************
*** 377,383
  {
    int Ivalue;
  
!   Ivalue = bit_extract (buffer, *aoffsetp, 8);
    switch (Ivalue & 0xc0)
      {
      case 0x00:

--- 369,376 -----
  {
    int Ivalue;
  
!   bit_extract (buffer, *aoffsetp, 8, (char *) &Ivalue);
!   Ivalue &= ((1 << 8) - 1);
    switch (Ivalue & 0xc0)
      {
      case 0x00:
***************
*** 386,392
        *aoffsetp += 8;
        break;
      case 0x80:
!       Ivalue = bit_extract (buffer, *aoffsetp, 16);
        flip_bytes (&Ivalue, 2);
        Ivalue = sign_extend (Ivalue, 14);
        *aoffsetp += 16;

--- 379,386 -----
        *aoffsetp += 8;
        break;
      case 0x80:
!       bit_extract (buffer, *aoffsetp, 16, (char *) &Ivalue);
!       Ivalue &= ((1 << 16) - 1);
        flip_bytes (&Ivalue, 2);
        Ivalue = sign_extend (Ivalue, 14);
        *aoffsetp += 16;
***************
*** 392,398
        *aoffsetp += 16;
        break;
      case 0xc0:
!       Ivalue = bit_extract (buffer, *aoffsetp, 32);
        flip_bytes (&Ivalue, 4);
        Ivalue = sign_extend (Ivalue, 30);
        *aoffsetp += 32;

--- 386,392 -----
        *aoffsetp += 16;
        break;
      case 0xc0:
!       bit_extract (buffer, *aoffsetp, 32, (char *) &Ivalue);
        flip_bytes (&Ivalue, 4);
        Ivalue = sign_extend (Ivalue, 30);
        *aoffsetp += 32;
***************
*** 437,443
  ns32k_get_enter_addr (pc)
       CORE_ADDR pc;
  {
!   CORE_ADDR enter_addr;
    unsigned char op;
  
    if (ABOUT_TO_RETURN (pc))

--- 431,437 -----
  ns32k_get_enter_addr (pc)
       CORE_ADDR pc;
  {
!   CORE_ADDR enter_addr, get_pc_function_start();
    unsigned char op;
  
    if (ABOUT_TO_RETURN (pc))
***************
*** 454,457
      return 0;		/* function has no enter/exit */
  
    return enter_addr;	/* pc is between enter and exit */
  }

--- 448,472 -----
      return 0;		/* function has no enter/exit */
  
    return enter_addr;	/* pc is between enter and exit */
+ }
+ 
+ int invalid_float(p, len)
+      register union { double d;
+ 	     float f;
+ 	     struct { unsigned m:23, e:8, :1} sf;
+ 	     struct { unsigned lm; unsigned m:20, e:11, :1} sd;
+ 	   } *p;
+      register int len;
+ {
+   register val;
+ 
+   if ( len == sizeof (float) )
+     val = (p->sf.e == 0xff
+ 	   || (p->sf.e == 0 && p->sf.m != 0));
+   else if ( len == sizeof (double) )
+     val = (p->sd.e == 0x7ff
+ 	   || (p->sd.e == 0 && (p->sd.m != 0 || p->sd.lm != 0)));
+   else
+     val = 1;
+   return (val);
  }
*** ../gdb.dist/printcmd.c	Sat Jul 23 13:43:34 1988
--- printcmd.c	Thu Nov 17 00:51:18 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  #include "defs.h"
  #include "initialize.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  #include "defs.h"
  #include "initialize.h"
***************
*** 64,70
  
  void do_displays ();
  void print_address ();
! void print_scalar_formatted ();
  
  START_FILE
  

--- 65,71 -----
  
  void do_displays ();
  void print_address ();
! void print_scalar_formatted (), get_selected_block(), dont_repeat();
  
  START_FILE
  
***************
*** 171,176
       int size;
       FILE *stream;
  {
    long val_long;
    int len = TYPE_LENGTH (type);
  

--- 172,178 -----
       int size;
       FILE *stream;
  {
+   extern void print_invalid_float();
    long val_long;
    int len = TYPE_LENGTH (type);
  
***************
*** 236,241
  	type = builtin_type_float;
        if (len == sizeof (double))
  	type = builtin_type_double;
  #ifdef IEEE_FLOAT
        if (is_nan (unpack_double (type, valaddr)))
  	{

--- 238,252 -----
  	type = builtin_type_float;
        if (len == sizeof (double))
  	type = builtin_type_double;
+ 
+       /* Test for invalid float here because "unpack_double" can't handle
+ 	 invalid floats very elegantly */
+       if (INVALID_FLOAT(valaddr, len))
+ 	{
+ 	  print_invalid_float(stdout, valaddr, len);
+ 	  break;
+ 	}
+ 
  #ifdef IEEE_FLOAT
        if (is_nan (unpack_double (type, valaddr)))
  	{
*** ../gdb.dist/remote.c	Fri Apr  8 11:06:11 1988
--- remote.c	Wed Nov  9 02:02:21 1988
***************
*** 62,67
  	kill req	k
  */
  
  #include <stdio.h>
  #include <signal.h>
  

--- 62,68 -----
  	kill req	k
  */
  
+ #include "config.h"
  #include <stdio.h>
  #include <signal.h>
  
***************
*** 74,79
  #include "wait.h"
  #include <sys/ioctl.h>
  #include <a.out.h>
  #include <sys/file.h>
  
  #ifdef HAVE_TERMIO

--- 75,83 -----
  #include "wait.h"
  #include <sys/ioctl.h>
  #include <a.out.h>
+ #ifdef NS5
+ #include <fcntl.h>
+ #include <sys/types.h>
  #include <sys/file.h>
  #endif
  
***************
*** 75,80
  #include <sys/ioctl.h>
  #include <a.out.h>
  #include <sys/file.h>
  
  #ifdef HAVE_TERMIO
  #include <termio.h>

--- 79,85 -----
  #include <fcntl.h>
  #include <sys/types.h>
  #include <sys/file.h>
+ #endif
  
  #ifdef HAVE_TERMIO
  #include <termio.h>
@//E*O*F patch#3//
chmod u=rw,g=r,o=r patch#3
 
echo Inspecting for damage in transit...
temp=/tmp/shar$$; dtemp=/tmp/.shar$$
trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
cat > $temp <<\!!!
    836   2379  18153 patch#3
!!!
wc  patch#3 | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
if [ -s $dtemp ]
then echo "Ouch [diff of wc output]:" ; cat $dtemp
else echo "No problems found."
fi
exit 0

ian@UUNET.UU.NET (12/01/88)

(Sorry if you've seen this before but I sent it to bug-gnu-emacs
not realising that bug-gdb existed)

In GDB 2.7 on sibyl (usg-unix-v)

There are 5 parts because outgoing overseas mail from here must be
less than 25k. Part 1 contains a shar archive containing the new
files. Parts 2 to 5 contain shar archives of the patch files to make
the changes to the the existing files. The patch files are context
differences.

Part 5 of 5:

--------------Cut Here-----------------------
# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by ian on Thu Nov 24 11:20:20 CST 1988
# Contents:  patch#4
 
echo x - patch#4
sed 's/^@//' > "patch#4" <<'@//E*O*F patch#4//'
*** ../gdb.dist/source.c	Tue May 24 04:54:44 1988
--- source.c	Wed Nov 16 01:02:34 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  #include <sys/param.h>
  #include <sys/stat.h>

--- 18,29 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
+ #include "param.h"
+ #ifdef NS5
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #endif
  #include <stdio.h>
  #include <sys/param.h>
  #include <sys/stat.h>
***************
*** 49,54
  static int first_line_listed;
  
  START_FILE
  
  /* Set the source file default for the "list" command,
     specifying a symtab.  */

--- 55,62 -----
  static int first_line_listed;
  
  START_FILE
+ 
+ void print_sys_errmsg();
  
  /* Set the source file default for the "list" command,
     specifying a symtab.  */
*** ../gdb.dist/stack.c	Tue May 24 04:54:39 1988
--- stack.c	Wed Nov 16 01:02:36 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  
  #include "defs.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  
  #include "defs.h"
***************
*** 47,52
  static void select_calling_frame ();
  
  void print_frame_info ();
  
  /* Print a stack frame briefly.  FRAME should be the frame address
     and LEVEL should be its level in the stack (or -1 for level not defined).

--- 48,55 -----
  static void select_calling_frame ();
  
  void print_frame_info ();
+ void print_source_lines(), set_default_breakpoint(), print_variable_value();
+ void set_return_value();
  
  /* Print a stack frame briefly.  FRAME should be the frame address
     and LEVEL should be its level in the stack (or -1 for level not defined).
*** ../gdb.dist/standalone.c	Wed May  4 00:51:51 1988
--- standalone.c	Wed Nov  9 02:02:08 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  #include <sys/ioctl.h>
  #include <signal.h>

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  #include <sys/ioctl.h>
  #include <signal.h>
*** ../gdb.dist/stuff.c	Wed Oct  1 07:17:34 1986
--- stuff.c	Wed Nov  9 02:02:06 1988
***************
*** 20,25
  
  /* Written 13-Mar-86 by David Bridgham. */
  
  #include <stdio.h>
  #include <a.out.h>
  #include <sys/types.h>

--- 20,26 -----
  
  /* Written 13-Mar-86 by David Bridgham. */
  
+ #include "config.h"
  #include <stdio.h>
  #include <a.out.h>
  #include <sys/types.h>
*** ../gdb.dist/symmisc.c	Tue Jul 26 17:03:55 1988
--- symmisc.c	Wed Nov  9 02:02:05 1988
***************
*** 19,24
  */
  
  
  #include "defs.h"
  #include "initialize.h"
  #include "symtab.h"

--- 19,25 -----
  */
  
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "symtab.h"
*** ../gdb.dist/symtab.c	Fri Apr  8 18:19:09 1988
--- symtab.c	Fri Nov 18 11:00:04 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "symtab.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "symtab.h"
***************
*** 36,41
  struct obstack obstack1;
  
  struct obstack *symbol_obstack = &obstack1;
  
  /* These variables point to the objects
     representing the predefined C data types.  */

--- 37,62 -----
  struct obstack obstack1;
  
  struct obstack *symbol_obstack = &obstack1;
+ 
+ struct misc_function *misc_function_vector;
+ int misc_function_count;
+ /* This is the list of struct symtab's that gdb considers current.  */
+ 
+ struct symtab *symtab_list;
+ 
+ /* This symtab variable specifies the current file for printing source lines */
+ 
+ struct symtab *current_source_symtab;
+ 
+ /* This is the next line to print for listing source lines.  */
+ 
+ int current_source_line;
+ 
+ /* Given a pc value, return line number it is in.
+    Second arg nonzero means if pc is on the boundary
+    use the previous statement's line number.  */
+ 
+ struct symtab_and_line find_pc_line ();
  
  /* These variables point to the objects
     representing the predefined C data types.  */
*** ../gdb.dist/utils.c	Tue May 31 12:57:25 1988
--- utils.c	Wed Nov 16 01:02:29 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  #include <signal.h>
  #include <sys/ioctl.h>

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  #include <signal.h>
  #include <sys/ioctl.h>
***************
*** 29,35
  
  void error ();
  void fatal ();
! 
  /* Chain of cleanup actions established with make_cleanup,
     to be executed if an error happens.  */
  

--- 30,36 -----
  
  void error ();
  void fatal ();
! char *malloc(), *realloc();
  /* Chain of cleanup actions established with make_cleanup,
     to be executed if an error happens.  */
  
***************
*** 211,217
  /* Control C comes here */
  
  void
! request_quit ()
  {
    quit_flag = 1;
    if (immediate_quit)

--- 212,219 -----
  /* Control C comes here */
  
  void
! request_quit (sig)
! int sig;
  {
  #ifdef NS5
    signal (sig, request_quit);	/* USG sytems reset to default */
***************
*** 213,218
  void
  request_quit ()
  {
    quit_flag = 1;
    if (immediate_quit)
      quit ();

--- 215,223 -----
  request_quit (sig)
  int sig;
  {
+ #ifdef NS5
+   signal (sig, request_quit);	/* USG sytems reset to default */
+ #endif  
    quit_flag = 1;
    if (immediate_quit)
      quit ();
*** ../gdb.dist/valarith.c	Fri Dec 18 02:55:52 1987
--- valarith.c	Wed Nov  9 02:02:02 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"
*** ../gdb.dist/valops.c	Fri Jan  8 13:20:27 1988
--- valops.c	Wed Nov 16 01:02:31 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"
***************
*** 25,30
  #include "value.h"
  
  START_FILE
  
  /* Cast value ARG2 to type TYPE and return as a value.
     More general than a C cast: accepts any two types of the same length,

--- 26,33 -----
  #include "value.h"
  
  START_FILE
+ 
+ void set_internalvar_component(), run_stack_dummy();
  
  /* Cast value ARG2 to type TYPE and return as a value.
     More general than a C cast: accepts any two types of the same length,
*** ../gdb.dist/valprint.c	Sun Sep  4 02:04:52 1988
--- valprint.c	Thu Nov 17 13:07:25 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  #include "defs.h"
  #include "initialize.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  #include "defs.h"
  #include "initialize.h"
***************
*** 34,39
  static void type_print_varspec_prefix ();
  static void type_print_base ();
  
  START_FILE
  
  char **unsigned_type_table;

--- 35,42 -----
  static void type_print_varspec_prefix ();
  static void type_print_base ();
  
+ void printchar(), print_scalar_formatted(), print_spaces();
+ 
  START_FILE
  
  char **unsigned_type_table;
***************
*** 120,125
       FILE *stream;
       char format;
  {
    register int i;
    int len;
    struct type *elttype;

--- 123,129 -----
       FILE *stream;
       char format;
  {
+   extern void print_invalid_float();
    register int i;
    int len;
    struct type *elttype;
***************
*** 280,285
  	  print_scalar_formatted (valaddr, type, format, 0, stream);
  	  break;
  	}
  #ifdef IEEE_FLOAT
        if (is_nan (unpack_double (type, valaddr)))
  	{

--- 284,299 -----
  	  print_scalar_formatted (valaddr, type, format, 0, stream);
  	  break;
  	}
+ 
+       /* Test for invalid float here because "unpack_double" can't handle
+ 	 invalid floats very elegantly */
+       len = TYPE_LENGTH (type);
+       if (INVALID_FLOAT(valaddr, len))
+ 	{
+ 	  print_invalid_float(stream, valaddr, len);
+ 	  break;
+ 	}
+ 
  #ifdef IEEE_FLOAT
        if (is_nan (unpack_double (type, valaddr)))
  	{
***************
*** 300,305
    fflush (stream);
  }
  
  #ifdef IEEE_FLOAT
  
  union ieee {

--- 314,349 -----
    fflush (stream);
  }
  
+ void print_invalid_float(stream, valaddr, len)
+      FILE *stream;
+      char *valaddr;
+      int len;
+ {
+   int i;
+   unsigned char *charp;
+ 
+   int lowhalf, highhalf;
+   union { int i; char c; } test;
+   
+   fprintf (stream, "<<invalid %s 0x",
+ 	   (len == sizeof (float)) ? "float": "double");
+ 
+   /* Separate the high and low words of the double.
+      Distinguish big and little-endian machines.  */
+   test.i = 1;
+   if (test.c != 1)
+     /* Big-endian machine */
+     for (i = len, charp = ((unsigned char *) valaddr); i--; charp++ )
+       fprintf (stream, "%.2x", (int) *charp);
+   else
+     /* Little-endian machine */
+     for (i = len, charp = (((unsigned char *) valaddr) + len - 1);
+ 	 i--; charp-- )
+       fprintf (stream, "%.2x", (int) *charp);
+ 
+   fprintf (stream, ">>");
+ }
+ 
  #ifdef IEEE_FLOAT
  
  union ieee {
*** ../gdb.dist/values.c	Sat May 21 05:02:39 1988
--- values.c	Wed Nov  9 02:01:58 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  #include "defs.h"
  #include "initialize.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  #include "defs.h"
  #include "initialize.h"
*** ../gdb.dist/vax-pinsn.c	Wed Jun 22 13:16:14 1988
--- vax-pinsn.c	Wed Nov  9 02:01:57 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  
  #include "defs.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  
  #include "defs.h"
*** ../gdb.dist/xgdb.c	Thu Jul 21 08:15:18 1988
--- xgdb.c	Wed Nov  9 02:01:55 1988
***************
*** 20,25
  
  /* Original version was contributed by Derek Beatty, 30 June 87.  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"

--- 20,26 -----
  
  /* Original version was contributed by Derek Beatty, 30 June 87.  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"
*** ../gdb.dist/defs.h	Mon May 23 04:22:48 1988
--- defs.h	Wed Nov 16 11:44:44 1988
***************
*** 20,25
  
  #define CORE_ADDR unsigned int
  
  #define min(a, b) ((a) < (b) ? (a) : (b))
  #define max(a, b) ((a) > (b) ? (a) : (b))
  

--- 20,27 -----
  
  #define CORE_ADDR unsigned int
  
+ extern CORE_ADDR read_register();
+ 
  #define min(a, b) ((a) < (b) ? (a) : (b))
  #define max(a, b) ((a) > (b) ? (a) : (b))
  
***************
*** 29,35
  extern char *alloca ();
  extern int parse_escape ();
  extern char *reg_names[];
! 
  extern int quit_flag;
  
  extern int immediate_quit;

--- 31,37 -----
  extern char *alloca ();
  extern int parse_escape ();
  extern char *reg_names[];
! extern char *get_exec_file();
  extern int quit_flag;
  extern unsigned int register_addr();
  extern char *internalvar_name(), *xmalloc(), *xrealloc();
***************
*** 31,36
  extern char *reg_names[];
  
  extern int quit_flag;
  
  extern int immediate_quit;
  

--- 33,40 -----
  extern char *reg_names[];
  extern char *get_exec_file();
  extern int quit_flag;
+ extern unsigned int register_addr();
+ extern char *internalvar_name(), *xmalloc(), *xrealloc();
  
  extern long lseek();
  extern void free();
***************
*** 32,37
  
  extern int quit_flag;
  
  extern int immediate_quit;
  
  #define QUIT { if (quit_flag) quit (); }

--- 36,46 -----
  extern unsigned int register_addr();
  extern char *internalvar_name(), *xmalloc(), *xrealloc();
  
+ extern long lseek();
+ extern void free();
+ 
+ extern char *re_comp(), *re_exec();
+ 
  extern int immediate_quit;
  
  extern CORE_ADDR parse_and_eval_address(), parse_and_eval_address_1();
***************
*** 34,39
  
  extern int immediate_quit;
  
  #define QUIT { if (quit_flag) quit (); }
  
  enum command_class

--- 43,61 -----
  
  extern int immediate_quit;
  
+ extern CORE_ADDR parse_and_eval_address(), parse_and_eval_address_1();
+ extern CORE_ADDR find_line_pc();
+ 
+ extern void clear_momentary_breakpoints(), clear_breakpoint_commands();
+ extern void delete_current_display();
+ extern void init_source_path(), error(), fatal();
+ extern void free_all_values(), do_breakpoint_commands(), perror_with_name();
+ extern void add_com(), add_prefix_command(), add_com_alias(), add_info();
+ extern void add_info_alias(), error_no_arg(), set_next_address();
+ extern void set_internalvar(), write_register(), error_no_arg();
+ extern void print_expression();
+ 
+ extern void quit();
  #define QUIT { if (quit_flag) quit (); }
  
  enum command_class
*** ../gdb.dist/symtab.h	Fri Apr  8 18:17:50 1988
--- symtab.h	Wed Nov 23 02:59:16 1988
***************
*** 48,55
  
  /* Address and length of the vector recording all misc function names/addresses.  */
  
! struct misc_function *misc_function_vector;
! int misc_function_count;
  
  #include "symseg.h"
  

--- 48,55 -----
  
  /* Address and length of the vector recording all misc function names/addresses.  */
  
! extern struct misc_function *misc_function_vector;
! extern int misc_function_count;
  
  #include "symseg.h"
  
***************
*** 97,103
  
  /* This is the list of struct symtab's that gdb considers current.  */
  
! struct symtab *symtab_list;
  
  /* This symtab variable specifies the current file for printing source lines */
  

--- 97,103 -----
  
  /* This is the list of struct symtab's that gdb considers current.  */
  
! extern struct symtab *symtab_list;
  
  /* This symtab variable specifies the current file for printing source lines */
  
***************
*** 101,107
  
  /* This symtab variable specifies the current file for printing source lines */
  
! struct symtab *current_source_symtab;
  
  /* This is the next line to print for listing source lines.  */
  

--- 101,107 -----
  
  /* This symtab variable specifies the current file for printing source lines */
  
! extern struct symtab *current_source_symtab;
  
  /* This is the next line to print for listing source lines.  */
  
***************
*** 105,111
  
  /* This is the next line to print for listing source lines.  */
  
! int current_source_line;
  
  #define BLOCKLIST(symtab) (symtab)->blockvector
  #define BLOCKVECTOR(symtab) (symtab)->blockvector

--- 105,111 -----
  
  /* This is the next line to print for listing source lines.  */
  
! extern int current_source_line;
  
  #define BLOCKLIST(symtab) (symtab)->blockvector
  #define BLOCKVECTOR(symtab) (symtab)->blockvector
***************
*** 206,212
     Second arg nonzero means if pc is on the boundary
     use the previous statement's line number.  */
  
! struct symtab_and_line find_pc_line ();
  
  /* Given a string, return the line specified by it.
     For commands like "list" and "breakpoint".  */

--- 206,212 -----
     Second arg nonzero means if pc is on the boundary
     use the previous statement's line number.  */
  
! extern struct symtab_and_line find_pc_line ();
  
  /* Given a string, return the line specified by it.
     For commands like "list" and "breakpoint".  */
***************
*** 211,215
  /* Given a string, return the line specified by it.
     For commands like "list" and "breakpoint".  */
  
! struct symtab_and_line decode_line_spec ();
! struct symtab_and_line decode_line_1 ();

--- 211,215 -----
  /* Given a string, return the line specified by it.
     For commands like "list" and "breakpoint".  */
  
! extern struct symtab_and_line decode_line_spec ();
! extern struct symtab_and_line decode_line_1 ();
@//E*O*F patch#4//
chmod u=rw,g=r,o=r patch#4
 
echo Inspecting for damage in transit...
temp=/tmp/shar$$; dtemp=/tmp/.shar$$
trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
cat > $temp <<\!!!
    719   2258  16810 patch#4
!!!
wc  patch#4 | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
if [ -s $dtemp ]
then echo "Ouch [diff of wc output]:" ; cat $dtemp
else echo "No problems found."
fi
exit 0