[PATCH 04/14] gdb/testsuite: Avoid fake failures when exit is unreliable
Anton Kolesov
Anton.Kolesov@synopsys.com
Tue Feb 25 07:47:00 GMT 2020
> -----Original Message-----
> From: Shahab Vahedi
> Sent: Tuesday, February 18, 2020 18:42
> To: Luis Machado <luis.machado@linaro.org>; Shahab Vahedi
> <shahab.vahedi@gmail.com>; gdb-patches@sourceware.org
> Cc: Francois Bedard <fbedard@synopsys.com>; Anton Kolesov
> <akolesov@synopsys.com>
> Subject: Re: [PATCH 04/14] gdb/testsuite: Avoid fake failures when exit is
> unreliable
>
> On 2/11/20 9:10 AM, Luis Machado wrote:
> > Hi,
> >
> > On 2/7/20 11:59 AM, Shahab Vahedi wrote:
> >> From: Anton Kolesov <Anton.Kolesov@synopsys.com>
> >>
> >>
> >> This patch makes those tests conditional - they run only if exit is
> >> reliable.
> >
> > I don't know about this one. Doesn't your debugging stub have a way of
> detecting a call to exit, for example?
>
> There is some testglue (gdb_tg.o) that prints to stdout if exit has happened
> with values other than 0. However, I believe the issue here is about running on
> a board. Anton is the best for responding to this.
ARC gdb-servers don't detect call to exit - they are mostly "dumb" stubs that
defer to GDB client to do the application-level work, or in this case it is
testsuite's job to detect that _exit has been called. In general test suite
handle this properly - it sets breakpoint at _exit call and treats first
argument to invocation as exit code, however certain test cases expect
application to really exit, and IIRC the purpose of this patch is to skip
those test on a baremetal target - we'd need a semihosting library or equivalent,
and that is not fully supported in ARC gdbservers - or better to say it is not
supported at all in most of them.
>
> >
> > These changes seem to indicate you are using some custom/modified
> dejagnu board to run your tests. Is your target a qemu/probe that gdb
> connects to and then does the tests?
> That is correct. The target has never been qemu/probe. I believe it has been
> the in-house simulator and also some real boards.
I've used proprietary simulator with built-in GDB-server and OpenOCD. There is
also support for ARC in other GDB-servers developed by Synopsys and
3rd-parties, each being a distinct implementation. Board files can be found at
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/blob/arc-releases/dejagnu/baseboards/arc-nsim.exp
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/blob/arc-releases/dejagnu/baseboards/arc-openocd.exp
and their dependencies are in the same GitHub repository.
More information about the Gdb-patches
mailing list