From owner-svn-src-all@FreeBSD.ORG Sun May 24 15:42:36 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E63C5CDF; Sun, 24 May 2015 15:42:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D49271EEE; Sun, 24 May 2015 15:42:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OFgagg062800; Sun, 24 May 2015 15:42:36 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OFgaAN062799; Sun, 24 May 2015 15:42:36 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201505241542.t4OFgaAN062799@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 24 May 2015 15:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283414 - head/sys/compat/linprocfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 15:42:37 -0000 Author: dchagin Date: Sun May 24 15:42:36 2015 New Revision: 283414 URL: https://svnweb.freebsd.org/changeset/base/283414 Log: Print out proper procmap entry for 64 bit binaries. Differential Revision: https://reviews.freebsd.org/D1066 Reviewed by: trasz Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sun May 24 15:41:27 2015 (r283413) +++ head/sys/compat/linprocfs/linprocfs.c Sun May 24 15:42:36 2015 (r283414) @@ -982,6 +982,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 */ @@ -997,6 +1000,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; @@ -1069,8 +1073,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":"-",