Re: [PATCH v2] Exit code of exited inferiors

Simon Marchi
2013-06-17T17:57:28Z

On 13-06-17 12:37 PM, Pedro Alves wrote:
> On 06/17/2013 05:04 PM, Simon Marchi wrote:
>> On 13-06-06 12:50 PM, Pedro Alves wrote:
>>> Please also make sure the test works with gdbserver, with:
>>>
>>> make check RUNTESTFLAGS="--target_board=native-gdbserver"
>>>
>>> Thanks,
>>
>> Hmm, it seems that testing with gdbserver doesn't handle arguments passing, so it doesn't work. How could it be done?
>
> We haven't seen exit-code.c yet :-) but I imagine that it just
> returns a different error code depending on the argument?
> You could instead make gdb run to main, and then set a global in the
> program with the desired return code. Or build two programs, and pick
> the return code depending on a macro. You can pass additional_flags=-Dfoo=bar
> to prepare_for_testing/gdb_compile to define macros/symbols. Several
> examples on that in the testsuite.
>
> Do note:
> http://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Make_sure_test_executables_are_unique
>

Thanks, I chose the global variable solution.