[Pdbg] [PATCH 2/2] libpdbg: Add diagnostic trace information for FSI
Alistair Popple
alistair at popple.id.au
Fri Mar 27 12:30:16 AEDT 2020
Signed-off-by: Alistair Popple <alistair at popple.id.au>
---
libpdbg/target.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/libpdbg/target.c b/libpdbg/target.c
index 8cc6f7f..501e019 100644
--- a/libpdbg/target.c
+++ b/libpdbg/target.c
@@ -226,22 +226,31 @@ int opb_write(struct pdbg_target *opb_dt, uint32_t addr, uint32_t data)
int fsi_read(struct pdbg_target *fsi_dt, uint32_t addr, uint32_t *data)
{
struct fsi *fsi;
+ int rc;
uint64_t addr64 = addr;
fsi_dt = get_class_target_addr(fsi_dt, "fsi", &addr64);
fsi = target_to_fsi(fsi_dt);
- return fsi->read(fsi, addr64, data);
+
+ rc = fsi->read(fsi, addr64, data);
+ PR_DEBUG("rc = %d, addr = 0x%05" PRIx64 ", data = 0x%08" PRIx32 ", target = %s\n",
+ rc, addr64, *data, pdbg_target_path(&fsi->target));
+ return rc;
}
int fsi_write(struct pdbg_target *fsi_dt, uint32_t addr, uint32_t data)
{
struct fsi *fsi;
+ int rc;
uint64_t addr64 = addr;
fsi_dt = get_class_target_addr(fsi_dt, "fsi", &addr64);
fsi = target_to_fsi(fsi_dt);
- return fsi->write(fsi, addr64, data);
+ rc = fsi->write(fsi, addr64, data);
+ PR_DEBUG("rc = %d, addr = 0x%05" PRIx64 ", data = 0x%08" PRIx32 ", target = %s\n",
+ rc, addr64, data, pdbg_target_path(&fsi->target));
+ return rc;
}
int fsi_write_mask(struct pdbg_target *fsi_dt, uint32_t addr, uint32_t data, uint32_t mask)
--
2.20.1
More information about the Pdbg
mailing list