🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #436

Bug in 4.3BSD adb

#436
From: Head UNIX Hacquer
Date: Tue, 02 Dec 1986 20:03
55 lines
2099 bytes
Subject: Output of hex print mode is signed
Index:	/usr/src/bin/adb/output.c 4.3BSD

Description:
	When printing using the 'X' format, words with the high bit set are
	printed in the form of '-nnn'.  This is pretty useless for seeing
	which bits are really on, and signed hex output doesn't make much
	sense.
Repeat-By:
	adb your favorite a.out file and step through it with '/X'.
Fix:

*** output.r1.1.c	Tue Dec  2 13:52:15 1986
--- output.c	Tue Dec  2 13:47:29 1986
***************
*** 317,328 ****
  printdbl(lxy,fmat,base)
  L_INT lxy; char fmat; int base;
  #endif
  {	int digs[20]; int *dptr; char k;
  #ifndef MULD2
! 	register char *cp1;
! 	cp1=digs; if ((lxy&0xFFFF0000L)==0xFFFF0000L) {*cp1++='-'; lxy= -lxy;}
  	sprintf(cp1,base==16 ? "%x" : "%D",lxy);
  	cp1=digs; while (*digitptr++= *cp1++); --digitptr;
  #else
  	L_REAL f ,g; long q;
  #ifdef vax
--- 318,335 ----
  printdbl(lxy,fmat,base)
  L_INT lxy; char fmat; int base;
  #endif
  {	int digs[20]; int *dptr; char k;
  #ifndef MULD2
! 	register char *cp1 = digs;
! 
! 	IF base == 10
! 	THEN
! 		IF (lxy&0xFFFF0000L)==0xFFFF0000L
! 		THEN *cp1++='-'; lxy= -lxy;
! 		FI
! 	FI
  	sprintf(cp1,base==16 ? "%x" : "%D",lxy);
  	cp1=digs; while (*digitptr++= *cp1++); --digitptr;
  #else
  	L_REAL f ,g; long q;
  #ifdef vax

Comment:
	This code (adb in general) is REALLY UGLY!!!
-- 
Shouter-To-Dead-Parrots @ Univ. of Texas Computation Center; Austin, Texas  
	clyde@ngp.cc.utexas.edu; ...!ut-sally!ut-ngp!clyde
"It's a sort of a threat, you see.  I've never been very good at them
myself, but I've told they can be very effective."
Technical Details
Message-ID: <4376@ut-ngp.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!ut-ngp!clyde

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!ut-ngp!clyde
From: clyde@ut-ngp.UUCP (Head UNIX Hacquer)
Newsgroups: comp.bugs.4bsd
Subject: Bug in 4.3BSD adb
Message-ID: <4376@ut-ngp.UUCP>
Date: Tue, 2-Dec-86 15:03:04 EST
Article-I.D.: ut-ngp.4376
Posted: Tue Dec  2 15:03:04 1986
Date-Received: Tue, 2-Dec-86 22:04:29 EST
Organization: Moose & Squirrel Software
Lines: 55
Keywords: adb bug