From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 11:33:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F140F1065672; Thu, 16 Sep 2010 11:33:31 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0B218FC0A; Thu, 16 Sep 2010 11:33:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GBXVIq087568; Thu, 16 Sep 2010 11:33:31 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GBXVcK087566; Thu, 16 Sep 2010 11:33:31 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201009161133.o8GBXVcK087566@svn.freebsd.org> From: Rui Paulo Date: Thu, 16 Sep 2010 11:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212727 - head/usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 16 Sep 2010 11:33:32 -0000 Author: rpaulo Date: Thu Sep 16 11:33:31 2010 New Revision: 212727 URL: http://svn.freebsd.org/changeset/base/212727 Log: When generating functions to print the arguments of system calls with bitwise parameters (e.g. mmap), print the syscall parameter value first. The resulting output looks like the %b specifier of printf(9). Before: mmap(0,0x8000,PROT_READ|PROT_WRITE,... After: mmap(0,0x8000,0x3,... Submitted by: Norberto Lopes Idea from: freebsd-arch/2006-April/005116.html Modified: head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/mksubr ============================================================================== --- head/usr.bin/kdump/mksubr Thu Sep 16 10:53:01 2010 (r212726) +++ head/usr.bin/kdump/mksubr Thu Sep 16 11:33:31 2010 (r212727) @@ -49,6 +49,7 @@ void $name (int arg) { int or = 0; + printf("%#x<", arg); _EOF_ egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \ $include_dir/$file | \ @@ -58,6 +59,7 @@ _EOF_ ++i; \ printf "\tif(!((arg>0)^((%s)>0)))\n\t\tif_print_or(arg, %s, or);\n", $i, $i }' cat <<_EOF_ + printf(">"); if (or == 0) (void)printf("%ld", (long)arg); } @@ -432,6 +434,8 @@ sendrecvflagsname (int flags) (void)printf("0"); return; } + + printf("%#x<", flags); _EOF_ egrep "^#[[:space:]]*define[[:space:]]+MSG_[A-Z]+[[:space:]]+0x[0-9]+[[:space:]]*" $include_dir/sys/socket.h | \ awk '{ for (i = 1; i <= NF; i++) \ @@ -440,6 +444,7 @@ egrep "^#[[:space:]]*define[[:space:]]+M ++i; \ printf "\tif(!((flags>0)^((%s)>0)))\n\t\tif_print_or(flags, %s, or);\n", $i, $i }' cat <<_EOF_ + printf(">"); } _EOF_