On 18.02.2011 17:13, Peter Maydell wrote:
> 
> I'm afraid you've just run into the limitations of semihosting
> as an API again: it doesn't provide a way for programs to pass
Indeed.

> out an exit code, and trying to shoehorn back doors for this
> into qemu just results in ugly code in qemu. The qemu
> implementation of semihosting should implement the semihosting
> API, not semihosting with weird undocumented extras.

Well, exit() is documented in the C ISO standard, so using its argument as exit 
code is doing what the user expects.
 
> If you care about this sort of thing then linux-user mode is
> probably a better approach, as that is actually designed for
> a unixish program to run as-if-natively.

We are using qemu to execute programs compiled in bare machine mode (eg with 
arm-none-eabi-gcc as opposed to arm-none-linux-gnueabi-gcc), where semihosting 
is used to communicate with the host environment. And we lack support for exit 
code.

Christophe.



Reply via email to