From patchwork Tue Oct 22 08:10:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1181132 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46y5tt3Z37z9sNx for ; Tue, 22 Oct 2019 19:16:22 +1100 (AEDT) Received: from localhost ([::1]:51424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMpL0-0006yF-Ij for incoming@patchwork.ozlabs.org; Tue, 22 Oct 2019 04:16:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44130) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMpGF-0002em-KL for qemu-devel@nongnu.org; Tue, 22 Oct 2019 04:11:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMpGE-00053c-Cc for qemu-devel@nongnu.org; Tue, 22 Oct 2019 04:11:23 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:57117) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMpGE-00052o-3E for qemu-devel@nongnu.org; Tue, 22 Oct 2019 04:11:22 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MwPfX-1i4Ku301yv-00sOZb; Tue, 22 Oct 2019 10:11:18 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 04/11] linux-user/strace: Add print_timezone() Date: Tue, 22 Oct 2019 10:10:57 +0200 Message-Id: <20191022081104.11814-5-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191022081104.11814-1-laurent@vivier.eu> References: <20191022081104.11814-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:9wKceQZbFkT5WG5OXBjMel3+MhU5aaKV4bJghqBP929uN6MkBc9 y2wyt8DhKKgC0Et1hOplhxI7aYXnqCLI/tCpKTuetUQaNsnCD32xKdx1C1Ck4wXOE87Gfy3 CQ6bWgtNujLQ2oh/9f++HswjCmzki3COEZ52c7ufTaaPO1oWBqGlQwOIUTCCIrjMyKJ8b3e JIBd7MpTIunI4c3CrDQLg== X-UI-Out-Filterresults: notjunk:1; V03:K0:58T0ejQNKkI=:BrwCANgLcZm5oXNFfUYTeO 6gkrC75oCqsOIpqjbxW6vaP40g70zaOaqEcdLlpKIQLHhmGULNXtKdmwVBvhfpR19jsmIZoFH n0f3mY1bMreTbk/KgcaKQWJpf+6iSHPdpC0fqxBLdynpGE5mX4Gj/vmGWyCndK2mLfsqjanNF 9aAtQxqFxFIyUCy9tMtGQXheqYhmzSeFBXVEtSdCOO/W9K+n/WtM+QGNvUeCMe4O0XxoAfmFs Q17KZ3uU/zUFc1bH3a5Fpj+xjHPTTX7C7E/Vc0Gdfa1Dt9FS1xh9lSqzDpKzwa4DO1F6vxuyG pNN46ZR0rUMuspdt3UJsfd20eawgegFW6/cEZwva1NKkMruQ7iymNNthUuvUH2cW6t42VIJLw BUDoalsdrW+woBhhmLV+HKVlelwLalHTjGakff6X5E7h3W6cRM2rmt6hn/sXRtqeu4WDjeFKi I75iRT3/f9vl3PKY6Z8dmAlEhsrYUEWXIgmEQielWNwwBuLNMOtZwsaeAeIWLjoO3Zi6sTtVJ A6unb+387osC3Spasu7qPMxAKEu/iCYBkMXmOwDxhrbbYPRNaoyBip3WrOdoxiFVGdxooYSLH 2cjrWWS8tE+WxH1pA3Gnr8rV4fqTB0e+8fgk5t75qrwkK6tMUzDJ13fkq1aPu2+i5xThaA2B3 0BIJHylKz6MVwvaavBwmzV/5yjJwFBxiycM8Vxf+lJeJjozDy8UYUprvxJing6kAn528x9IyS SXiRjIA1Yi3VvIGPNriajDjs4c7o7l5EqofecrALUYJDGkerG8zM1fOOWpAVxEVj88Q5KYg31 w1fsMC90TWOISKfVqweLrylWpH0Py2szMxbVxVzQmbeyn9JvI3wZ46OcLejzyfmyAma+wfJ86 Sn5x6R3YO3EQlGW4cCm8oiUZKV/ejUishSgYTBUSE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Suggested-by: Laurent Vivier Reviewed-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Laurent Vivier Message-Id: <20191021114857.20538-3-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/linux-user/strace.c b/linux-user/strace.c index f326c357a26d..2cd6687cd99b 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -63,6 +63,7 @@ UNUSED static void print_string(abi_long, int); UNUSED static void print_buf(abi_long addr, abi_long len, int last); UNUSED static void print_raw_param(const char *, abi_long, int); UNUSED static void print_timeval(abi_ulong, int); +UNUSED static void print_timezone(abi_ulong, int); UNUSED static void print_number(abi_long, int); UNUSED static void print_signal(abi_ulong, int); UNUSED static void print_sockaddr(abi_ulong addr, abi_long addrlen); @@ -1254,6 +1255,25 @@ print_timeval(abi_ulong tv_addr, int last) gemu_log("NULL%s", get_comma(last)); } +static void +print_timezone(abi_ulong tz_addr, int last) +{ + if (tz_addr) { + struct target_timezone *tz; + + tz = lock_user(VERIFY_READ, tz_addr, sizeof(*tz), 1); + if (!tz) { + print_pointer(tz_addr, last); + return; + } + gemu_log("{%d,%d}%s", tswap32(tz->tz_minuteswest), + tswap32(tz->tz_dsttime), get_comma(last)); + unlock_user(tz, tz_addr, 0); + } else { + gemu_log("NULL%s", get_comma(last)); + } +} + #undef UNUSED #ifdef TARGET_NR_accept