diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-06-12 13:29:02 +0545 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-06-12 04:19:45 -0400 |
commit | db7858e227f3951c665410314fca62c77349ac24 (patch) | |
tree | 01fb8b93600bc89ef86a7e883ca17e3df8387174 /sim/common/cgen-trace.c | |
parent | 966f0aefa6a96df2c45ec36a7ecc02419e3842db (diff) | |
download | gdb-db7858e227f3951c665410314fca62c77349ac24.zip gdb-db7858e227f3951c665410314fca62c77349ac24.tar.gz gdb-db7858e227f3951c665410314fca62c77349ac24.tar.bz2 |
sim: cgen: namespace custom trace functions
The cgen code declares some macros/funcs using the trace_xxx prefix, but
the code isn't generic and only works with cgen targets. This is blocking
the creation of new common trace functions.
Let's blindly add cgen_xxx prefixes to all these symbols. Some already
use this convention to avoid conflicts, so it makes sense to align them.
In the future we might want to move some to the common trace core, but
one thing at a time.
Diffstat (limited to 'sim/common/cgen-trace.c')
-rw-r--r-- | sim/common/cgen-trace.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sim/common/cgen-trace.c b/sim/common/cgen-trace.c index 87aa3ce..566f2e6 100644 --- a/sim/common/cgen-trace.c +++ b/sim/common/cgen-trace.c @@ -66,29 +66,30 @@ static char *bufptr; /* Non-zero if this is the first insn in a set of parallel insns. */ static int first_insn_p; -/* For communication between trace_insn and trace_result. */ +/* For communication between cgen_trace_insn and cgen_trace_result. */ static int printed_result_p; /* Insn and its extracted fields. - Set by trace_insn, used by trace_insn_fini. + Set by cgen_trace_insn, used by cgen_trace_insn_fini. ??? Move to SIM_CPU to support heterogeneous multi-cpu case. */ static const struct cgen_insn *current_insn; static const struct argbuf *current_abuf; void -trace_insn_init (SIM_CPU *cpu, int first_p) +cgen_trace_insn_init (SIM_CPU *cpu, int first_p) { bufptr = trace_buf; *bufptr = 0; first_insn_p = first_p; - /* Set to NULL so trace_insn_fini can know if trace_insn was called. */ + /* Set to NULL so cgen_trace_insn_fini can know if cgen_trace_insn was + called. */ current_insn = NULL; current_abuf = NULL; } void -trace_insn_fini (SIM_CPU *cpu, const struct argbuf *abuf, int last_p) +cgen_trace_insn_fini (SIM_CPU *cpu, const struct argbuf *abuf, int last_p) { SIM_DESC sd = CPU_STATE (cpu); @@ -143,7 +144,7 @@ trace_insn_fini (SIM_CPU *cpu, const struct argbuf *abuf, int last_p) ++i, ++opinst) { if (CGEN_OPINST_TYPE (opinst) == CGEN_OPINST_OUTPUT) - trace_result (cpu, current_insn, opinst, indices[i]); + cgen_trace_result (cpu, current_insn, opinst, indices[i]); } } } @@ -158,8 +159,8 @@ trace_insn_fini (SIM_CPU *cpu, const struct argbuf *abuf, int last_p) } void -trace_insn (SIM_CPU *cpu, const struct cgen_insn *opcode, - const struct argbuf *abuf, IADDR pc) +cgen_trace_insn (SIM_CPU *cpu, const struct cgen_insn *opcode, + const struct argbuf *abuf, IADDR pc) { char disasm_buf[50]; @@ -183,7 +184,7 @@ trace_insn (SIM_CPU *cpu, const struct cgen_insn *opcode, } void -trace_extract (SIM_CPU *cpu, IADDR pc, char *name, ...) +cgen_trace_extract (SIM_CPU *cpu, IADDR pc, char *name, ...) { va_list args; int printed_one_p = 0; @@ -222,7 +223,7 @@ trace_extract (SIM_CPU *cpu, IADDR pc, char *name, ...) } void -trace_result (SIM_CPU *cpu, char *name, int type, ...) +cgen_trace_result (SIM_CPU *cpu, char *name, int type, ...) { va_list args; |