Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/kdump Symbolic printing for mmap
details: https://anonhg.NetBSD.org/src/rev/4331a07b7e9f
branches: trunk
changeset: 345548:4331a07b7e9f
user: christos <christos%NetBSD.org@localhost>
date: Wed Jun 01 00:47:16 2016 +0000
description:
Symbolic printing for mmap
diffstat:
usr.bin/kdump/kdump.c | 43 ++++++++++++++++++++++++++++++++++++++++---
1 files changed, 40 insertions(+), 3 deletions(-)
diffs (71 lines):
diff -r ea16f8c4ae24 -r 4331a07b7e9f usr.bin/kdump/kdump.c
--- a/usr.bin/kdump/kdump.c Wed Jun 01 00:46:44 2016 +0000
+++ b/usr.bin/kdump/kdump.c Wed Jun 01 00:47:16 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kdump.c,v 1.123 2016/03/27 21:51:20 alnsn Exp $ */
+/* $NetBSD: kdump.c,v 1.124 2016/06/01 00:47:16 christos 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.123 2016/03/27 21:51:20 alnsn Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.124 2016/06/01 00:47:16 christos Exp $");
#endif
#endif /* not lint */
@@ -48,6 +48,7 @@
#define _KMEMUSER /* To get the pseudo errors defined */
#include <sys/errno.h>
#undef _KMEMUSER
+#include <sys/mman.h>
#include <sys/time.h>
#include <sys/uio.h>
#include <sys/ktrace.h>
@@ -598,7 +599,43 @@
ap += 2;
argcount -= 2;
c = ',';
-
+ } else if (strcmp(sys_name, "mmap") == 0 && argcount >= 6) {
+ char buf[1024];
+ putchar('(');
+ output_long((long)ap[0], !(decimal || small(ap[0])));
+ c = ',';
+ putchar(c);
+ output_long((long)ap[1], !(decimal || small(ap[1])));
+ putchar(c);
+ if (ap[2] == PROT_NONE) {
+ fputs("PROT_NONE", stdout);
+ } else {
+ const char *s = "";
+ c = 0;
+ if (ap[2] & PROT_READ) {
+ fputs("PROT_READ", stdout);
+ s = "|";
+ ap[2] &= ~PROT_READ;
+ }
+ if (ap[2] & PROT_WRITE) {
+ printf("%sPROT_WRITE", s);
+ ap[2] &= ~PROT_WRITE;
+ s = "|";
+ }
+ if (ap[2] & PROT_EXEC) {
+ printf("%sPROT_EXEC", s);
+ ap[2] &= ~PROT_EXEC;
+ s = "|";
+ }
+ if (ap[2]) {
+ printf("%s%#lx", s, (long)ap[2]);
+ }
+ }
+ snprintb(buf, sizeof(buf), MAP_FMT, ap[3]);
+ printf(",%s", buf);
+ ap += 4;
+ argcount -= 4;
+ c = ',';
} else if (strcmp(sys_name, "ptrace") == 0 && argcount >= 1) {
putchar('(');
if (strcmp(emul->name, "linux") == 0 ||
Home |
Main Index |
Thread Index |
Old Index