Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jan 2016 15:53:50 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r293520 - stable/10/sys/compat/linprocfs
Message-ID:  <201601091553.u09FroQu028329@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sat Jan  9 15:53:50 2016
New Revision: 293520
URL: https://svnweb.freebsd.org/changeset/base/293520

Log:
  MFC r283414:
  
  Print out proper procmap entry for 64 bit binaries.

Modified:
  stable/10/sys/compat/linprocfs/linprocfs.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- stable/10/sys/compat/linprocfs/linprocfs.c	Sat Jan  9 15:52:32 2016	(r293519)
+++ stable/10/sys/compat/linprocfs/linprocfs.c	Sat Jan  9 15:53:50 2016	(r293520)
@@ -965,6 +965,9 @@ linprocfs_doprocenviron(PFS_FILL_ARGS)
 	return (ret);
 }
 
+static char l32_map_str[] = "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n";
+static char l64_map_str[] = "%016lx-%016lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n";
+
 /*
  * Filler function for proc/pid/maps
  */
@@ -980,6 +983,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
 	vm_prot_t e_prot;
 	unsigned int last_timestamp;
 	char *name = "", *freename = NULL;
+	const char *l_map_str;
 	ino_t ino;
 	int ref_count, shadow_count, flags;
 	int error;
@@ -1048,8 +1052,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
 		 * format:
 		 *  start, end, access, offset, major, minor, inode, name.
 		 */
-		error = sbuf_printf(sb,
-		    "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n",
+		if (SV_CURPROC_FLAG(SV_LP64))
+			l_map_str = l64_map_str;
+		else
+			l_map_str = l32_map_str;
+		error = sbuf_printf(sb, l_map_str,
 		    (u_long)e_start, (u_long)e_end,
 		    (e_prot & VM_PROT_READ)?"r":"-",
 		    (e_prot & VM_PROT_WRITE)?"w":"-",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601091553.u09FroQu028329>