Re: [RFAv3 2/6] Improve process exit status macros on MinGW

Pedro Alves
2019-05-27T17:33:15Z

On 5/4/19 5:17 PM, Philippe Waroquiers wrote:
> gdb/ChangeLog
> 2019-05-04 Eli Zaretskii <eliz@gnu.org>
> Philippe Waroquiers <philippe.waroquiers@skynet.be>
>
> * common/gdb_wait.h (WIFEXITED, WIFSIGNALED, WEXITSTATUS,
> WTERMSIG): Define better versions for MinGW.
> * windows-nat.c (xlate): Uncomment the definition.
> (windows_status_to_termsig): New function.

windows-nat.c looks like the wrong place to put this.

windows-nat.c is only included in the build if building a native
debugger. But, you need this functionality on every Windows-hosted build
of GDB, even cross debuggers. So I think you're breaking the build on
the Windows-hosted, non-native-debugger case.

E.g., --host=mingw --target=arm-none-eabi.

The right place would be mingw-hdep.c.

I admit to being a bit confused about why we want to do this
translation for this feature while we don't do it for the exit code
of inferiors running under gdb, for example. I mean, exit status
with 0xc0000000 set don't cause $_exitsignal to be set instead of
$_exitcode.

Thanks,
Pedro Alves