diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-06-26 22:55:53 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-06-27 10:45:51 -0400 |
commit | ded82565c6d432c6dcfc6a867bad479633426a62 (patch) | |
tree | bffd6855644e001c2d29621b6db44e5d452fd61e /sim/common | |
parent | 2d922d86bac7b51bfe8e45ed4c8aa7af37010ead (diff) | |
download | gdb-ded82565c6d432c6dcfc6a867bad479633426a62.zip gdb-ded82565c6d432c6dcfc6a867bad479633426a62.tar.gz gdb-ded82565c6d432c6dcfc6a867bad479633426a62.tar.bz2 |
sim: cgen: constify trace strings
Shouldn't be any functional changes here.
Diffstat (limited to 'sim/common')
-rw-r--r-- | sim/common/ChangeLog | 9 | ||||
-rw-r--r-- | sim/common/cgen-trace.c | 10 | ||||
-rw-r--r-- | sim/common/cgen-trace.h | 6 |
3 files changed, 17 insertions, 8 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index b0c3cb1..06f0924 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,5 +1,14 @@ 2021-06-27 Mike Frysinger <vapier@gentoo.org> + * cgen-trace.c (cgen_trace_extract): Make name & fmt const. + (cgen_trace_result): Make name const. + (cgen_trace_printf): Make fmt const. + * cgen-trace.h (cgen_trace_extract): Make 3rd arg const. + (cgen_trace_result): Make 2nd arg const. + (cgen_trace_printf): Likewise. + +2021-06-27 Mike Frysinger <vapier@gentoo.org> + * cgen-mem.h (DECLARE_GETMEM_EXTERN): New macro. (DECLARE_GETMEM): Use DECLARE_GETMEM_EXTERN. (DECLARE_SETMEM_EXTERN): New macro. diff --git a/sim/common/cgen-trace.c b/sim/common/cgen-trace.c index 206720c..6592740 100644 --- a/sim/common/cgen-trace.c +++ b/sim/common/cgen-trace.c @@ -185,11 +185,11 @@ cgen_trace_insn (SIM_CPU *cpu, const struct cgen_insn *opcode, } void -cgen_trace_extract (SIM_CPU *cpu, IADDR pc, char *name, ...) +cgen_trace_extract (SIM_CPU *cpu, IADDR pc, const char *name, ...) { va_list args; int printed_one_p = 0; - char *fmt; + const char *fmt; va_start (args, name); @@ -199,7 +199,7 @@ cgen_trace_extract (SIM_CPU *cpu, IADDR pc, char *name, ...) do { int type,ival; - fmt = va_arg (args, char *); + fmt = va_arg (args, const char *); if (fmt) { @@ -224,7 +224,7 @@ cgen_trace_extract (SIM_CPU *cpu, IADDR pc, char *name, ...) } void -cgen_trace_result (SIM_CPU *cpu, char *name, int type, ...) +cgen_trace_result (SIM_CPU *cpu, const char *name, int type, ...) { va_list args; @@ -270,7 +270,7 @@ cgen_trace_result (SIM_CPU *cpu, char *name, int type, ...) This is only for tracing semantic code. */ void -cgen_trace_printf (SIM_CPU *cpu, char *fmt, ...) +cgen_trace_printf (SIM_CPU *cpu, const char *fmt, ...) { va_list args; diff --git a/sim/common/cgen-trace.h b/sim/common/cgen-trace.h index 6e860de..fcf50e9 100644 --- a/sim/common/cgen-trace.h +++ b/sim/common/cgen-trace.h @@ -24,9 +24,9 @@ void cgen_trace_insn_init (SIM_CPU *, int); void cgen_trace_insn_fini (SIM_CPU *, const struct argbuf *, int); void cgen_trace_insn (SIM_CPU *, const struct cgen_insn *, const struct argbuf *, IADDR); -void cgen_trace_extract (SIM_CPU *, IADDR, char *, ...); -void cgen_trace_result (SIM_CPU *, char *, int, ...); -void cgen_trace_printf (SIM_CPU *, char *fmt, ...); +void cgen_trace_extract (SIM_CPU *, IADDR, const char *, ...); +void cgen_trace_result (SIM_CPU *, const char *, int, ...); +void cgen_trace_printf (SIM_CPU *, const char *fmt, ...); /* Trace instruction results. */ #define CGEN_TRACE_RESULT_P(cpu, abuf) \ |