From 680a009690a7f0a74d4ac595a8ac89cccf402f0d Mon Sep 17 00:00:00 2001 From: dragonmux Date: Wed, 22 Jun 2022 16:50:04 -0400 Subject: [PATCH] cortexm: Added additional debug information for part probing --- src/target/cortexm.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/target/cortexm.c b/src/target/cortexm.c index 83f9823..70f00a8 100644 --- a/src/target/cortexm.c +++ b/src/target/cortexm.c @@ -378,8 +378,25 @@ bool cortexm_probe(ADIv5_AP_t *ap) } else { target_check_error(t); } +#if PC_HOSTED +#define STRINGIFY(x) #x #define PROBE(x) \ - do { if ((x)(t)) {return true;} else target_check_error(t); } while (0) + do { \ + DEBUG_INFO("Calling " STRINGIFY(x) "\n"); \ + if ((x)(t)) \ + return true; \ + else \ + target_check_error(t); \ + } while (0) +#else +#define PROBE(x) \ + do { \ + if ((x)(t)) \ + return true; \ + else \ + target_check_error(t); \ + } while (0) +#endif switch (ap->ap_designer) { case AP_DESIGNER_FREESCALE: