From ad52cfc13750662fd003565e8035bb8ffbd4f0ef Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Fri, 29 Oct 2021 23:02:09 +0200 Subject: hw/sh4: Change debug printfs to traces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson Message-Id: [PMD: Fixed format strings for 32-bit hosts] Signed-off-by: Philippe Mathieu-Daudé --- hw/sh4/sh7750.c | 8 +++----- hw/sh4/trace-events | 3 +++ hw/sh4/trace.h | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 hw/sh4/trace-events create mode 100644 hw/sh4/trace.h (limited to 'hw/sh4') diff --git a/hw/sh4/sh7750.c b/hw/sh4/sh7750.c index ca7e261..6c702d6 100644 --- a/hw/sh4/sh7750.c +++ b/hw/sh4/sh7750.c @@ -32,6 +32,7 @@ #include "hw/sh4/sh_intc.h" #include "hw/timer/tmu012.h" #include "exec/exec-all.h" +#include "trace.h" #define NB_DEVICES 4 @@ -147,15 +148,11 @@ static void porta_changed(SH7750State *s, uint16_t prev) uint16_t currenta, changes; int i, r = 0; -#if 0 - fprintf(stderr, "porta changed from 0x%04x to 0x%04x\n", - prev, porta_lines(s)); - fprintf(stderr, "pdtra=0x%04x, pctra=0x%08x\n", s->pdtra, s->pctra); -#endif currenta = porta_lines(s); if (currenta == prev) { return; } + trace_sh7750_porta(prev, currenta, s->pdtra, s->pctra); changes = currenta ^ prev; for (i = 0; i < NB_DEVICES; i++) { @@ -182,6 +179,7 @@ static void portb_changed(SH7750State *s, uint16_t prev) if (currentb == prev) { return; } + trace_sh7750_portb(prev, currentb, s->pdtrb, s->pctrb); changes = currentb ^ prev; for (i = 0; i < NB_DEVICES; i++) { diff --git a/hw/sh4/trace-events b/hw/sh4/trace-events new file mode 100644 index 0000000..4b61cd5 --- /dev/null +++ b/hw/sh4/trace-events @@ -0,0 +1,3 @@ +# sh7750.c +sh7750_porta(uint16_t prev, uint16_t cur, uint16_t pdtr, uint16_t pctr) "porta changed from 0x%04x to 0x%04x\npdtra=0x%04x, pctra=0x%08x" +sh7750_portb(uint16_t prev, uint16_t cur, uint16_t pdtr, uint16_t pctr) "portb changed from 0x%04x to 0x%04x\npdtrb=0x%04x, pctrb=0x%08x" diff --git a/hw/sh4/trace.h b/hw/sh4/trace.h new file mode 100644 index 0000000..e2c1332 --- /dev/null +++ b/hw/sh4/trace.h @@ -0,0 +1 @@ +#include "trace/trace-hw_sh4.h" -- cgit v1.1