This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Exit code of exited inferiors
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: Eli Zaretskii <eliz at gnu dot org>, gdb-patches at sourceware dot org, marc dot khouzam at ericsson dot com
- Date: Mon, 17 Jun 2013 17:37:43 +0100
- Subject: Re: [PATCH v2] Exit code of exited inferiors
- References: <51A5160D dot 40800 at ericsson dot com> <83k3mh6ant dot fsf at gnu dot org> <51A6263A dot 9080104 at ericsson dot com> <51B0BDBC dot 9030909 at redhat dot com> <51BF3393 dot 30002 at ericsson dot com>
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
--
Pedro Alves