add -w
This commit is contained in:
parent
15239241e8
commit
f7bf36a390
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue