Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!watmath!clyde!rutgers!im4u!ut-sally!pyramid!voder!jeff
From: jeff@voder.UUCP
Newsgroups: comp.bugs.4bsd
Subject: adb may print addresses twice +FIX
Message-ID: <2820@voder.UUCP>
Date: Wed, 10-Dec-86 20:07:01 EST
Article-I.D.: voder.2820
Posted: Wed Dec 10 20:07:01 1986
Date-Received: Sun, 14-Dec-86 08:33:08 EST
Organization: National Semiconductor, Santa Clara
Lines: 73

Index:	bin/adb/format.c 4.3BSD

Description:
	When using the 'a' format character (e.g. main,5?ai) the address
	will be printed twice on the first line.
Repeat-By:
	adb /vmunix
	start,5?ai
	$q
Fix:
	The following patch is something of a kludge, fixing the most
	common case (?ai), but breaking the uncommon case (?ia).

	RCS file: RCS/format.c,v
	retrieving revision 1.1
	retrieving revision 1.2
	diff -c -r1.1 -r1.2
	*** /tmp/,RCSt1017123	Wed Dec 10 17:05:28 1986
	--- /tmp/,RCSt2017123	Wed Dec 10 17:05:29 1986
	***************
	*** 45,53 ****
	  
		WHILE icount
		DO  fp=ifp;
	! 	    savdot=dot; init=0;
	  
	! 	    IF init==0 ANDF (exact=(findsym(dot,ptype)==0)) ANDF maxoff
		    THEN printf("\n%s:%16t",cursym->n_un.n_name);
		    FI
	  
	--- 45,53 ----
	  
		WHILE icount
		DO  fp=ifp;
	! 	    savdot=dot;
	  
	! 	    IF (exact=(findsym(dot,ptype)==0)) ANDF init==0 ANDF maxoff
		    THEN printf("\n%s:%16t",cursym->n_un.n_name);
		    FI
	  
	***************
	*** 65,71 ****
			FI
	  
			IF *fp==0 THEN break; FI
	! 		IF exact ANDF dot==savdot ANDF itype==ISP ANDF cursym->n_un.n_name[0]=='_' ANDF *fp=='i'
			THEN exform(1,"x",itype,ptype); fp++; printc(EOR); /* entry mask */
			ELSE fp=exform(fcount,fp,itype,ptype);
			FI
	--- 65,74 ----
			FI
	  
			IF *fp==0 THEN break; FI
	! 		IF init ANDF *fp=='a'
	! 		THEN fp++;
	! 			init=0;
	! 		ELIF exact ANDF dot==savdot ANDF itype==ISP ANDF cursym->n_un.n_name[0]=='_' ANDF *fp=='i'
			THEN exform(1,"x",itype,ptype); fp++; printc(EOR); /* entry mask */
			ELSE fp=exform(fcount,fp,itype,ptype);
			FI
	***************
	*** 83,88 ****
	--- 86,92 ----
		    THEN dot=inkdot(dotinc);
		    FI
		    IF mkfault THEN error(0); FI
	+ 	    init=0;
		OD
	  }
	  
-- 

Jeff Gilliam	{ucbvax,pyramid,nsc}!voder!jeff