From: Mike Frysinger Date: Thu, 18 Jun 2015 08:06:27 +0000 (-0400) Subject: sim: syscall: simplify unknown syscall trace X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=57b42d6489218e29cb18edd111c97f4390b62ad9;p=binutils-gdb.git sim: syscall: simplify unknown syscall trace 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. --- diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index afc1b3aad5b..ecbaad17458 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/sim/common/sim-syscall.c b/sim/common/sim-syscall.c index 6f4c8a3fc88..ff5e5d2ed35 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])",