X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Farmv7m.c;h=7d3bd73674d554e8aa14fd96991418c687a023e6;hb=1ba715422fba733bb5426ea887368e2dcf371b91;hp=1b4e5b154db16fe3af5f0ea134383d8d464b1ea3;hpb=2517bae6c1438350255dca63e7d1c1e06c64b6bb;p=openocd.git diff --git a/src/target/armv7m.c b/src/target/armv7m.c index 1b4e5b154d..7d3bd73674 100644 --- a/src/target/armv7m.c +++ b/src/target/armv7m.c @@ -541,7 +541,7 @@ int armv7m_arch_state(struct target *target) uint32_t ctrl, sp; /* avoid filling log waiting for fileio reply */ - if (target->semihosting->hit_fileio) + if (target->semihosting && target->semihosting->hit_fileio) return ERROR_OK; ctrl = buf_get_u32(arm->core_cache->reg_list[ARMV7M_CONTROL].value, 0, 32); @@ -556,8 +556,8 @@ int armv7m_arch_state(struct target *target) buf_get_u32(arm->pc->value, 0, 32), (ctrl & 0x02) ? 'p' : 'm', sp, - target->semihosting->is_active ? ", semihosting" : "", - target->semihosting->is_fileio ? " fileio" : ""); + (target->semihosting && target->semihosting->is_active) ? ", semihosting" : "", + (target->semihosting && target->semihosting->is_fileio) ? " fileio" : ""); return ERROR_OK; }