diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-06-18 04:06:27 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-06-18 04:07:42 -0400 |
commit | 57b42d6489218e29cb18edd111c97f4390b62ad9 (patch) | |
tree | 0e57c531db62706de719ea798fe48e40d0be6653 | |
parent | 7aec3bb968de6847cc73809408dfe8aa78fe7de7 (diff) | |
download | gdb-57b42d6489218e29cb18edd111c97f4390b62ad9.zip gdb-57b42d6489218e29cb18edd111c97f4390b62ad9.tar.gz gdb-57b42d6489218e29cb18edd111c97f4390b62ad9.tar.bz2 |
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.
-rw-r--r-- | sim/common/ChangeLog | 5 | ||||
-rw-r--r-- | 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 <vapier@gentoo.org> + * sim-syscall.c (sim_syscall_multi): Change unknown_syscall to a + constant string. + +2015-06-18 Mike Frysinger <vapier@gentoo.org> + * 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[] = "<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])", |