Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/miscfs/procfs - match format with the linux map printing



details:   https://anonhg.NetBSD.org/src/rev/997904cc4196
branches:  trunk
changeset: 779141:997904cc4196
user:      christos <christos%NetBSD.org@localhost>
date:      Sun May 06 03:13:11 2012 +0000

description:
- match format with the linux map printing
- fix PK_32 map printing for linux processes
should fix 32 bit java stack guard setting.

diffstat:

 sys/miscfs/procfs/procfs_map.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (52 lines):

diff -r 996265a197ae -r 997904cc4196 sys/miscfs/procfs/procfs_map.c
--- a/sys/miscfs/procfs/procfs_map.c    Sun May 06 02:45:25 2012 +0000
+++ b/sys/miscfs/procfs/procfs_map.c    Sun May 06 03:13:11 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_map.c,v 1.41 2011/10/16 12:26:16 hannken Exp $  */
+/*     $NetBSD: procfs_map.c,v 1.42 2012/05/06 03:13:11 christos Exp $ */
 
 /*
  * Copyright (c) 1993
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_map.c,v 1.41 2011/10/16 12:26:16 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_map.c,v 1.42 2012/05/06 03:13:11 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -120,6 +120,8 @@
        dev_t dev;
        long fileid;
        size_t pos;
+       int width = (int)((curl->l_proc->p_flag & PK_32) ? sizeof(int32_t) : 
+           sizeof(void *)) * 2;
 
        if (uio->uio_rw != UIO_READ)
                return EOPNOTSUPP;
@@ -173,18 +175,17 @@
                                }
                        }
                        pos += snprintf(buffer + pos, bufsize - pos,
-                           "%#0*"PRIxVADDR"-%#0*"PRIxVADDR" %c%c%c%c "
-                           "%0*lx %llx:%llx %ld     %s\n",
-                           (int)sizeof(void *) * 2,entry->start,
-                           (int)sizeof(void *) * 2,entry->end,
+                           "%.*"PRIxVADDR"-%.*"PRIxVADDR" %c%c%c%c "
+                           "%.*lx %.2llx:%.2llx %-8ld %25.s %s\n",
+                           width, entry->start,
+                           width, entry->end,
                            (entry->protection & VM_PROT_READ) ? 'r' : '-',
                            (entry->protection & VM_PROT_WRITE) ? 'w' : '-',
                            (entry->protection & VM_PROT_EXECUTE) ? 'x' : '-',
                            (entry->etype & UVM_ET_COPYONWRITE) ? 'p' : 's',
-                           (int)sizeof(void *) * 2,
-                           (unsigned long)entry->offset,
+                           width, (unsigned long)entry->offset,
                            (unsigned long long)major(dev),
-                           (unsigned long long)minor(dev), fileid, path);
+                           (unsigned long long)minor(dev), fileid, "", path);
                } else {
                        pos += snprintf(buffer + pos, bufsize - pos,
                            "%#"PRIxVADDR" %#"PRIxVADDR" "



Home | Main Index | Thread Index | Old Index