diff options
| author | manu <manu@NetBSD.org> | 2003-11-16 21:52:33 +0000 |
|---|---|---|
| committer | manu <manu@NetBSD.org> | 2003-11-16 21:52:33 +0000 |
| commit | e59cd6c2b4159110383d5eac235caeddec2e5e15 (patch) | |
| tree | b0c1c22c572c61d0a8b724cf53aa49194d3a4a56 /usr.bin/kdump | |
| parent | 3c778e952c0716c7d2e5154c0238bef15321660b (diff) | |
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 (limited to 'usr.bin/kdump')
| -rw-r--r-- | usr.bin/kdump/kdump.1 | 17 | ||||
| -rw-r--r-- | usr.bin/kdump/kdump.c | 20 |
2 files changed, 23 insertions, 14 deletions
diff --git a/usr.bin/kdump/kdump.1 b/usr.bin/kdump/kdump.1 index 9242576a1f2..d51db3157b3 100644 --- a/usr.bin/kdump/kdump.1 +++ b/usr.bin/kdump/kdump.1 @@ -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 @@ See the .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 --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 05d5e34a3b9..82fbc70b237 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\ #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 @@ __RCSID("$NetBSD: kdump.c,v 1.65 2003/11/16 14:51:26 dsl Exp $"); #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 @@ main(argc, argv) 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 @@ main(argc, argv) 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 @@ usage() (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); } |
