From: Mark Wooding Date: Thu, 7 Nov 2019 01:31:29 +0000 (+0000) Subject: base/regdump.c: Be helpful about VFP/NEON registers before `regdump_init'. X-Git-Tag: 2.5.2~1 X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/commitdiff_plain/b26c78631d7d8a991d60876035ef68bb904d4684 base/regdump.c: Be helpful about VFP/NEON registers before `regdump_init'. On ARM32 (only), you really /must/ call `regdump_init' before dumping VFP/NEON registers because otherwise there's no way to tell that they need saving -- so they aren't and an important pointer is left null. Rather than crashing, detect this and print a message explaining why the register can't be dumped. --- diff --git a/base/regdump.c b/base/regdump.c index 2fc0f997..c591fd5a 100644 --- a/base/regdump.c +++ b/base/regdump.c @@ -857,6 +857,13 @@ void regdump(const void *base, const char *lbl, uint32 f) case REGSRC_FP: case REGSRC_SIMD: map = (const struct regmap *)base; + if (!map->fp) { + printf(";;"); + if (lbl) printf(" %s:", lbl); + if (reg) printf(" %s =", reg); + printf(" #\n"); + return; + } if (ix == REGIX_FPSCR) { assert(!(f®F_FMTMASK)); dump_fpflags(lbl, map->fp->fpscr);