qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] target-arm: return the right exit code when usi


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] target-arm: return the right exit code when using semi-hosting.
Date: Fri, 18 Feb 2011 16:13:27 +0000

On 18 February 2011 15:45, Christophe Lyon <address@hidden> wrote:
> On ARM, the SYS_EXIT semi-hosting call has no room for application
> exit code, hence exiting a program from qemu always returns 0.
>
> This patch catches to argument passed to exit() and uses it as the
> return code when processing SYS_EXIT.

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
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.

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.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]