Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/kdump Following mycroft's comment, restore -x to its...
details: https://anonhg.NetBSD.org/src/rev/91f2c216e19d
branches: trunk
changeset: 555414:91f2c216e19d
user: manu <manu%NetBSD.org@localhost>
date: Sun Nov 16 21:52:33 2003 +0000
description:
Following mycroft's comment, restore -x to its original behavior: without
an argument. Introduce -Xsize to do the job. -x is equivalent to -X1
Of course -x and -Xsize are mutually exclusive.
diffstat:
usr.bin/kdump/kdump.1 | 17 +++++++++--------
usr.bin/kdump/kdump.c | 20 ++++++++++++++------
2 files changed, 23 insertions(+), 14 deletions(-)
diffs (105 lines):
diff -r 9cd4bfebca7b -r 91f2c216e19d usr.bin/kdump/kdump.1
--- a/usr.bin/kdump/kdump.1 Sun Nov 16 20:32:05 2003 +0000
+++ b/usr.bin/kdump/kdump.1 Sun Nov 16 21:52:33 2003 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: kdump.1,v 1.24 2003/11/16 10:16:56 wiz Exp $
+.\" $NetBSD: kdump.1,v 1.25 2003/11/16 21:52:33 manu Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -43,7 +43,7 @@
.Op Fl m Ar maxdata
.Op Fl p Ar pid
.Op Fl t Ar trstr
-.Op Fl x Op Ar size
+.Op Fl x | Fl X Ar size
.Op Ar file
.Sh DESCRIPTION
.Nm
@@ -104,15 +104,16 @@
.Fl t
option of
.Xr ktrace 1 .
-.It Fl x Op Ar size
+.It Fl x
Display GIO data in hex and ascii instead of
.Xr vis 3
format.
-The optional
-.Ar size
-argument force byte groupping in the display.
-Supported values are 1 (byte per byte) and 4 (word per word).
-Default is 1.
+.It Fl X Ar size
+Same as
+.Fl x
+but display hex values by groups of
+.Ar size
+bytes. Supported values are 1, 2, 4, 8 and 16.
.El
.Sh SEE ALSO
.Xr ktrace 1
diff -r 9cd4bfebca7b -r 91f2c216e19d usr.bin/kdump/kdump.c
--- a/usr.bin/kdump/kdump.c Sun Nov 16 20:32:05 2003 +0000
+++ b/usr.bin/kdump/kdump.c Sun Nov 16 21:52:33 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kdump.c,v 1.65 2003/11/16 14:51:26 dsl Exp $ */
+/* $NetBSD: kdump.c,v 1.66 2003/11/16 21:52:33 manu Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: kdump.c,v 1.65 2003/11/16 14:51:26 dsl Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.66 2003/11/16 21:52:33 manu Exp $");
#endif
#endif /* not lint */
@@ -69,7 +69,7 @@
#include <sys/syscall.h>
int timestamp, decimal, plain, tail, maxdata = -1, numeric;
-int word_size;
+int word_size = 0;
pid_t do_pid = -1;
const char *tracefile = NULL;
struct ktr_header ktr_header;
@@ -128,7 +128,7 @@
int col;
char *cp;
- while ((ch = getopt(argc, argv, "e:f:dlm:Nnp:RTt:x:")) != -1)
+ while ((ch = getopt(argc, argv, "e:f:dlm:Nnp:RTt:xX:")) != -1)
switch (ch) {
case 'e':
emul_name = strdup(optarg); /* it's safer to copy it */
@@ -167,10 +167,18 @@
errx(1, "unknown trace point in %s", optarg);
break;
case 'x':
+ if (word_size != 0)
+ errx(1, "-x and -X are mutually exclusive");
+ word_size = 1;
+ break;
+ case 'X':
+ if (word_size != 0)
+ errx(1, "-x and -X are mutually exclusive");
word_size = strtoul(optarg, &cp, 0);
if (*cp != 0 || word_size & (word_size - 1) ||
word_size > 16 || word_size == 0)
- errx(1, "argument to -x must be 1, 2, 4, 8 or 16");
+ errx(1, "argument to -X must be "
+ "1, 2, 4, 8 or 16");
break;
default:
usage();
@@ -887,6 +895,6 @@
(void)fprintf(stderr, "usage: kdump [-dlNnRT] [-e emulation] "
"[-f file] [-m maxdata] [-p pid]\n [-t trstr] "
- "[-x [size]] [file]\n");
+ "[-x | -X size] [file]\n");
exit(1);
}
Home |
Main Index |
Thread Index |
Old Index