brunner@bullhead.uucp (10/21/89)
Subject: Fix for dbx (part 5) Index: /usr/src/ucb/dbx IBM/4.3 Description: Several problems (too numerous to mention) exist with the December release of dbx. This is part 1 of a 5 part patch installation kit. The contents of the kit are: part 1 shar file containing help.c part 2 patchs to the following files: dbx/ibmrt/{coredump.c,decode.c,frame.c,procinfo.c} part 3 patchs to the following files: dbx/{object.c,eval.c,commands.y,c.c,tree.c} part 4 patchs to the following files: dbx/{runtime.c,symbols.c,execute.c,events.c,mappings.c} part 5 patches to the following files: dbx/{stabstring.c,printsym.c,operators.c,process.c, keywords.c,pascal.c,fortran.c,main.c,Makefile, examine.c,scanner.c,source.c,library.c} Fix: Change directories to /usr/src/ucb/dbx and apply this patch file, e.g., patch < this_file Proceede to the next part of the kit. Inconsistencies between the several compilers (hc, pp, f77) and the loader exist, stabs in particular. These will be corrected in a following patch to dbx, or in corrective releases of the compilers, or both. *** /usr/src/ucb/dbx/stabstring.c Fri Dec 9 11:57:42 1988 --- stabstring.c Thu Oct 12 14:37:28 1989 *************** *** 1,16 **** ! /* $Header:stabstring.c 12.0$ */ ! /* $ACIS:stabstring.c 12.0$ */ ! /* $Source: /ibm/acis/usr/src/ucb/dbx/RCS/stabstring.c,v $ */ #ifndef lint ! static char *rcsid = "$Header:stabstring.c 12.0$"; #endif /* ! * String information interpretation ! * ! * The string part of a stab entry is broken up into name and type information. ! */ #include "defs.h" #include "stabstring.h" --- 1,15 ---- ! /* $Header: stabstring.c,v 12.1 89/10/12 17:37:27 brunner Locked $ */ ! /* $Source: /fish/dbx/RCS/stabstring.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: stabstring.c,v 12.1 89/10/12 17:37:27 brunner Locked $"; #endif /* ! * String information interpretation ! * ! * The string part of a stab entry is broken up into name and type information. ! */ #include "defs.h" #include "stabstring.h" *************** *** 27,34 **** #endif /* ! * Special characters in symbol table information. ! */ #define CONSTNAME 'c' #define TYPENAME 't' --- 26,33 ---- #endif /* ! * Special characters in symbol table information. ! */ #define CONSTNAME 'c' #define TYPENAME 't' *************** *** 53,60 **** #define LOCALVAR /* default */ /* ! * Type information special characters. ! */ #define T_SUBRANGE 'r' #define T_ARRAY 'a' --- 52,59 ---- #define LOCALVAR /* default */ /* ! * Type information special characters. ! */ #define T_SUBRANGE 'r' #define T_ARRAY 'a' *************** *** 74,81 **** #define T_FILE 'd' /* ! * Table of types indexed by per-file unique identification number. ! */ #define NTYPES 6000 --- 73,80 ---- #define T_FILE 'd' /* ! * Table of types indexed by per-file unique identification number. ! */ #define NTYPES 6000 *************** *** 83,98 **** public initTypeTable () { ! bzero(typetable, sizeof(typetable)); ! (*language_op(curlang, L_MODINIT))(typetable); } /* ! * Put an nlist entry into the symbol table. ! * If it's already there just add the associated information. ! * ! * Type information is encoded in the name following a ":". ! */ private Symbol constype(); private Char *curchar; --- 82,97 ---- public initTypeTable () { ! bzero(typetable, sizeof(typetable)); ! (*language_op(curlang, L_MODINIT))(typetable); } /* ! * Put an nlist entry into the symbol table. ! * If it's already there just add the associated information. ! * ! * Type information is encoded in the name following a ":". ! */ private Symbol constype(); private Char *curchar; *************** *** 99,159 **** #define skipchar(ptr, ch) \ { \ ! if (*ptr != ch) { \ ! panic("expected char '%c', found '%s'", ch, ptr); \ ! } \ ! ++ptr; \ } #define optchar(ptr, ch) \ { \ ! if (*ptr == ch) { \ ! ++ptr; \ ! } \ } #ifdef sun # define chkcont(ptr) \ { \ ! if (*ptr == '\\' or *ptr == '?') { \ ! ptr = getcont(); \ ! } \ } #else if notsun # define chkcont(ptr) \ { \ ! if (*ptr == '?') { \ ! ptr = getcont(); \ ! } \ } #endif #define newSym(s, n) \ { \ ! s = insert(n); \ ! s->level = curblock->level + 1; \ ! s->language = curlang; \ ! s->block = curblock; \ } ! #define makeVariable(s, n, off) \ ! { \ ! newSym(s, n); \ ! s->class = VAR; \ ! s->symvalue.offset = off; \ ! getType(s); \ } #define makeParameter(s, n, st, cl, off) \ { \ ! newSym(s, n); \ ! s->storage = st; \ ! s->param = true; \ ! s->class = cl; \ ! s->symvalue.offset = off; \ ! curparam->chain = s; \ ! curparam = s; \ ! getType(s); \ } public entersym (name, np) --- 98,174 ---- #define skipchar(ptr, ch) \ { \ ! if (*ptr != ch) { \ ! panic("expected char '%c', found '%s'", ch, ptr); \ ! } \ ! ++ptr; \ } #define optchar(ptr, ch) \ { \ ! if (*ptr == ch) { \ ! ++ptr; \ ! } \ } #ifdef sun # define chkcont(ptr) \ { \ ! if (*ptr == '\\' or *ptr == '?') { \ ! ptr = getcont(); \ ! } \ } #else if notsun # define chkcont(ptr) \ { \ ! if (*ptr == '?') { \ ! ptr = getcont(); \ ! } \ } #endif #define newSym(s, n) \ { \ ! s = insert(n); \ ! s->level = curblock->level + 1; \ ! s->language = curlang; \ ! s->block = curblock; \ } ! #define makeVariable(s,n,off) dcl_var(&s,n,off) ! ! static void dcl_var(sym_p,n,off) ! Symbol *sym_p; ! Name n; ! Address off; ! { ! Symbol s; ! ! find(s, n) where ! s->block == curblock && s->class == VAR ! endfind(s); ! ! if ( !s ) ! s = insert(n); ! ! s->language = curlang; ! s->block = curblock; ! s->class = VAR; ! s->symvalue.offset = off; ! getType(s); ! *sym_p = s; } #define makeParameter(s, n, st, cl, off) \ { \ ! newSym(s, n); \ ! s->storage = st; \ ! s->param = true; \ ! s->class = cl; \ ! s->symvalue.offset = off; \ ! curparam->chain = s; \ ! curparam = s; \ ! getType(s); \ } public entersym (name, np) *************** *** 160,454 **** String name; struct nlist *np; { ! Symbol s; ! register char *p; ! register Name n; ! char c; ! p = index(name, ':'); ! *p = '\0'; ! c = *(p+1); ! if (autostrip && *name == '_' && strncmp(name, "_auto_", 6) == 0) { ! n = identname(&name[6], true); ! } else { ! n = identname(name, true); ! } ! chkUnnamedBlock(); ! curchar = p + 2; ! switch (c) { ! case CONSTNAME: ! newSym(s, n); ! constName(s); ! break; ! case TYPENAME: ! newSym(s, n); ! typeName(s); ! break; ! case TAGNAME: ! s = symbol_alloc(); ! s->name = n; ! s->level = curblock->level + 1; ! s->language = curlang; ! s->block = curblock; ! tagName(s); ! break; ! case MODULEBEGIN: ! publicRoutine(&s, n, MODULE, np->n_value, false); ! curmodule = s; ! break; ! case EXTPROCEDURE: ! publicRoutine(&s, n, PROC, np->n_value, false); ! break; ! case PRIVPROCEDURE: ! privateRoutine(&s, n, PROC, np->n_value); ! break; ! case INTPROCEDURE: ! publicRoutine(&s, n, PROC, np->n_value, true); ! break; ! case EXTFUNCTION: ! publicRoutine(&s, n, FUNC, np->n_value, false); ! break; ! case PRIVFUNCTION: ! privateRoutine(&s, n, FUNC, np->n_value); ! break; ! case INTFUNCTION: ! publicRoutine(&s, n, FUNC, np->n_value, true); ! break; ! case EXTVAR: ! extVar(&s, n, np->n_value); ! break; ! case MODULEVAR: ! if (curblock->class != MODULE) { ! exitblock(); ! } ! makeVariable(s, n, np->n_value); ! s->storage = EXT; ! s->level = program->level; ! s->block = curmodule; ! getExtRef(s); ! break; ! case OWNVAR: ! makeVariable(s, n, np->n_value); ! ownVariable(s, np->n_value); ! getExtRef(s); ! break; ! case REGVAR: ! makeVariable(s, n, np->n_value); ! s->storage = INREG; ! break; ! case FREGVAR: ! makeVariable(s, n, NREG + np->n_value); ! s->storage = INREG; ! break; ! case VALUEPARAM: ! makeParameter(s, n, STK, VAR, np->n_value); # ifdef IRIS ! /* ! * Bug in SGI C compiler -- generates stab offset ! * for parameters with size added in. ! */ ! if (curlang == findlanguage(".c")) { ! s->symvalue.offset -= size(s); ! } # endif ! break; ! case VARIABLEPARAM: ! makeParameter(s, n, STK, REF, np->n_value); ! break; ! case REGPARAM: ! makeParameter(s, n, INREG, VAR, np->n_value); ! break; ! case FREGPARAM: ! makeParameter(s, n, INREG, VAR, NREG + np->n_value); ! break; ! case REGVARPARAM: ! makeParameter(s, n, INREG, REF, np->n_value); ! break; ! default: /* local variable */ ! --curchar; ! makeVariable(s, n, np->n_value); ! s->storage = STK; ! break; ! } ! if (tracesyms) { ! printdecl(s); ! fflush(stdout); ! } } /* ! * Enter a named constant. ! */ private constName (s) Symbol s; { ! double d; ! char *p, buf[1000]; ! s->class = CONST; ! skipchar(curchar, '='); ! p = curchar; ! ++curchar; ! switch (*p) { ! case 'b': ! s->type = t_boolean; ! s->symvalue.constval = build(O_LCON, getint()); ! break; ! case 'c': ! s->type = t_char; ! s->symvalue.constval = build(O_LCON, getint()); ! break; ! case 'i': ! s->type = t_int; ! s->symvalue.constval = build(O_LCON, getint()); ! break; ! case 'r': ! sscanf(curchar, "%lf", &d); ! while (*curchar != '\0' and *curchar != ';') { ! ++curchar; ! } ! --curchar; ! s->type = t_real; ! s->symvalue.constval = build(O_FCON, d); ! break; ! case 's': ! p = &buf[0]; ! skipchar(curchar, '\''); ! while (*curchar != '\'') { ! *p = *curchar; ! ++p; ! ++curchar; ! } ! *p = '\0'; ! s->symvalue.constval = build(O_SCON, strdup(buf)); ! s->type = s->symvalue.constval->nodetype; ! break; ! case 'e': ! getType(s); ! skipchar(curchar, ','); ! s->symvalue.constval = build(O_LCON, getint()); ! break; ! case 'S': ! getType(s); ! skipchar(curchar, ','); ! getint(); /* set size */ ! skipchar(curchar, ','); ! getint(); /* number of bits in constant */ ! s->symvalue.constval = build(O_LCON, 0); ! break; ! default: ! s->type = t_int; ! s->symvalue.constval = build(O_LCON, 0); ! printf("[internal error: unknown constant type '%c']", *p); ! break; ! } ! s->symvalue.constval->nodetype = s->type; } /* ! * Enter a type name. ! */ private typeName (s) Symbol s; { ! register integer i; ! s->class = TYPE; ! s->language = curlang; ! s->block = curblock; ! s->level = curblock->level + 1; ! i = getint(); ! if (i == 0) { ! panic("bad input on type \"%s\" at \"%s\"", symname(s), curchar); ! } else if (i >= NTYPES) { ! panic("too many types in file \"%s\"", curfilename()); ! } ! /* ! * A hack for C typedefs that don't create new types, ! * e.g. typedef unsigned int Hashvalue; ! * or typedef struct blah BLAH; ! */ ! if (*curchar != '=') { ! s->type = typetable[i]; ! if (s->type == nil) { ! s->type = symbol_alloc(); ! typetable[i] = s->type; ! } ! } else { ! if (typetable[i] != nil) { ! typetable[i]->language = curlang; ! typetable[i]->class = TYPE; ! typetable[i]->type = s; ! } else { ! typetable[i] = s; ! } ! skipchar(curchar, '='); ! getType(s); ! } } /* ! * Enter a tag name. ! */ private tagName (s) Symbol s; { ! register integer i; ! s->class = TAG; ! i = getint(); ! if (i == 0) { ! panic("bad input on tag \"%s\" at \"%s\"", symname(s), curchar); ! } else if (i >= NTYPES) { ! panic("too many types in file \"%s\"", curfilename()); ! } ! if (typetable[i] != nil) { ! typetable[i]->language = curlang; ! typetable[i]->class = TYPE; ! typetable[i]->type = s; ! } else { ! typetable[i] = s; ! } ! skipchar(curchar, '='); ! getType(s); } /* ! * Setup a symbol entry for a public procedure or function. ! * ! * If it contains nested procedures, then it may already be defined ! * in the current block as a MODULE. ! */ private publicRoutine (s, n, class, addr, isinternal) Symbol *s; --- 175,469 ---- String name; struct nlist *np; { ! Symbol s; ! register char *p; ! register Name n; ! char c; ! p = index(name, ':'); ! *p = '\0'; ! c = *(p+1); ! if (autostrip && *name == '_' && strncmp(name, "_auto_", 6) == 0) { ! n = identname(&name[6], false); ! } else { ! n = identname(name, false); ! } ! chkUnnamedBlock(); ! curchar = p + 2; ! switch (c) { ! case CONSTNAME: ! newSym(s, n); ! constName(s); ! break; ! case TYPENAME: ! newSym(s, n); ! typeName(s); ! break; ! case TAGNAME: ! s = symbol_alloc(); ! s->name = n; ! s->level = curblock->level + 1; ! s->language = curlang; ! s->block = curblock; ! tagName(s); ! break; ! case MODULEBEGIN: ! publicRoutine(&s, n, MODULE, np->n_value, false); ! curmodule = s; ! break; ! case EXTPROCEDURE: ! publicRoutine(&s, n, PROC, np->n_value, false); ! break; ! case PRIVPROCEDURE: ! privateRoutine(&s, n, PROC, np->n_value); ! break; ! case INTPROCEDURE: ! publicRoutine(&s, n, PROC, np->n_value, true); ! break; ! case EXTFUNCTION: ! publicRoutine(&s, n, FUNC, np->n_value, false); ! break; ! case PRIVFUNCTION: ! privateRoutine(&s, n, FUNC, np->n_value); ! break; ! case INTFUNCTION: ! publicRoutine(&s, n, FUNC, np->n_value, true); ! break; ! case EXTVAR: ! extVar(&s, n, np->n_value); ! break; ! case MODULEVAR: ! if (curblock->class != MODULE) { ! exitblock(); ! } ! makeVariable(s, n, np->n_value); ! s->storage = EXT; ! s->level = program->level; ! s->block = curmodule; ! getExtRef(s); ! break; ! case OWNVAR: ! makeVariable(s, n, np->n_value); ! ownVariable(s, np->n_value); ! getExtRef(s); ! break; ! case REGVAR: ! makeVariable(s, n, np->n_value); ! s->storage = INREG; ! break; ! case FREGVAR: ! makeVariable(s, n, NREG + np->n_value); ! s->storage = INREG; ! break; ! case VALUEPARAM: ! makeParameter(s, n, STK, VAR, np->n_value); # ifdef IRIS ! /* ! * Bug in SGI C compiler -- generates stab offset ! * for parameters with size added in. ! */ ! if (curlang == findlanguage(".c")) { ! s->symvalue.offset -= size(s); ! } # endif ! break; ! case VARIABLEPARAM: ! makeParameter(s, n, STK, REF, np->n_value); ! break; ! case REGPARAM: ! makeParameter(s, n, INREG, VAR, np->n_value); ! break; ! case FREGPARAM: ! makeParameter(s, n, INREG, VAR, NREG + np->n_value); ! break; ! case REGVARPARAM: ! makeParameter(s, n, INREG, REF, np->n_value); ! break; ! default: /* local variable */ ! --curchar; ! makeVariable(s, n, np->n_value); ! s->storage = STK; ! break; } + if (tracesyms) { + printdecl(s); + fflush(stdout); + } + } /* ! * Enter a named constant. ! */ private constName (s) Symbol s; { ! double d; ! char *p, buf[1000]; ! s->class = CONST; ! skipchar(curchar, '='); ! p = curchar; ! ++curchar; ! switch (*p) { ! case 'b': ! s->type = t_boolean; ! s->symvalue.constval = build(O_LCON, getint()); ! break; ! case 'c': ! s->type = t_char; ! s->symvalue.constval = build(O_LCON, getint()); ! break; ! case 'i': ! s->type = t_int; ! s->symvalue.constval = build(O_LCON, getint()); ! break; ! case 'r': ! sscanf(curchar, "%lf", &d); ! while (*curchar != '\0' and *curchar != ';') { ! ++curchar; ! } ! --curchar; ! s->type = t_real; ! s->symvalue.constval = build(O_FCON, d); ! break; ! case 's': ! p = &buf[0]; ! skipchar(curchar, '\''); ! while (*curchar != '\'') { ! *p = *curchar; ! ++p; ! ++curchar; ! } ! *p = '\0'; ! s->symvalue.constval = build(O_SCON, strdup(buf)); ! s->type = s->symvalue.constval->nodetype; ! break; ! case 'e': ! getType(s); ! skipchar(curchar, ','); ! s->symvalue.constval = build(O_LCON, getint()); ! break; ! case 'S': ! getType(s); ! skipchar(curchar, ','); ! getint(); /* set size */ ! skipchar(curchar, ','); ! getint(); /* number of bits in constant */ ! s->symvalue.constval = build(O_LCON, 0); ! break; ! default: ! s->type = t_int; ! s->symvalue.constval = build(O_LCON, 0); ! printf("[internal error: unknown constant type '%c']", *p); ! break; } + s->symvalue.constval->nodetype = s->type; + } /* ! * Enter a type name. ! */ private typeName (s) Symbol s; { ! register integer i; ! s->class = TYPE; ! s->language = curlang; ! s->block = curblock; ! s->level = curblock->level + 1; ! i = getint(); ! if (i == 0) { ! panic("bad input on type \"%s\" at \"%s\"", symname(s), curchar); ! } else if (i >= NTYPES) { ! panic("too many types in file \"%s\"", curfilename()); } + /* + * A hack for C typedefs that don't create new types, + * e.g. typedef unsigned int Hashvalue; + * or typedef struct blah BLAH; + */ + if (*curchar != '=') { + s->type = typetable[i]; + if (s->type == nil) { + s->type = symbol_alloc(); + typetable[i] = s->type; + } + } else { + if (typetable[i] != nil) { + typetable[i]->language = curlang; + typetable[i]->class = TYPE; + typetable[i]->type = s; + } else { + typetable[i] = s; + } + skipchar(curchar, '='); + getType(s); + } + } /* ! * Enter a tag name. ! */ private tagName (s) Symbol s; { ! register integer i; ! s->class = TAG; ! i = getint(); ! if (i == 0) { ! panic("bad input on tag \"%s\" at \"%s\"", symname(s), curchar); ! } else if (i >= NTYPES) { ! panic("too many types in file \"%s\"", curfilename()); } + if (typetable[i] != nil) { + typetable[i]->language = curlang; + typetable[i]->class = TYPE; + typetable[i]->type = s; + } else { + typetable[i] = s; + } + skipchar(curchar, '='); + getType(s); + } /* ! * Setup a symbol entry for a public procedure or function. ! * ! * If it contains nested procedures, then it may already be defined ! * in the current block as a MODULE. ! */ private publicRoutine (s, n, class, addr, isinternal) Symbol *s; *************** *** 457,475 **** Address addr; boolean isinternal; { ! Symbol nt, t; ! newSym(nt, n); ! if (isinternal) { ! markInternal(nt); ! } ! enterRoutine(nt, class); ! find(t, n) where ! t != nt and t->class == MODULE and t->block == nt->block ! endfind(t); ! if (t == nil) { ! t = nt; ! } else { t->language = nt->language; t->class = nt->class; t->type = nt->type; --- 472,490 ---- Address addr; boolean isinternal; { ! Symbol nt, t; ! newSym(nt, n); ! if (isinternal) { ! markInternal(nt); ! } ! enterRoutine(nt, class); ! find(t, n) where ! t != nt and t->class == MODULE and t->block == nt->block ! endfind(t); ! if (t == nil) { ! t = nt; ! } else { t->language = nt->language; t->class = nt->class; t->type = nt->type; *************** *** 507,513 **** boolean isnew; find(t, n) where ! t->level == curmodule->level and t->class == class endfind(t); if (t == nil) { isnew = true; --- 522,528 ---- boolean isnew; find(t, n) where ! t->block == curmodule and t->class == class endfind(t); if (t == nil) { isnew = true; *************** *** 517,528 **** } t->language = curlang; enterRoutine(t, class); if (isnew) { t->symvalue.funcv.src = false; t->symvalue.funcv.inline = false; - t->symvalue.funcv.beginaddr = addr; - newfunc(t, codeloc(t)); - findbeginning(t); } *s = t; } --- 532,541 ---- } t->language = curlang; enterRoutine(t, class); + dataloc(t) = addr; if (isnew) { t->symvalue.funcv.src = false; t->symvalue.funcv.inline = false; } *s = t; } *************** *** 614,620 **** n = identname(curchar + 1, false); curchar = p + 1; } else { ! n = identname(curchar + 1, true); } t = insert(n); t->language = s->language; --- 627,633 ---- n = identname(curchar + 1, false); curchar = p + 1; } else { ! n = identname(curchar + 1, false); } t = insert(n); t->language = s->language; *************** *** 637,643 **** Name n; Symbol s; ! n = identname(id, true); find(s, n) where s->block == m and isblock(s) endfind(s); if (s == nil) { s = insert(n); --- 650,656 ---- Name n; Symbol s; ! n = identname(id, false); find(s, n) where s->block == m and isblock(s) endfind(s); if (s == nil) { s = insert(n); *************** *** 964,978 **** if (autostrip && *cur == '_') { for (tagname = cur + 1; ; tagname++) { if (*tagname == '_') { ! name = identname(tagname + 1, true); break; } else if (*tagname == '\0') { ! name = identname(cur, true); break; } } } else { ! name = identname(cur, true); } u->chain = newSymbol(name, d, FIELD, nil, nil); cur = p + 1; --- 977,991 ---- if (autostrip && *cur == '_') { for (tagname = cur + 1; ; tagname++) { if (*tagname == '_') { ! name = identname(tagname + 1, false); break; } else if (*tagname == '\0') { ! name = identname(cur, false); break; } } } else { ! name = identname(cur, false); } u->chain = newSymbol(name, d, FIELD, nil, nil); cur = p + 1; *************** *** 1012,1018 **** p = index(curchar, ':'); assert(p != nil); *p = '\0'; ! u->chain = insert(identname(curchar, true)); curchar = p + 1; u = u->chain; u->language = curlang; --- 1025,1031 ---- p = index(curchar, ':'); assert(p != nil); *p = '\0'; ! u->chain = insert(identname(curchar, false)); curchar = p + 1; u = u->chain; u->language = curlang; *************** *** 1109,1115 **** } def = (Boolean) (*p == ','); *p = '\0'; ! n = identname(curchar, true); find(s, n) where s->class == TYPEREF endfind(s); if (s == nil) { s = insert(n); --- 1122,1128 ---- } def = (Boolean) (*p == ','); *p = '\0'; ! n = identname(curchar, false); find(s, n) where s->class == TYPEREF endfind(s); if (s == nil) { s = insert(n); *** /usr/src/ucb/dbx/printsym.c Fri Dec 9 11:57:29 1988 --- printsym.c Thu Oct 12 14:37:21 1989 *************** *** 1,9 **** ! /* $Header:printsym.c 12.0$ */ ! /* $ACIS:printsym.c 12.0$ */ ! /* $Source: /ibm/acis/usr/src/ucb/dbx/RCS/printsym.c,v $ */ #ifndef lint ! static char *rcsid = "$Header:printsym.c 12.0$"; #endif /* Copyright (c) 1982 Regents of the University of California */ --- 1,8 ---- ! /* $Header: printsym.c,v 12.1 89/10/12 17:37:20 brunner Locked $ */ ! /* $Source: /fish/dbx/RCS/printsym.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: printsym.c,v 12.1 89/10/12 17:37:20 brunner Locked $"; #endif /* Copyright (c) 1982 Regents of the University of California */ *************** *** 27,34 **** #include "main.h" #include <ctype.h> ! #ifndef public ! #endif /* * Maximum number of arguments to a function. --- 26,34 ---- #include "main.h" #include <ctype.h> ! public boolean hexints = false; ! public boolean octints = false; ! public boolean expandunions = false; /* * Maximum number of arguments to a function. *************** *** 115,131 **** public printrtn (s) Symbol s; { ! register Symbol t; ! register int len; ! Boolean isindirect; printf("returning "); if (s->class == FUNC && (!istypename(s->type,"void"))) { len = size(s->type); if (canpush(len)) { ! t = rtype(s->type); ! isindirect = (Boolean) (t->class == RECORD or t->class == VARNT); ! pushretval(len, isindirect); printval(s->type); putchar(' '); } else { --- 115,127 ---- public printrtn (s) Symbol s; { ! int len; printf("returning "); if (s->class == FUNC && (!istypename(s->type,"void"))) { len = size(s->type); if (canpush(len)) { ! pushretval(s->type); printval(s->type); putchar(' '); } else { *************** *** 377,391 **** checkref(s); n = s->name; ! t = lookup(n); ! printwhich(f, t); ! t = t->next_sym; ! while (t != nil) { if (t->name == n) { putc(' ', f); - printwhich(f, t); } - t = t->next_sym; } putc('\n', f); } --- 373,383 ---- checkref(s); n = s->name; ! for ( t = lookup(n); t; t = t->next_sym ){ if (t->name == n) { + printwhich(f,t); putc(' ', f); } } putc('\n', f); } *************** *** 481,487 **** case PROG: case PROC: case FUNC: ! printf("address\t0x%x\n", s->symvalue.funcv.beginaddr); if (isinline(s)) { printf("inline procedure\n"); } --- 473,480 ---- case PROG: case PROC: case FUNC: ! printf("code address\t0x%x\n", codeloc(s)); ! printf("data address\t0x%x\n", dataloc(s)); if (isinline(s)) { printf("inline procedure\n"); } *************** *** 636,642 **** if (sp - elsize != newsp) { fputs(sep, stdout); } ! printval(eltype); } sp = newsp; if (streq(sep, "\n")) { --- 629,640 ---- if (sp - elsize != newsp) { fputs(sep, stdout); } ! if (expandunions && (a->type->type->class == VARNT)) ! { ! printunion(a->type->type); ! } ! else ! printval(eltype); } sp = newsp; if (streq(sep, "\n")) { *************** *** 726,731 **** --- 724,731 ---- } } else if (varIsSet("$hexints")) { printf("0x%lx", val); + } else if (octints) { + printf("0%lo", val); } else if (t->symvalue.rangev.lower >= 0) { printf("%lu", val); } else { *************** *** 749,755 **** e = e->chain; } if (e != nil) { ! printf("%s", symname(e)); } else { printf("%d", i); } --- 749,755 ---- e = e->chain; } if (e != nil) { ! printf("%s:%d", symname(e),i); } else { printf("%d", i); } *** /usr/src/ucb/dbx/operators.c Fri Dec 9 11:57:23 1988 --- operators.c Thu Oct 12 14:37:19 1989 *************** *** 1,9 **** ! /* $Header:operators.c 12.0$ */ ! /* $ACIS:operators.c 12.0$ */ ! /* $Source: /ibm/acis/usr/src/ucb/dbx/RCS/operators.c,v $ */ #ifndef lint ! static char *rcsid = "$Header:operators.c 12.0$"; #endif /* Copyright (c) 1982 Regents of the University of California */ --- 1,8 ---- ! /* $Header: operators.c,v 12.1 89/10/12 17:37:18 brunner Locked $ */ ! /* $Source: /fish/dbx/RCS/operators.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: operators.c,v 12.1 89/10/12 17:37:18 brunner Locked $"; #endif /* Copyright (c) 1982 Regents of the University of California */ *************** *** 41,58 **** O_CALL, /* call a procedure in the program */ O_CATCH, /* catch a signal before program does */ O_CHFILE, /* change (or print) the current source file */ O_CONT, /* continue execution */ O_DEBUG, /* invoke a dbx internal debugging routine */ O_DELETE, /* remove a trace/stop */ O_DUMP, /* dump out variables */ O_EDIT, /* edit a file (or function) */ O_FUNC, /* set the current function */ ! O_GRIPE, /* send mail to debugger support person */ O_HELP, /* print a synopsis of debugger commands */ O_IGNORE, /* let program catch signal */ O_LIST, /* list source lines */ O_PRINT, /* print the values of a list of expressions */ O_PSYM, /* print symbol information */ O_RUN, /* start up program */ O_SKIP, /* skip the current line */ O_SOURCE, /* read commands from a file */ --- 40,62 ---- O_CALL, /* call a procedure in the program */ O_CATCH, /* catch a signal before program does */ O_CHFILE, /* change (or print) the current source file */ + O_CLEAR, + O_CLEARI, O_CONT, /* continue execution */ O_DEBUG, /* invoke a dbx internal debugging routine */ + O_DELALL, O_DELETE, /* remove a trace/stop */ O_DUMP, /* dump out variables */ O_EDIT, /* edit a file (or function) */ O_FUNC, /* set the current function */ ! O_GOTO, O_HELP, /* print a synopsis of debugger commands */ O_IGNORE, /* let program catch signal */ O_LIST, /* list source lines */ + O_LISTI, /* list assembly code */ O_PRINT, /* print the values of a list of expressions */ O_PSYM, /* print symbol information */ + O_REGS, /* print register information */ O_RUN, /* start up program */ O_SKIP, /* skip the current line */ O_SOURCE, /* read commands from a file */ *************** *** 74,84 **** --- 78,90 ---- O_ONCE, /* add a "one-time" event, delete when first reached */ O_PRINTCALL, /* print out the current procedure and its arguments */ O_PRINTIFCHANGED, /* print the value of the argument if it has changed */ + O_PRINTIIFCHANGED, /* print the value of the argument if it has changed */ O_PRINTRTN, /* print out the routine and value that just returned */ O_PRINTSRCPOS, /* print out the current source position */ O_PROCRTN, /* call completed */ O_QLINE, /* filename, line number */ O_STOPIFCHANGED, /* stop if the value of the argument has changed */ + O_STOPIIFCHANGED, /* stop if the value of the argument has changed */ O_STOPX, /* stop execution */ O_TRACEON, /* begin tracing source line, variable, or all lines */ O_TRACEOFF, /* end tracing source line, variable, or all lines */ *************** *** 128,139 **** public Opinfo opinfo[] ={ /* O_NOP */ 0, null, 0, ! /* O_NAME */ -1, LEAF, 0, ! /* O_SYM */ -1, LEAF, 0, ! /* O_LCON */ -1, LEAF, 0, ! /* O_CCON */ -1, LEAF, 0, ! /* O_FCON */ -1, LEAF, 0, ! /* O_SCON */ -1, LEAF, 0, /* O_RVAL */ 1, UNARY, 0, /* O_INDEX */ 2, null, 0, /* O_INDIR */ 1, UNARY, "^", --- 134,145 ---- public Opinfo opinfo[] ={ /* O_NOP */ 0, null, 0, ! /* O_NAME */ 0, LEAF, 0, ! /* O_SYM */ 0, LEAF, 0, ! /* O_LCON */ 0, LEAF, 0, ! /* O_CCON */ 0, LEAF, 0, ! /* O_FCON */ 0, LEAF, 0, ! /* O_SCON */ 0, LEAF, 0, /* O_RVAL */ 1, UNARY, 0, /* O_INDEX */ 2, null, 0, /* O_INDIR */ 1, UNARY, "^", *************** *** 171,188 **** /* O_CALL */ 2, null, "call", /* O_CATCH */ 0, null, "catch", /* O_CHFILE */ 0, null, "file", /* O_CONT */ 0, null, "cont", /* O_DEBUG */ 0, null, "debug", /* O_DELETE */ 1, null, "delete", /* O_DUMP */ 1, null, "dump", /* O_EDIT */ 0, null, "edit", /* O_FUNC */ 1, null, "func", ! /* O_GRIPE */ 0, null, "gripe", ! /* O_HELP */ 0, null, "help", /* O_IGNORE */ 0, null, "ignore", /* O_LIST */ 2, null, "list", /* O_PRINT */ 1, null, "print", /* O_PSYM */ 1, null, "psym", /* O_RUN */ 0, null, "run", /* O_SKIP */ 0, null, "skip", /* O_SOURCE */ 0, null, "source", --- 177,199 ---- /* O_CALL */ 2, null, "call", /* O_CATCH */ 0, null, "catch", /* O_CHFILE */ 0, null, "file", + /* O_CLEAR */ 2, null, "clear", + /* O_CLEARI */ 1, null, "cleari", /* O_CONT */ 0, null, "cont", /* O_DEBUG */ 0, null, "debug", + /* O_DELALL */ 0, null, "delete all", /* O_DELETE */ 1, null, "delete", /* O_DUMP */ 1, null, "dump", /* O_EDIT */ 0, null, "edit", /* O_FUNC */ 1, null, "func", ! /* O_GOTO */ 1, null, "goto", ! /* O_HELP */ 1, null, "help", /* O_IGNORE */ 0, null, "ignore", + /* O_LISTI */ 2, null, "listi", /* O_LIST */ 2, null, "list", /* O_PRINT */ 1, null, "print", /* O_PSYM */ 1, null, "psym", + /* O_REGS */ 0, null, "registers", /* O_RUN */ 0, null, "run", /* O_SKIP */ 0, null, "skip", /* O_SOURCE */ 0, null, "source", *************** *** 204,214 **** --- 215,227 ---- /* O_ONCE */ 0, null, "once", /* O_PRINTCALL */ 1, null, "printcall", /* O_PRINTIFCHANGED */ 1, null, "printifchanged", + /* O_PRINTIIFCHANGED */ 1, null, "printiifchanged", /* O_PRINTRTN */ 1, null, "printrtn", /* O_PRINTSRCPOS */ 1, null, "printsrcpos", /* O_PROCRTN */ 1, null, "procrtn", /* O_QLINE */ 2, null, nil, /* O_STOPIFCHANGED */ 1, null, "stopifchanged", + /* O_STOPIIFCHANGED */ 1, null, "stopiifchanged", /* O_STOPX */ 0, null, "stop", /* O_TRACEON */ 1, null, "traceon", /* O_TRACEOFF */ 1, null, "traceoff", *** /usr/src/ucb/dbx/process.c Fri Dec 9 11:57:31 1988 --- process.c Thu Oct 12 14:37:22 1989 *************** *** 1,9 **** ! /* $Header:process.c 12.0$ */ ! /* $ACIS:process.c 12.0$ */ ! /* $Source: /ibm/acis/usr/src/ucb/dbx/RCS/process.c,v $ */ #ifndef lint ! static char *rcsid = "$Header:process.c 12.0$"; #endif /* Copyright (c) 1982 Regents of the University of California */ --- 1,8 ---- ! /* $Header: process.c,v 12.1 89/10/12 17:37:22 brunner Locked $ */ ! /* $Source: /fish/dbx/RCS/process.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: process.c,v 12.1 89/10/12 17:37:22 brunner Locked $"; #endif /* Copyright (c) 1982 Regents of the University of California */ *************** *** 47,52 **** --- 46,53 ---- * These definitions are for the arguments to "pio". */ + #define DATASTART 0x10000000 /* data segment start on the RT */ + typedef enum { PREAD, PWRITE } PioOp; typedef enum { TEXTSEG, DATASEG } PioSeg; *************** *** 468,482 **** private Word fetch(); private store(); ! public pio (p, op, seg, buff, addr, nbytes) Process p; PioOp op; - PioSeg seg; char *buff; Address addr; int nbytes; { register int i; register Address newaddr; register char *cp; char *bufend; --- 469,483 ---- private Word fetch(); private store(); ! public pio (p, op, buff, addr, nbytes) Process p; PioOp op; char *buff; Address addr; int nbytes; { register int i; + PioSeg seg; register Address newaddr; register char *cp; char *bufend; *************** *** 484,489 **** --- 485,492 ---- Address wordaddr; int byteoff; + seg = ( addr < DATASTART ) ? TEXTSEG : DATASEG; + if (p->status != STOPPED) { error("program is not active"); } *************** *** 558,563 **** --- 561,568 ---- register CacheWord *wp; register Word w; + w = errno = 0; + switch (seg) { case TEXTSEG: ++nfetchs; *************** *** 580,585 **** --- 585,595 ---- panic("fetch: bad seg %d", seg); /* NOTREACHED */ } + if ( w == -1 && errno != 0 && errno != ESRCH ) + error("read of process %s segment, address 0x%x failed. errno = %d\n", + ( (seg == DATASEG)?"data":"text"),addr,errno); + + return w; } *************** *** 595,601 **** --- 605,614 ---- Word data; { register CacheWord *wp; + int ret; + ret = errno = 0; + switch (seg) { case TEXTSEG: ++nwrites; *************** *** 602,612 **** wp = &p->word[cachehash(addr)]; wp->addr = addr; wp->val = data; ! ptrace(PT_WRITE_I, p->pid, addr, data); break; case DATASEG: ! ptrace(PT_WRITE_D, p->pid, addr, data); break; default: --- 615,625 ---- wp = &p->word[cachehash(addr)]; wp->addr = addr; wp->val = data; ! ret = ptrace(PT_WRITE_I, p->pid, addr, data); break; case DATASEG: ! ret = ptrace(PT_WRITE_D, p->pid, addr, data); break; default: *************** *** 613,618 **** --- 626,634 ---- panic("store: bad seg %d", seg); /* NOTREACHED */ } + if ( ret == -1 && errno != 0 && errno != ESRCH ) + printf("write to process %s segment, address = 0x%x failed. errno = %d\n", + ( (seg == TEXTSEG )?"text":"data"),addr,errno); } /* *** /usr/src/ucb/dbx/keywords.c Fri Dec 9 11:56:59 1988 --- keywords.c Thu Oct 12 14:37:07 1989 *************** *** 1,9 **** ! /* $Header:keywords.c 12.0$ */ ! /* $ACIS:keywords.c 12.0$ */ ! /* $Source: /ibm/acis/usr/src/ucb/dbx/RCS/keywords.c,v $ */ #ifndef lint ! static char *rcsid = "$Header:keywords.c 12.0$"; #endif /* Copyright (c) 1982 Regents of the University of California */ --- 1,8 ---- ! /* $Header: keywords.c,v 12.1 89/10/12 17:37:06 brunner Locked $ */ ! /* $Source: /fish/dbx/RCS/keywords.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: keywords.c,v 12.1 89/10/12 17:37:06 brunner Locked $"; #endif /* Copyright (c) 1982 Regents of the University of California */ *************** *** 21,26 **** --- 20,26 ---- #include "lists.h" #include "main.h" #include "y.tab.h" + #include "printsym.h" #ifndef public *************** *** 30,40 **** #endif private String reserved[] ={ ! "alias", "and", "assign", "at", "call", "catch", "cont", "debug", "delete", "div", "down", "dump", "edit", "file", "func", ! "gripe", "help", "if", "ignore", "in", ! "list", "mod", "next", "nexti", "nil", "not", "or", ! "print", "psym", "quit", "rerun", "return", "run", "set", "sh", "skip", "source", "status", "step", "stepi", "stop", "stopi", "trace", "tracei", "unalias", "unset", "up", "use", "whatis", "when", "where", "whereis", "which", --- 30,40 ---- #endif private String reserved[] ={ ! "alias", "all", "and", "assign", "at", "call", "catch", "clear", "cleari", "cont", "debug", "delete", "div", "down", "dump", "edit", "file", "func", ! "goto", "gotoi", "help", "if", "ignore", "in", ! "list", "listi","mod", "next", "nexti", "nil", "not", "or", ! "print", "psym", "quit", "registers", "rerun", "return", "run", "set", "sh", "skip", "source", "status", "step", "stepi", "stop", "stopi", "trace", "tracei", "unalias", "unset", "up", "use", "whatis", "when", "where", "whereis", "which", *************** *** 103,111 **** --- 103,113 ---- defalias("st", "stop"); defalias("j", "status"); defalias("t", "where"); + defalias("x", "registers"); if (vaddrs) { defvar(identname("$mapaddrs", true), nil); } + defvar(identname("$listwindow", true), build(O_LCON, (long) 10)); } /* *************** *** 412,417 **** --- 414,436 ---- if (n == identname("$mapaddrs", true)) { vaddrs = true; } + if (n == identname("$expandunions", true)) { + expandunions = true; + } + else if (n == identname("$hexints", true)) { + hexints = true; + if (octints) { + undefvar(identname("$octints",true)); + octints = false; + } + } + else if (n == identname("$octints", true)) { + octints = true; + if (hexints) { + undefvar(identname("$hexints",true)); + hexints = false; + } + } } } *************** *** 456,461 **** --- 475,486 ---- } if (n == identname("$mapaddrs", true)) { vaddrs = false; + } else if (n == identname("$hexints", true)) { + hexints = false; + } else if (n == identname("$octints", true)) { + octints = false; + } else if (n == identname("$expandunions", true)) { + expandunions = false; } } *** /usr/src/ucb/dbx/pascal.c Fri Dec 9 11:57:26 1988 --- pascal.c Thu Oct 12 14:37:20 1989 *************** *** 1,9 **** ! /* $Header:pascal.c 12.0$ */ ! /* $ACIS:pascal.c 12.0$ */ ! /* $Source: /ibm/acis/usr/src/ucb/dbx/RCS/pascal.c,v $ */ #ifndef lint ! static char *rcsid = "$Header:pascal.c 12.0$"; #endif /* Copyright (c) 1982 Regents of the University of California */ --- 1,8 ---- ! /* $Header: pascal.c,v 12.1 89/10/12 17:37:19 brunner Locked $ */ ! /* $Source: /fish/dbx/RCS/pascal.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: pascal.c,v 12.1 89/10/12 17:37:19 brunner Locked $"; #endif /* Copyright (c) 1982 Regents of the University of California */ *************** *** 22,31 **** #include "process.h" #include "runtime.h" #include "machine.h" - #ifndef public - #endif - private Language pasc; private boolean initialized; --- 21,28 ---- #include "process.h" #include "runtime.h" #include "machine.h" + #include "printsym.h" private Language pasc; private boolean initialized; *************** *** 82,88 **** boolean b; register Symbol rt1, rt2; ! if (t1->class == RANGE and t2->class == RANGE) { rt1 = rtype(t1->type); rt2 = rtype(t2->type); b = (boolean) (rt1->type == rt2->type); --- 79,88 ---- boolean b; register Symbol rt1, rt2; ! if (streq(t1->type->name->identifier,"short") && ! streq(t2->type->name->identifier,"$integer")) ! b = true; ! else if (t1->class == RANGE and t2->class == RANGE) { rt1 = rtype(t1->type); rt2 = rtype(t2->type); b = (boolean) (rt1->type == rt2->type); *************** *** 558,564 **** break; case VARNT: ! printf("[variant]"); break; case RANGE: --- 558,567 ---- break; case VARNT: ! if (expandunions) ! printunion(s); ! else ! printf("[variant]"); break; case RANGE: *************** *** 801,807 **** t = rtype(s); s = rtype(t->chain); findbounds(s, &lb, &ub); ! if (i < lb or i > ub) { error("subscript %d out of range [%d..%d]", i, lb, ub); } push(long, base + (i - lb) * size(t->type)); --- 804,810 ---- t = rtype(s); s = rtype(t->chain); findbounds(s, &lb, &ub); ! if ((i < lb or i > ub) && varIsSet("$unsafebounds")) { error("subscript %d out of range [%d..%d]", i, lb, ub); } push(long, base + (i - lb) * size(t->type)); *** /usr/src/ucb/dbx/fortran.c Fri Dec 9 11:56:57 1988 --- fortran.c Thu Oct 12 14:37:05 1989 *************** *** 1,9 **** ! /* $Header:fortran.c 12.0$ */ ! /* $ACIS:fortran.c 12.0$ */ ! /* $Source: /ibm/acis/usr/src/ucb/dbx/RCS/fortran.c,v $ */ #ifndef lint ! static char *rcsid = "$Header:fortran.c 12.0$"; #endif /* Copyright (c) 1982 Regents of the University of California */ --- 1,8 ---- ! /* $Header: fortran.c,v 12.1 89/10/12 17:37:04 brunner Locked $ */ ! /* $Source: /fish/dbx/RCS/fortran.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: fortran.c,v 12.1 89/10/12 17:37:04 brunner Locked $"; #endif /* Copyright (c) 1982 Regents of the University of California */ *************** *** 115,121 **** return(buf); } ! private Symbol mksubs (pbuf,st) Symbol st; char **pbuf; { --- 114,120 ---- return(buf); } ! private void mksubs (pbuf,st) Symbol st; char **pbuf; { *************** *** 362,370 **** if (t->type == t_int or istypename(t->type, "integer") or istypename(t->type,"integer*2") ) { ! printf("%ld", i); } else if (istypename(t->type, "addr")) { printf("0x%lx", i); } else { error("unknown type in fortran printint"); } --- 361,381 ---- if (t->type == t_int or istypename(t->type, "integer") or istypename(t->type,"integer*2") ) { ! if (hexints) ! printf("0x%lx", i); ! else if (octints) ! printf("0%lo", i); ! else ! printf("%ld", i); ! } else if (istypename(t->type, "short")) { ! printf("%d", i); } else if (istypename(t->type, "addr")) { printf("0x%lx", i); + } else if (istypename(t->type, "char")) { + if (varIsSet("$hexchars")) + printf("0x%lx", i); + else + printf("%c", i); } else { error("unknown type in fortran printint"); } *************** *** 499,505 **** ub = r->symvalue.rangev.upper; } ! if (i < lb or i > ub) { error("subscript out of range"); } push(long, base + (i - lb) * size(t->type)); --- 510,516 ---- ub = r->symvalue.rangev.upper; } ! if ( (i < lb or i > ub) && varIsSet("$unsafebounds") ){ error("subscript out of range"); } push(long, base + (i - lb) * size(t->type)); *** /usr/src/ucb/dbx/main.c Fri Dec 9 11:57:07 1988 --- main.c Thu Oct 12 14:37:11 1989 *************** *** 1,9 **** ! /* $Header:main.c 12.0$ */ ! /* $ACIS:main.c 12.0$ */ ! /* $Source: /ibm/acis/usr/src/ucb/dbx/RCS/main.c,v $ */ #ifndef lint ! static char *rcsid = "$Header:main.c 12.0$"; #endif /* Copyright (c) 1982 Regents of the University of California */ --- 1,8 ---- ! /* $Header: main.c,v 12.1 89/10/12 17:37:10 brunner Locked $ */ ! /* $Source: /fish/dbx/RCS/main.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: main.c,v 12.1 89/10/12 17:37:10 brunner Locked $"; #endif /* Copyright (c) 1982 Regents of the University of California */ *************** *** 164,181 **** readobj(objname); printf("\n"); fflush(stdout); ! if (coredump) { ! printf("[using memory image in %s]\n", corename); ! if (vaddrs) { ! coredump_getkerinfo(); ! } else if (badcore) { ! warning("%s does not match %s", corename, objname); } ! getsrcpos(); ! setcurfunc(whatblock(pc)); ! } else { ! setcurfunc(program); ! } bpinit(); f = fopen(initfile, "r"); if (f != nil) { --- 163,183 ---- readobj(objname); printf("\n"); fflush(stdout); ! ! if ( badcore ){ ! coredump = false; ! fprintf(stderr,"%s does not match %s\n",corename,objname); } ! ! if (coredump) { ! printf("[using memory image in %s]\n", corename); ! if (vaddrs) ! coredump_getkerinfo(); ! getsrcpos(); ! setcurfunc(whatblock(pc)); ! } ! else setcurfunc(program); ! bpinit(); f = fopen(initfile, "r"); if (f != nil) { *************** *** 264,269 **** --- 266,272 ---- public erecover() { + isstopped = true; if (initdone) { gobble(); longjmp(env, 1); *** /usr/src/ucb/dbx/Makefile Fri Dec 9 11:56:31 1988 --- Makefile Thu Oct 12 14:37:37 1989 *************** *** 3,11 **** # All rights reserved. The Berkeley Software License Agreement # specifies the terms and conditions for redistribution. # ! #$Header:Makefile 12.1$ ! #$ACIS:Makefile 12.1$ ! #$Source: /ibm/acis/usr/src/ucb/dbx/RCS/Makefile,v $ # # make file for debugger "dbx" # --- 3,10 ---- # All rights reserved. The Berkeley Software License Agreement # specifies the terms and conditions for redistribution. # ! #$Header: Makefile,v 12.1 89/10/12 17:37:36 brunner Locked $ ! #$Source: /fish/dbx/RCS/Makefile,v $ # # make file for debugger "dbx" # *************** *** 18,33 **** AOUT = tdbx DEST = ${DESTDIR}/usr/ucb/dbx ! CC = cc AS = as # # if you want gripes # CFLAGS = '-DMAINTAINER="linton@shasta"' # - CFLAGS = ! LD = cc LDFLAGS = LIBRARIES = -lm # -lPW for IRIS (System V) --- 17,32 ---- AOUT = tdbx DEST = ${DESTDIR}/usr/ucb/dbx ! CC = /bin/cc AS = as # # if you want gripes # CFLAGS = '-DMAINTAINER="linton@shasta"' # ! ! LD = $(CC) LDFLAGS = LIBRARIES = -lm # -lPW for IRIS (System V) *************** *** 81,86 **** --- 80,86 ---- stabstring.o \ symbols.o \ tree.o \ + help.o \ version.o HDR = \ *** /usr/src/ucb/dbx/examine.c Fri Dec 9 11:56:52 1988 --- examine.c Thu Oct 12 14:37:00 1989 *************** *** 1,9 **** ! /* $Header:examine.c 12.0$ */ ! /* $ACIS:examine.c 12.0$ */ ! /* $Source: /ibm/acis/usr/src/ucb/dbx/RCS/examine.c,v $ */ #ifndef lint ! static char *rcsid = "$Header:examine.c 12.0$"; #endif /* Copyright (c) 1982 Regents of the University of California */ --- 1,8 ---- ! /* $Header: examine.c,v 12.1 89/10/12 17:37:00 brunner Locked $ */ ! /* $Source: /fish/dbx/RCS/examine.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: examine.c,v 12.1 89/10/12 17:37:00 brunner Locked $"; #endif /* Copyright (c) 1982 Regents of the University of California */ *************** *** 382,392 **** register Address addr; register Lineno line; String filename; addr = nextaddr(pc, isnext); if (not inst_tracing and nlhdr.nlines != 0) { line = linelookup(addr); ! while (line == 0) { addr = nextaddr(addr, isnext); line = linelookup(addr); } --- 381,392 ---- register Address addr; register Lineno line; String filename; + Symbol s; addr = nextaddr(pc, isnext); if (not inst_tracing and nlhdr.nlines != 0) { line = linelookup(addr); ! while (line == 0 && (s = whatblock(addr)) && !nosource(s)) { addr = nextaddr(addr, isnext); line = linelookup(addr); } *** /usr/src/ucb/dbx/scanner.c Fri Dec 9 11:57:36 1988 --- scanner.c Thu Oct 12 14:37:25 1989 *************** *** 1,9 **** ! /* $Header:scanner.c 12.0$ */ ! /* $ACIS:scanner.c 12.0$ */ ! /* $Source: /ibm/acis/usr/src/ucb/dbx/RCS/scanner.c,v $ */ #ifndef lint ! static char *rcsid = "$Header:scanner.c 12.0$"; #endif /* Copyright (c) 1982 Regents of the University of California */ --- 1,8 ---- ! /* $Header: scanner.c,v 12.1 89/10/12 17:37:24 brunner Locked $ */ ! /* $Source: /fish/dbx/RCS/scanner.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: scanner.c,v 12.1 89/10/12 17:37:24 brunner Locked $"; #endif /* Copyright (c) 1982 Regents of the University of California */ *************** *** 152,159 **** ++curchar; switch (c) { case '\'': ! t = INT; ! yylval.y_int = charcon(curchar); curchar += 2; break; case '\n': --- 151,158 ---- ++curchar; switch (c) { case '\'': ! t = CHAR; ! yylval.y_char = charcon(curchar); curchar += 2; break; case '\n': *** /usr/src/ucb/dbx/source.c Fri Dec 9 11:57:39 1988 --- source.c Thu Oct 12 14:37:26 1989 *************** *** 1,9 **** ! /* $Header:source.c 12.0$ */ ! /* $ACIS:source.c 12.0$ */ ! /* $Source: /ibm/acis/usr/src/ucb/dbx/RCS/source.c,v $ */ #ifndef lint ! static char *rcsid = "$Header:source.c 12.0$"; #endif /* Copyright (c) 1982 Regents of the University of California */ --- 1,8 ---- ! /* $Header: source.c,v 12.1 89/10/12 17:37:26 brunner Locked $ */ ! /* $Source: /fish/dbx/RCS/source.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: source.c,v 12.1 89/10/12 17:37:26 brunner Locked $"; #endif /* Copyright (c) 1982 Regents of the University of California */ *************** *** 49,54 **** --- 48,54 ---- extern char *re_comp(); private Lineno lastlinenum; + public int inst_windowsize = 10; private String prevsource = nil; /* *** /usr/src/ucb/dbx/library.c Fri Dec 9 11:57:03 1988 --- library.c Thu Oct 12 14:37:09 1989 *************** *** 1,9 **** ! /* $Header:library.c 12.0$ */ ! /* $ACIS:library.c 12.0$ */ ! /* $Source: /ibm/acis/usr/src/ucb/dbx/RCS/library.c,v $ */ #ifndef lint ! static char *rcsid = "$Header:library.c 12.0$"; #endif /* Copyright (c) 1982 Regents of the University of California */ --- 1,8 ---- ! /* $Header: library.c,v 12.1 89/10/12 17:37:08 brunner Locked $ */ ! /* $Source: /fish/dbx/RCS/library.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: library.c,v 12.1 89/10/12 17:37:08 brunner Locked $"; #endif /* Copyright (c) 1982 Regents of the University of California */ *************** *** 750,755 **** --- 749,755 ---- sprintf(buf, "malloc failed: no space: file %s, line %d", f,l); panic(buf); } + bzero(cp,n); return(cp); } Eric Brunner, IBM AWD Palo Alto inet: brunner@monet.berkeley.edu or brunner%ibmsupt@uunet.uu.net uucp: uunet!ibmsupt!brunner (415) 855-4486