target: armv8: Avoid semihosting segfault on halt

Avoid a NULL pointer dereference when halting an aarch64 core.

Change-Id: I333d40475ab26e2f0dca5c27302a5fa4d817a12f
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/4593
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
bscan_tunnel
Andreas Färber 2018-07-08 19:52:06 +02:00 committed by Matthias Welwarsky
parent 0aa8e8cfc3
commit b82ee0799f
1 changed files with 1 additions and 1 deletions

View File

@ -1063,7 +1063,7 @@ int armv8_aarch64_state(struct target *target)
armv8_mode_name(arm->core_mode),
buf_get_u32(arm->cpsr->value, 0, 32),
buf_get_u64(arm->pc->value, 0, 64),
target->semihosting->is_active ? ", semihosting" : "");
(target->semihosting && target->semihosting->is_active) ? ", semihosting" : "");
return ERROR_OK;
}