From patchwork Tue Jun 28 19:12:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 641727 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rfGJp0jYhz9t0X for ; Wed, 29 Jun 2016 05:36:42 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=iBlnci3d; dkim-atps=neutral Received: from localhost ([::1]:39110 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHyoJ-0003ry-LE for incoming@patchwork.ozlabs.org; Tue, 28 Jun 2016 15:36:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHyRp-00029C-HP for qemu-devel@nongnu.org; Tue, 28 Jun 2016 15:13:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHyRl-0006w6-6o for qemu-devel@nongnu.org; Tue, 28 Jun 2016 15:13:24 -0400 Received: from mail-lf0-x232.google.com ([2a00:1450:4010:c07::232]:33287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHyRk-0006vx-V6 for qemu-devel@nongnu.org; Tue, 28 Jun 2016 15:13:21 -0400 Received: by mail-lf0-x232.google.com with SMTP id f6so18203454lfg.0 for ; Tue, 28 Jun 2016 12:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TAPEB/ZZ6BeGabbfzFeVgldicXlTvFn7ZPSGvtzP/RQ=; b=iBlnci3dCzOs379kbPag8RTr3R61V46jWfHmqCq0F7RhGXtfDsi7NB7e8ahW4zDsyv dPLyVq7TVtQuJBRALUnUzwy+YGq5IBKakD8DLPsXp6JlT55aUyrDqsQIWQur+mElx/mb zlP8OMYP6creYVvMc2IXENbNZD/5KpiSRn/Bo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TAPEB/ZZ6BeGabbfzFeVgldicXlTvFn7ZPSGvtzP/RQ=; b=PSFQ4LYAlUuv85tKVZlDMa61eQq2bItzuXFB494YIcE1Cvga1TXAo13QN9pL+tg30/ ldJd39ErwE1sdsGUJCc0IOPnHV+SXwCKth1fh7irZvBQYZTG/HlBH/6sdurNGQeA1bPM DrrcsO2P+IxnlddwZy7tojGvWbNogOP6TrWLs5b4GlYGfGUkb4/FqnHmTiesQGSY7rA1 1Ns9r3CAFyqFBauH+l6jAUMxh6vFOzGvFgxXVNqxqbV3c0hQ7s0eLggL4E5TAWGo4eEU 308URKJzsrNP2U9/zSqS2mbdV6S7jBHD2DMfUqOV8i5yStly8NOSzcuPl9c8CblCOsB4 RYyw== X-Gm-Message-State: ALyK8tKGwPiZIIpk/hHUMcQhGZrVyrq+gSlAIZGjWNTzCDBkEjeUpEcYAfzIAFv6I+smOipJ X-Received: by 10.25.3.12 with SMTP id 12mr1519682lfd.110.1467141200123; Tue, 28 Jun 2016 12:13:20 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id h10sm4262823ljh.38.2016.06.28.12.13.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Jun 2016 12:13:19 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 28 Jun 2016 22:12:48 +0300 Message-Id: <84bd828429df6ba2e001b11b2157d3232f6a23d7.1467138806.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::232 Subject: [Qemu-devel] [PULL v2 14/24] linux-user: fix clone() strace X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier Signed-off-by: Laurent Vivier Signed-off-by: Riku Voipio Reviewed-by: Peter Maydell --- linux-user/strace.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 95f4338..cc10dc4 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -957,33 +957,31 @@ print_chmod(const struct syscallname *name, #endif #ifdef TARGET_NR_clone +static void do_print_clone(unsigned int flags, abi_ulong newsp, + abi_ulong parent_tidptr, target_ulong newtls, + abi_ulong child_tidptr) +{ + print_flags(clone_flags, flags, 0); + print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx, newsp, 0); + print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx, parent_tidptr, 0); + print_raw_param("tls=0x" TARGET_ABI_FMT_lx, newtls, 0); + print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx, child_tidptr, 1); +} + static void print_clone(const struct syscallname *name, - abi_long arg0, abi_long arg1, abi_long arg2, - abi_long arg3, abi_long arg4, abi_long arg5) + abi_long arg1, abi_long arg2, abi_long arg3, + abi_long arg4, abi_long arg5, abi_long arg6) { print_syscall_prologue(name); -#if defined(TARGET_M68K) - print_flags(clone_flags, arg0, 0); - print_raw_param("newsp=0x" TARGET_ABI_FMT_lx, arg1, 1); -#elif defined(TARGET_SH4) || defined(TARGET_ALPHA) - print_flags(clone_flags, arg0, 0); - print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx, arg1, 0); - print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx, arg2, 0); - print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx, arg3, 0); - print_raw_param("tls=0x" TARGET_ABI_FMT_lx, arg4, 1); -#elif defined(TARGET_CRIS) - print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx, arg0, 0); - print_flags(clone_flags, arg1, 0); - print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx, arg2, 0); - print_raw_param("tls=0x" TARGET_ABI_FMT_lx, arg3, 0); - print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx, arg4, 1); +#if defined(TARGET_MICROBLAZE) + do_print_clone(arg1, arg2, arg4, arg6, arg5); +#elif defined(TARGET_CLONE_BACKWARDS) + do_print_clone(arg1, arg2, arg3, arg4, arg5); +#elif defined(TARGET_CLONE_BACKWARDS2) + do_print_clone(arg2, arg1, arg3, arg5, arg4); #else - print_flags(clone_flags, arg0, 0); - print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx, arg1, 0); - print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx, arg2, 0); - print_raw_param("tls=0x" TARGET_ABI_FMT_lx, arg3, 0); - print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx, arg4, 1); + do_print_clone(arg1, arg2, arg3, arg5, arg4); #endif print_syscall_epilogue(name); }