From 28c97a66179319e0054ea5afe84be7a0275f0496 Mon Sep 17 00:00:00 2001 From: "Robert R. Henry" Date: Tue, 17 Aug 1982 20:26:40 -0800 Subject: [PATCH] Changed the data types for the sdb class characters to be unsigned characters; this fixed a bug that prevented the arguments to a function from being printed symbolically. The fix was done globally; it is not known if the "fix" fixed other bugs SCCS-vsn: old/sdb/access.c 4.2 SCCS-vsn: old/sdb/decode.c 4.2 SCCS-vsn: old/sdb/display.c 4.3 SCCS-vsn: old/sdb/docomm.c 4.2 SCCS-vsn: old/sdb/fio.c 4.2 SCCS-vsn: old/sdb/main.c 4.2 SCCS-vsn: old/sdb/message.c 4.2 SCCS-vsn: old/sdb/old.c 4.2 SCCS-vsn: old/sdb/pcs.c 4.2 SCCS-vsn: old/sdb/prvar.c 4.3 SCCS-vsn: old/sdb/rdwr.c 4.2 SCCS-vsn: old/sdb/re.c 4.2 SCCS-vsn: old/sdb/runpcs.c 4.2 SCCS-vsn: old/sdb/setup.c 4.3 SCCS-vsn: old/sdb/sub.c 4.2 SCCS-vsn: old/sdb/symt.c 4.3 SCCS-vsn: old/sdb/udef.c 4.2 SCCS-vsn: old/sdb/version.c 4.2 SCCS-vsn: old/sdb/xeq.c 4.3 SCCS-vsn: old/sdb/cdefs.h 4.2 SCCS-vsn: old/sdb/defs.h 4.2 SCCS-vsn: old/sdb/head.h 4.3 SCCS-vsn: old/sdb/mac.h 4.2 SCCS-vsn: old/sdb/machine.h 4.2 SCCS-vsn: old/sdb/mode.h 4.2 SCCS-vsn: old/sdb/old.h 4.2 --- usr/src/old/sdb/access.c | 2 +- usr/src/old/sdb/cdefs.h | 2 +- usr/src/old/sdb/decode.c | 2 +- usr/src/old/sdb/defs.h | 2 +- usr/src/old/sdb/display.c | 9 ++++----- usr/src/old/sdb/docomm.c | 2 +- usr/src/old/sdb/fio.c | 2 +- usr/src/old/sdb/head.h | 6 +++--- usr/src/old/sdb/mac.h | 2 +- usr/src/old/sdb/machine.h | 2 +- usr/src/old/sdb/main.c | 2 +- usr/src/old/sdb/message.c | 2 +- usr/src/old/sdb/mode.h | 2 +- usr/src/old/sdb/old.c | 2 +- usr/src/old/sdb/old.h | 2 +- usr/src/old/sdb/pcs.c | 2 +- usr/src/old/sdb/prvar.c | 10 +++++++--- usr/src/old/sdb/rdwr.c | 2 +- usr/src/old/sdb/re.c | 2 +- usr/src/old/sdb/runpcs.c | 2 +- usr/src/old/sdb/setup.c | 2 +- usr/src/old/sdb/sub.c | 3 ++- usr/src/old/sdb/symt.c | 18 +++++++++--------- usr/src/old/sdb/udef.c | 2 +- usr/src/old/sdb/version.c | 2 +- usr/src/old/sdb/xeq.c | 2 +- 26 files changed, 46 insertions(+), 42 deletions(-) diff --git a/usr/src/old/sdb/access.c b/usr/src/old/sdb/access.c index 6b72a122c0..062f8f10c3 100644 --- a/usr/src/old/sdb/access.c +++ b/usr/src/old/sdb/access.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)access.c 4.1 %G%"; +static char sccsid[] = "@(#)access.c 4.2 %G%"; # /* * diff --git a/usr/src/old/sdb/cdefs.h b/usr/src/old/sdb/cdefs.h index aeb856f9be..bb4b7bff1e 100644 --- a/usr/src/old/sdb/cdefs.h +++ b/usr/src/old/sdb/cdefs.h @@ -1,4 +1,4 @@ -/* "@(#)cdefs.h 4.1 %G%" */ +/* "@(#)cdefs.h 4.2 %G%" */ /* type modifiers */ # define PTR 020 diff --git a/usr/src/old/sdb/decode.c b/usr/src/old/sdb/decode.c index db0f39d7c3..787c4985b0 100644 --- a/usr/src/old/sdb/decode.c +++ b/usr/src/old/sdb/decode.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)decode.c 4.1 %G%"; +static char sccsid[] = "@(#)decode.c 4.2 %G%"; #include "head.h" /* decode() - read a line from standard input and decode it */ diff --git a/usr/src/old/sdb/defs.h b/usr/src/old/sdb/defs.h index 7597832f59..4a95220b2b 100644 --- a/usr/src/old/sdb/defs.h +++ b/usr/src/old/sdb/defs.h @@ -1,4 +1,4 @@ -/* "@(#)defs.h 4.1 %G%" */ +/* "@(#)defs.h 4.2 %G%" */ # /* * diff --git a/usr/src/old/sdb/display.c b/usr/src/old/sdb/display.c index ef6f9f03d6..8caedc74b3 100644 --- a/usr/src/old/sdb/display.c +++ b/usr/src/old/sdb/display.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)display.c 4.2 %G%"; +static char sccsid[] = "@(#)display.c 4.3 %G%"; #include "head.h" #include #include @@ -44,7 +44,7 @@ nextframe() { /* MACHINE DEPENDENT */ ADDR formaddr(class, addr) -register char class; +u_char class; ADDR addr; { if (debug) printf("formaddr(%o, %d)\n", class & 0377, addr); switch(class & STABMASK) { @@ -363,7 +363,7 @@ prbkpt() { idbkpt() { register BKPTR bkptr; register int yesflg, cnt; - register char c; + char c; cnt = 0; @@ -415,7 +415,7 @@ prframe() { prfrx(top) { int narg; long offset; - register char class; + u_char class; register int endflg; char *p; struct proct *procp; @@ -466,7 +466,6 @@ prfrx(top) { } } } - narg = get(argp, DSP); if (narg & ~0xff) narg = 0; argp += WORDSIZE; diff --git a/usr/src/old/sdb/docomm.c b/usr/src/old/sdb/docomm.c index 33cd469cc7..cb42c50365 100644 --- a/usr/src/old/sdb/docomm.c +++ b/usr/src/old/sdb/docomm.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)docomm.c 4.1 %G%"; +static char sccsid[] = "@(#)docomm.c 4.2 %G%"; #include #include "head.h" #include diff --git a/usr/src/old/sdb/fio.c b/usr/src/old/sdb/fio.c index 4b59a3d475..8dab0686ee 100644 --- a/usr/src/old/sdb/fio.c +++ b/usr/src/old/sdb/fio.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)fio.c 4.1 %G%"; +static char sccsid[] = "@(#)fio.c 4.2 %G%"; /* * sdb - a symbolic debugger for unix - source file access routines. */ diff --git a/usr/src/old/sdb/head.h b/usr/src/old/sdb/head.h index 29f2396799..6b6098bede 100644 --- a/usr/src/old/sdb/head.h +++ b/usr/src/old/sdb/head.h @@ -1,4 +1,4 @@ -/* "@(#)head.h 4.2 %G%" */ +/* "@(#)head.h 4.3 %G%" */ #include #define PAGSIZ (CLSIZE*NBPG) #include @@ -41,7 +41,7 @@ char sl_name[8]; #else char *sl_name; #endif -char sl_class; +u_char sl_class; short sl_type; int sl_size, sl_addr; int subflag; @@ -68,7 +68,7 @@ ADDR callpc, frame, argp; /* current stack frame */ char odesc[10]; /* descriptor of last displayed variable */ ADDR oaddr; /* address of last displayed variable */ char otype; /* type of last displayed variable */ -char oclass; /* class of last displayed variable */ +u_char oclass; /* class of last displayed variable */ char oincr; /* size of last displayed variable */ struct sgttyb sdbttym, userttym; /* tty modes for sdb and user */ diff --git a/usr/src/old/sdb/mac.h b/usr/src/old/sdb/mac.h index f12045f31b..07e3ca84d6 100644 --- a/usr/src/old/sdb/mac.h +++ b/usr/src/old/sdb/mac.h @@ -1,4 +1,4 @@ -/* "@(#)mac.h 4.1 %G%" */ +/* "@(#)mac.h 4.2 %G%" */ # /* * UNIX debugger diff --git a/usr/src/old/sdb/machine.h b/usr/src/old/sdb/machine.h index fddaedac0d..0dd1b45b5c 100644 --- a/usr/src/old/sdb/machine.h +++ b/usr/src/old/sdb/machine.h @@ -1,4 +1,4 @@ -/* "@(#)machine.h 4.1 %G%" */ +/* "@(#)machine.h 4.2 %G%" */ /* * UNIX/vax debugger */ diff --git a/usr/src/old/sdb/main.c b/usr/src/old/sdb/main.c index 8e66d83707..293a86a4fd 100644 --- a/usr/src/old/sdb/main.c +++ b/usr/src/old/sdb/main.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)main.c 4.1 %G%"; +static char sccsid[] = "@(#)main.c 4.2 %G%"; # /* * diff --git a/usr/src/old/sdb/message.c b/usr/src/old/sdb/message.c index 300e8e3420..9017aa14f1 100644 --- a/usr/src/old/sdb/message.c +++ b/usr/src/old/sdb/message.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)message.c 4.1 %G%"; +static char sccsid[] = "@(#)message.c 4.2 %G%"; # /* * diff --git a/usr/src/old/sdb/mode.h b/usr/src/old/sdb/mode.h index f2c0f20f9f..3946169416 100644 --- a/usr/src/old/sdb/mode.h +++ b/usr/src/old/sdb/mode.h @@ -1,4 +1,4 @@ -/* "@(#)mode.h 4.1 %G%" */ +/* "@(#)mode.h 4.2 %G%" */ #include "machine.h" /* * UNIX debugger diff --git a/usr/src/old/sdb/old.c b/usr/src/old/sdb/old.c index 7458fa82d1..5c182479d7 100644 --- a/usr/src/old/sdb/old.c +++ b/usr/src/old/sdb/old.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)old.c 4.1 %G%"; +static char sccsid[] = "@(#)old.c 4.2 %G%"; /* * sdb - a symbolic debugger for UNIX. */ diff --git a/usr/src/old/sdb/old.h b/usr/src/old/sdb/old.h index 2af37e1590..be2879a003 100644 --- a/usr/src/old/sdb/old.h +++ b/usr/src/old/sdb/old.h @@ -1,4 +1,4 @@ -/* "@(#)old.h 4.1 %G%" */ +/* "@(#)old.h 4.2 %G%" */ #ifndef VMUNIX struct brbuf { int nl, nr; diff --git a/usr/src/old/sdb/pcs.c b/usr/src/old/sdb/pcs.c index a729d2f8f6..10b8f5549d 100644 --- a/usr/src/old/sdb/pcs.c +++ b/usr/src/old/sdb/pcs.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)pcs.c 4.1 %G%"; +static char sccsid[] = "@(#)pcs.c 4.2 %G%"; # /* * diff --git a/usr/src/old/sdb/prvar.c b/usr/src/old/sdb/prvar.c index cd99ab00c0..c99d1fcefa 100644 --- a/usr/src/old/sdb/prvar.c +++ b/usr/src/old/sdb/prvar.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)prvar.c 4.2 %G%"; +static char sccsid[] = "@(#)prvar.c 4.3 %G%"; #include "head.h" #include #include @@ -26,7 +26,7 @@ STRING errflg; */ outvar(proc, var, fmt, metaflag, addr, class, subflag, prnamep, comblk, prvar) -ADDR addr; char *proc, *var, *fmt, *prnamep, *comblk; int class; { +ADDR addr; char *proc, *var, *fmt, *prnamep, *comblk; u_char class; { char *p, *q, *r, *oldpr; register int match; long soffset, goffset; @@ -225,6 +225,7 @@ prdebug() { * type == 1 => use addr for value to print */ dispf(addr, desc, class, type, size, subflag, space) +u_char class; char *desc; short type; ADDR addr; { dispx(addr, desc, class, type, size, subflag, DSP); printf("\n"); @@ -233,6 +234,7 @@ char *desc; short type; ADDR addr; { /* display addr in instruction space using format desc or class s */ /* returns -1 if bad address */ dispi(addr, desc, class, type, size, subflag, space) +u_char class; char *desc; short type; ADDR addr; { register i; i = dispx(addr, desc, class, type, size, subflag, ISP); @@ -242,6 +244,7 @@ char *desc; short type; ADDR addr; { char pd[3]; dispx(addr, desc, class, type, size, subflag, space) +u_char class; char *desc; short type; ADDR addr; { int i, sflag; char *p; @@ -382,7 +385,7 @@ char *desc; short type; ADDR addr; { case 'g': dbl.ww.w1 = value; - dbl.ww.w2 = (class == (char) N_RSYM) ? + dbl.ww.w2 = (class == N_RSYM) ? *(ADDR *)(((ADDR) &u)+R0+(WORDSIZE)*(addr+1)) : getval(addr+WORDSIZE, 'd', space); printf("%.13g", dbl.d); @@ -441,6 +444,7 @@ char *desc; short type; ADDR addr; { /* print variable as in prvar */ printit(metaflag, prvar, addr, desc, class, type, size, subflag, space) +u_char class; char *desc; short type; ADDR addr; { if (prvar == 0) return; diff --git a/usr/src/old/sdb/rdwr.c b/usr/src/old/sdb/rdwr.c index 5f5457e04f..ba17df412a 100644 --- a/usr/src/old/sdb/rdwr.c +++ b/usr/src/old/sdb/rdwr.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)rdwr.c 4.1 %G%"; +static char sccsid[] = "@(#)rdwr.c 4.2 %G%"; /* * sdb - a symbolic debugger for unix - source file access routines. */ diff --git a/usr/src/old/sdb/re.c b/usr/src/old/sdb/re.c index a7c48e398f..f7db9030b2 100644 --- a/usr/src/old/sdb/re.c +++ b/usr/src/old/sdb/re.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)re.c 4.1 %G%"; +static char sccsid[] = "@(#)re.c 4.2 %G%"; #include "head.h" #define CBRA 1 #define CCHR 2 diff --git a/usr/src/old/sdb/runpcs.c b/usr/src/old/sdb/runpcs.c index c677148ab6..bb57ff7780 100644 --- a/usr/src/old/sdb/runpcs.c +++ b/usr/src/old/sdb/runpcs.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)runpcs.c 4.1 %G%"; +static char sccsid[] = "@(#)runpcs.c 4.2 %G%"; # /* * diff --git a/usr/src/old/sdb/setup.c b/usr/src/old/sdb/setup.c index ccc6647d0b..a1c800026a 100644 --- a/usr/src/old/sdb/setup.c +++ b/usr/src/old/sdb/setup.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)setup.c 4.2 %G%"; +static char sccsid[] = "@(#)setup.c 4.3 %G%"; # /* * diff --git a/usr/src/old/sdb/sub.c b/usr/src/old/sdb/sub.c index 8f7a2008e4..9a65f49a4c 100644 --- a/usr/src/old/sdb/sub.c +++ b/usr/src/old/sdb/sub.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)sub.c 4.1 %G%"; +static char sccsid[] = "@(#)sub.c 4.2 %G%"; #include "head.h" #include #include @@ -204,6 +204,7 @@ char *pat, *str; { /* gets indirect address for pointers and subscripts */ getindir(class, addr, type) +u_char class; ADDR addr; { if (ISARY(type)) return(addr); if (class == N_RSYM) diff --git a/usr/src/old/sdb/symt.c b/usr/src/old/sdb/symt.c index 5793a6eaa8..b8a2a6ff84 100644 --- a/usr/src/old/sdb/symt.c +++ b/usr/src/old/sdb/symt.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)symt.c 4.2 %G%"; +static char sccsid[] = "@(#)symt.c 4.3 %G%"; #include "head.h" #include #include @@ -58,7 +58,7 @@ initfp() { long soffset; int i, gflag = 0; - char class; + u_char class; register char *p, *q; #ifdef FLEXNAMES @@ -151,8 +151,7 @@ initfp() { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) error("Bad N_SO entry (1)"); - if ((stentry.n_type & STABMASK) != - (unsigned char) class) + if ((stentry.n_type & STABMASK) != class) error("Bad N_SO entry (2)"); soffset += sizeof stentry; } @@ -299,7 +298,8 @@ slooknext(pat, poffset, stelt, comblk) long poffset; char *pat, *comblk; { register int i; register long offset; - char class, *q; + char *q; + u_char class; struct nlist stentry; struct proct *procp, *p; @@ -411,7 +411,8 @@ globallookup(pat, filestart, stelt) char *pat; long filestart; { register int offset, i; struct nlist stentry; - int class, clevel; + int clevel; + u_char class; if (debug) printf("globallookup(%s,%d)\n", pat,filestart); blseek(&sbuf, filestart, 0); @@ -700,8 +701,7 @@ long offset; char *file; { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) error("Bad N_SO entry (1)"); - if ((stentry.n_type & STABMASK) != - (unsigned char) N_SOL) + if ((stentry.n_type & STABMASK) != (u_char)N_SOL) error("Bad N_SO entry (2)"); } #else @@ -838,7 +838,7 @@ long offset; { char pctypes[] = {N_GSYM, N_STSYM, N_LCSYM, N_RSYM, N_SSYM, N_LSYM, N_PSYM, 0}; varclass(class) -char class; { +u_char class; { char *p; for (p=pctypes; *p; p++) { diff --git a/usr/src/old/sdb/udef.c b/usr/src/old/sdb/udef.c index 42f4f6b3db..fe8710738c 100644 --- a/usr/src/old/sdb/udef.c +++ b/usr/src/old/sdb/udef.c @@ -1,3 +1,3 @@ -static char sccsid[] = "@(#)udef.c 4.1 %G%"; +static char sccsid[] = "@(#)udef.c 4.2 %G%"; #include char u[ctob(UPAGES)]; /* struct user u */ diff --git a/usr/src/old/sdb/version.c b/usr/src/old/sdb/version.c index 91c30ba7ec..1dfe77af46 100644 --- a/usr/src/old/sdb/version.c +++ b/usr/src/old/sdb/version.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)version.c 4.1 %G%"; +static char sccsid[] = "@(#)version.c 4.2 %G%"; version() { error("Version 2.6 - February 1, 1980"); } diff --git a/usr/src/old/sdb/xeq.c b/usr/src/old/sdb/xeq.c index ae89eebbc8..1f7e232f10 100644 --- a/usr/src/old/sdb/xeq.c +++ b/usr/src/old/sdb/xeq.c @@ -1,4 +1,4 @@ -static char sccsid[] = "@(#)xeq.c 4.2 %G%"; +static char sccsid[] = "@(#)xeq.c 4.3 %G%"; #include "head.h" #include #include -- 2.20.1