This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] testsuite/boards/stabs.exp


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.  :-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]