Module Name: src Committed By: christos Date: Sun Oct 5 22:58:43 UTC 2014
Modified Files: src/usr.sbin/crash: crash.8 crash.c Log Message: add -w To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/crash/crash.8 cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/crash/crash.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/crash/crash.8 diff -u src/usr.sbin/crash/crash.8:1.3 src/usr.sbin/crash/crash.8:1.4 --- src/usr.sbin/crash/crash.8:1.3 Sun Apr 10 18:49:52 2011 +++ src/usr.sbin/crash/crash.8 Sun Oct 5 18:58:43 2014 @@ -1,4 +1,4 @@ -.\" $NetBSD: crash.8,v 1.3 2011/04/10 22:49:52 pgoyette Exp $ +.\" $NetBSD: crash.8,v 1.4 2014/10/05 22:58:43 christos Exp $ .\" .\" Copyright (c) 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 7, 2009 +.Dd October 5, 2014 .Dt CRASH 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Nm .Op Fl M Ar core .Op Fl N Ar kernel +.Op Fl w .Sh DESCRIPTION The .Nm @@ -58,6 +59,8 @@ and must be uncompressed. .It Fl N Ar kernel Extract the name list from the specified kernel instead of the default .Pa /dev/ksyms . +.It Fl w +Enable writing. .El .Pp The command syntax used by Index: src/usr.sbin/crash/crash.c diff -u src/usr.sbin/crash/crash.c:1.5 src/usr.sbin/crash/crash.c:1.6 --- src/usr.sbin/crash/crash.c:1.5 Sun Mar 10 15:32:29 2013 +++ src/usr.sbin/crash/crash.c Sun Oct 5 18:58:43 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: crash.c,v 1.5 2013/03/10 19:32:29 christos Exp $ */ +/* $NetBSD: crash.c,v 1.6 2014/10/05 22:58:43 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: crash.c,v 1.5 2013/03/10 19:32:29 christos Exp $"); +__RCSID("$NetBSD: crash.c,v 1.6 2014/10/05 22:58:43 christos Exp $"); #endif /* not lint */ #include <ddb/ddb.h> @@ -329,19 +329,20 @@ main(int argc, char **argv) struct stat sb; size_t sz; void *elf; - int fd, ch; + int fd, ch, flags; char c; nlistf = _PATH_KSYMS; memf = _PATH_MEM; ofp = stdout; + flags = O_RDONLY; setprogname(argv[0]); /* * Parse options. */ - while ((ch = getopt(argc, argv, "M:N:")) != -1) { + while ((ch = getopt(argc, argv, "M:N:w")) != -1) { switch (ch) { case 'M': memf = optarg; @@ -349,6 +350,9 @@ main(int argc, char **argv) case 'N': nlistf = optarg; break; + case 'w': + flags = O_RDWR; + break; default: usage(); } @@ -364,7 +368,7 @@ main(int argc, char **argv) /* * Open the images (crash dump and symbol table). */ - kd = kvm_open(nlistf, memf, NULL, O_RDONLY, getprogname()); + kd = kvm_open(nlistf, memf, NULL, flags, getprogname()); if (kd == NULL) { return EXIT_FAILURE; }