This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] testsuite/boards/stabs.exp
- From: Doug Evans <xdje42 at gmail dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Sat, 13 Dec 2014 23:05:16 -0800
- Subject: Re: [PATCH] testsuite/boards/stabs.exp
- Authentication-results: sourceware.org; auth=none
- References: <m3d27ni060 dot fsf at seba dot sebabeach dot org> <87ioheviwk dot fsf at codesourcery dot com>
On Sat, Dec 13, 2014 at 10:34 PM, Yao Qi <yao@codesourcery.com> wrote:
> Doug Evans <xdje42@gmail.com> writes:
>
>> The easiest way for me to remember how to run the testsuite in a certain
>> configuration is if there is a board file for it.
>
> Alternatively, we can referencehttps://sourceware.org/gdb/wiki/TestingGDB ,
> passing CFLAGS_FOR_TARGET='-gstabs' to dejagnu is convenient too, so I
> don't see the necessity to add a new board file to do that.
Not as convenient.
And CFLAGS_FOR_TARGET is actually not the same.
[May seem weird at first, but if you dig into it, it's not that weird.]
a) I can ls testsuite/boards trivially.
b) The testsuite gets the -g* variant to use from the debug_flags board config.
If you specify CFLAGS_FOR_TARGET then that value *and* the
debug_flags board config are passed to gcc.
Plus, -g -gstabs != -gstabs -g.
[I didn't dig into why, easy enough if it becomes important.]
The high order bit is that the right way to specify the flag
to control the debug format is with the debug_flags board config.
The difference can be seen by trying both.
A simple example to play with is gdb.cp/bool.exp.
check-gdb --target_board=stabs bool.exp
-> 2 fails
FAIL: gdb.cp/bool.exp: print return_true()
FAIL: gdb.cp/bool.exp: print return_false()
check-gdb CFLAGS_FOR_TARGET=-gstabs bool.exp
-> 2 passes
Is there something about adding a board file that causes problems I'm
not aware of?
If so, we'd better establish what it is and get it written down.
I can imagine wanting more board files. :-)