Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall.
Signed-off-by: Luc Michel <lmic...@kalray.eu> --- semihosting/arm-compat-semi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index b6ddaf863a..fad5116f3c 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -1253,12 +1253,11 @@ target_ulong do_common_semihosting(CPUState *cs) * allow the guest to specify the exit status code. * Everything else is considered an error. */ ret = (args == ADP_Stopped_ApplicationExit) ? 0 : 1; } - gdb_exit(ret); - exit(ret); + semihosting_exit_request(ret); case TARGET_SYS_ELAPSED: elapsed = get_clock() - clock_start; if (sizeof(target_ulong) == 8) { SET_ARG(0, elapsed); } else { -- 2.17.1