From charnier@xp11.frmug.org  Wed Apr 23 10:26:31 1997
Received: from who.cdrom.com (who.cdrom.com [204.216.27.3])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id KAA11312
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Apr 1997 10:26:31 -0700 (PDT)
Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252])
          by who.cdrom.com (8.8.5/8.6.11) with ESMTP id KAA20994
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Apr 1997 10:26:20 -0700 (PDT)
Received: (from uucp@localhost)
	by frmug.org (8.8.5/8.8.5/frmug-2.0) with UUCP id WAA23787
	for FreeBSD-gnats-submit@freebsd.org; Tue, 22 Apr 1997 22:41:01 +0200 (MET DST)
Received: (from charnier@localhost)
	by xp11.frmug.org (8.8.5/8.8.5/xp11-uucp-1.1) id WAA07143;
	Tue, 22 Apr 1997 22:33:57 +0200 (CEST)
Message-Id: <199704222033.WAA07143@xp11.frmug.org>
Date: Tue, 22 Apr 1997 22:33:57 +0200 (CEST)
From: Philippe Charnier <charnier@xp11.frmug.org>
Reply-To: charnier@xp11.frmug.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: incorrect output from kdump
X-Send-Pr-Version: 3.2

>Number:         3376
>Category:       bin
>Synopsis:       incorrect output from kdump
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 23 10:30:02 PDT 1997
>Closed-Date:    Wed May 21 23:20:36 PDT 1997
>Last-Modified:  Wed May 21 23:22:36 PDT 1997
>Originator:     Philippe Charnier
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

	

>Description:

When running kdump, I found:
       "i"
  4848 ksh      RET   read 1
  4848 ksh      CALL  read(0,0x3498c,0x1)
  4848 ksh      GIO   fd 0 read 1 bytes
       "t"
  4848 ksh      RET   read 1
  4848 ksh      CALL  read(0,0x3498c,0x1)
  4848 ksh      GIO   fd 0 read 1 bytes            <-- should be '1 byte'
       "                                           <-- \n should be printed
       "
  4848 ksh      RET   read 1

>How-To-Repeat:

$ ktrace /usr/local/bin/ksh 
$ exit
$ 

>Fix:
	

Index: kdump.c
===================================================================
RCS file: /home2h/FreeBSD.cvsroot/src/usr.bin/kdump/kdump.c,v
retrieving revision 1.9
diff -u -r1.9 kdump.c
--- kdump.c	1997/03/29 04:30:10	1.9
+++ kdump.c	1997/04/22 20:21:27
@@ -368,14 +368,15 @@
 		else
 			screenwidth = 80;
 	}
-	printf("fd %d %s %d bytes\n", ktr->ktr_fd,
-		ktr->ktr_rw == UIO_READ ? "read" : "wrote", datalen);
+	printf("fd %d %s %d byte%s\n", ktr->ktr_fd,
+		ktr->ktr_rw == UIO_READ ? "read" : "wrote", datalen,
+		datalen == 1 ? "" : "s");
 	if (maxdata && datalen > maxdata)
 		datalen = maxdata;
 	(void)printf("       \"");
 	col = 8;
 	for (;datalen > 0; datalen--, dp++) {
-		(void) vis(visbuf, *dp, VIS_CSTYLE, *(dp+1));
+		(void) vis(visbuf, *dp, VIS_CSTYLE|VIS_NL, *(dp+1));
 		cp = visbuf;
 		/*
 		 * Keep track of printables and
>Release-Note:
>Audit-Trail:

From: j@uriah.heep.sax.de (J Wunsch)
To: charnier@xp11.frmug.org
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/3376: incorrect output from kdump
Date: Wed, 23 Apr 1997 20:28:41 +0200

 As Philippe Charnier wrote:
 
 > When running kdump, I found:
 >        "i"
 >   4848 ksh      RET   read 1
 >   4848 ksh      CALL  read(0,0x3498c,0x1)
 >   4848 ksh      GIO   fd 0 read 1 bytes
 >        "t"
 >   4848 ksh      RET   read 1
 >   4848 ksh      CALL  read(0,0x3498c,0x1)
 >   4848 ksh      GIO   fd 0 read 1 bytes            <-- should be '1 byte'
 >        "                                           <-- \n should be printed
 >        "
 >   4848 ksh      RET   read 1
 
 I agree with your spelling correction.  But converting all newlines to
 \n would be terrible.  If you read a text file, it will crunch
 everything into a single, huge blurb of a line.  For example, this
 snippet from a `ktrace fortune':
 
   3563 fortune	CALL  read(0x3,0xc000,0x2000)
   3563 fortune	GIO   fd 3 read 8192 bytes
        "!07/11 PDP a ni deppart m'I  !pleH
 	%
 	(1) Alexander the Great was a great general.
 	(2) Great generals are forewarned.
 	(3) Forewarned is forearmed.
 	(4) Four is an even number.
 	(5) Four is certainly an odd number of arms for a man to have.
 	(6) The only number that is both even and odd is infinity.
 	
 	Therefore, Alexander the Great had an infinite number of arms.
 
 ...would then look like:
 
   3563 fortune	CALL  read(0x3,0xc000,0x2000)
   3563 fortune	GIO   fd 3 read 8192 bytes
        "!07/11 PDP a ni deppart m'I  !pleH\n%\n(1) Alexander the Great was a\
 	 great general.\n(2) Great generals are forewarned.\n(3) Forewarned \
 	is forearmed.\n(4) Four is an even number.\n(5) Four is certainly an\
 	 odd number of arms for a man to have.\n(6) The only number that is \
 	both even and odd is infinity.\n\nTherefore, Alexander the Great had\
 	 an infinite number of arms.
 
 
 Do you think that's better? :-)
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)
State-Changed-From-To: open->closed 
State-Changed-By: charnier 
State-Changed-When: Wed May 21 23:20:36 PDT 1997 
State-Changed-Why:  
First part of suggested fix applied in rev. 1.10 of kdump.c 
>Unformatted:
