[Qemu-devel] [Bug 1216845] Re: qemu-system-arm semihosting always calls exit(0)

2017-11-06 Thread Peter Maydell
With the new 2.0 ARM semihosting ABI, there is an optional extension SYS_EXIT_EXTENDED which can be used to implement returning a non-zero exit code for 32-bit ARM programs: https://developer.arm.com/docs/100863/latest/semihosting-operations /sys_exit_extended-0x20#sh-ext-exit-extended QEMU shoul

Re: [Qemu-devel] [Bug 1216845] Re: qemu-system-arm semihosting always calls exit(0)

2015-02-04 Thread Peter Maydell
On 4 February 2015 at 15:56, Karl Zimmerman wrote: > Had a similar problem with my emulation environment. However, I did > some inspection of the assembly code generated by newlib for ARM semi- > hosting. While it initially appears that exit() and _exit() discard the > status code, upon careful

[Qemu-devel] [Bug 1216845] Re: qemu-system-arm semihosting always calls exit(0)

2015-02-04 Thread Karl Zimmerman
Had a similar problem with my emulation environment. However, I did some inspection of the assembly code generated by newlib for ARM semi- hosting. While it initially appears that exit() and _exit() discard the status code, upon careful inspection one finds that it is pushed on the stack, with th

[Qemu-devel] [Bug 1216845] Re: qemu-system-arm semihosting always calls exit(0)

2015-02-04 Thread Liviu Ionescu
thank you for your suggestion. as semihosting servers I use the j-link gdb server, openocd and qemu. if I got it right, you suggest to modify all these servers to retrieve the exit code from a specific location. as long as this is not documented in the ARM manuals, I cannot recommend such a soluti