From patchwork Thu Jun 18 08:08:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 7231 Received: (qmail 89574 invoked by alias); 18 Jun 2015 08:08:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 89555 invoked by uid 89); 18 Jun 2015 08:08:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 18 Jun 2015 08:08:26 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id E429F340939 for ; Thu, 18 Jun 2015 08:08:23 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH] sim: syscall: simplify unknown syscall trace Date: Thu, 18 Jun 2015 04:08:22 -0400 Message-Id: <1434614902-6109-1-git-send-email-vapier@gentoo.org> In-Reply-To: <1434561630-16170-3-git-send-email-vapier@gentoo.org> References: <1434561630-16170-3-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes Since we always include the raw syscall number when tracing, also including it in the name when it's unknown is redundant. Simplify the code by using a constant string. Committed. --- sim/common/ChangeLog | 5 +++++ sim/common/sim-syscall.c | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index afc1b3a..ecbaad1 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,5 +1,10 @@ 2015-06-18 Mike Frysinger + * sim-syscall.c (sim_syscall_multi): Change unknown_syscall to a + constant string. + +2015-06-18 Mike Frysinger + * callback.c (cb_target_map_entry, cb_host_map_entry): Change map to m for sentinel testing. diff --git a/sim/common/sim-syscall.c b/sim/common/sim-syscall.c index 6f4c8a3..ff5e5d2 100644 --- a/sim/common/sim-syscall.c +++ b/sim/common/sim-syscall.c @@ -60,7 +60,7 @@ sim_syscall_multi (SIM_CPU *cpu, int func, long arg1, long arg2, long arg3, SIM_DESC sd = CPU_STATE (cpu); host_callback *cb = STATE_CALLBACK (sd); CB_SYSCALL sc; - char unknown_syscall[30]; + const char unknown_syscall[] = ""; const char *syscall; CB_SYSCALL_INIT (&sc); @@ -85,10 +85,7 @@ sim_syscall_multi (SIM_CPU *cpu, int func, long arg1, long arg2, long arg3, syscall = cb_target_str_syscall (cb, func); if (!syscall) - { - sprintf (unknown_syscall, "syscall_%i", func); - syscall = unknown_syscall; - } + syscall = unknown_syscall; if (sc.result == -1) TRACE_SYSCALL (cpu, "%s[%i](%#lx, %#lx, %#lx) = %li (error = %s[%i])",