From owner-svn-src-head@freebsd.org Mon Sep 30 19:03:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD9E412F940; Mon, 30 Sep 2019 19:03:43 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hsHz5Xj1z4JXK; Mon, 30 Sep 2019 19:03:43 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1E6E7337; Mon, 30 Sep 2019 19:03:43 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8UJ3hvE029498; Mon, 30 Sep 2019 19:03:43 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UJ3h3f029497; Mon, 30 Sep 2019 19:03:43 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <201909301903.x8UJ3h3f029497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Mon, 30 Sep 2019 19:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352913 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 352913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2019 19:03:43 -0000 Author: kaktus Date: Mon Sep 30 19:03:43 2019 New Revision: 352913 URL: https://svnweb.freebsd.org/changeset/base/352913 Log: libsysdecode: decode PROT_MAX flags Extend libsysdecode to pretty-print PROT_MAX flags and fix decoding of regular protection flags broken since r349240. before: truss: mmap(0x0,40960,0x30000,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34366234624 (0x800632000) kdump: 11439 protmax CALL mmap(0,0xa000,0x30000<>196608,0x21002,0xffffffff,0) after: truss: mmap(0x0,40960,PROT_MAX(PROT_READ|PROT_WRITE)|PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34366234624 (0x800632000) kdump: 11439 protmax CALL mmap(0,0xa000,0x30000,0x21002,0xffffffff,0) Reviewed by: kib (mentor) Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D21706 Modified: head/lib/libsysdecode/flags.c Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Mon Sep 30 18:22:33 2019 (r352912) +++ head/lib/libsysdecode/flags.c Mon Sep 30 19:03:43 2019 (r352913) @@ -657,8 +657,18 @@ sysdecode_mlockall_flags(FILE *fp, int flags, int *rem bool sysdecode_mmap_prot(FILE *fp, int prot, int *rem) { + int protm; + bool printed; - return (print_mask_int(fp, mmapprot, prot, rem)); + printed = false; + protm = PROT_MAX_EXTRACT(prot); + if (protm != 0) { + fputs("PROT_MAX(", fp); + printed = print_mask_int(fp, mmapprot, protm, rem); + fputs(")|", fp); + prot = protm; + } + return (print_mask_int(fp, mmapprot, prot, rem) || printed); } bool