This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] sim: constify watchpoint interrupt names
On Tue, Mar 30, 2010 at 6:45 PM, Hans-Peter Nilsson <hp@bitrange.com> wrote:
> On Tue, 30 Mar 2010, Mike Frysinger wrote:
>> On Tuesday 30 March 2010 19:20:56 Hans-Peter Nilsson wrote:
>> > Feel free to commit with a suitable ChangeLog entry if
>> > tests pass.
>>
>> they do pass, and this reminds me of why dejagnu is so damn annoying. ?a
>> simple `make check-sim` fails by default because the sim framework attempts to
>> execute the binary on the host instead of through the sim. ?seems pretty dumb
>> to me.
>
> JFTR, you're supposed to specify a "board", like so:
> "make check-sim RUNTESTFLAGS=--target_board=v850-sim" but you
> know that as you have run tests.
>
> Target executable files always default to the host (through
> "unix.exp" aka. --target_board=unix). ?That you're testing the
> simulator itself by running the target executable files there is
> just a special-case, but anyway I guess it'd be a good idea
> (read: feel free to send patches) for the simulator Makefile.in
> to default to its dejagnu board when running the tests, e.g. to
> default RUNTESTFLAGS to the above. ?...or maybe even better, as
> Doug suggested.
For reference sake,
an alternative to explicitly passing --target_board is to point
$DEJAGNU at a file that specifies what target to use, e.g. based on
target-triplet/tool.
The m32r case I use is mildly interesting. The syntax is clumsy, but
I keep it around to remind me how to automagically run multiple
variations with one "make check".
A "make check" of m32r produces:
=== sim tests ===
Schedule of variations:
m32r-sim/-mmodel=small/-G 0/-m32r
m32r-sim/-mmodel=small/-G 0/-m32rx
m32r-sim/-mmodel=small/-msdata=use -G 8/-m32r
m32r-sim/-mmodel=small/-msdata=use -G 8/-m32rx
m32r-sim/-mmodel=medium/-G 0/-m32r
m32r-sim/-mmodel=medium/-G 0/-m32rx
m32r-sim/-mmodel=medium/-msdata=use -G 8/-m32r
m32r-sim/-mmodel=medium/-msdata=use -G 8/-m32rx
m32r-sim/-mmodel=large/-G 0/-m32r
m32r-sim/-mmodel=large/-G 0/-m32rx
m32r-sim/-mmodel=large/-msdata=use -G 8/-m32r
m32r-sim/-mmodel=large/-msdata=use -G 8/-m32rx
Running target m32r-sim/-mmodel=small/-G 0/-m32r
Using /usr/share/dejagnu/baseboards/m32r-sim.exp as board description
file for target.
[...]
[There's also the MULTIPASS/PASS vars to control running multiple
passes in one "make check" if one wants to do that kind of thing.]
In case it helps, here's $DEJAGNU from one of my systems:
--- snip ---
set run_multiple_targets 1
send_user "target_triplet: $target_triplet\n"
if [info exists tool] {
send_user "tool: $tool\n"
}
switch -glob "$target_triplet" {
"arm-*-elf" {
if { "$tool" == "sim" } {
set target_list { arm-sim }
} else {
set target_list { arm-sid }
}
}
"powerpc-*-*" {
set target_list { powerpc-sim }
}
"powerpcle-*-*" {
set target_list { powerpcle-sim }
}
"m32r-*-elf*" {
if { $run_multiple_targets } {
set target_list
{{{m32r-sim{-mmodel=small,-mmodel=medium,-mmodel=large}{-G
0,-msdata=use -G 8}}{-m32r,-m32rx}}}
} else {
set target_list { m32r-sim }
}
}
"i?86-*-nacl*" {
set target_list "nacl"
}
"i?86-*-*" {
set target_list { unix }
}
"x86_64-*-*" {
set target_list { unix }
}
"i960-*-coff" {
set target_list { i960-sim }
}
"cris-*-elf" {
set target_list { cris-sim }
}
"fr30-*-elf" {
set target_list { fr30-sim }
}
"frv-*-elf" {
set target_list { frv-sim }
}
"ip2k-*-elf" {
set target_list { ip2k-sim }
}
"iq2000-*-elf" {
set target_list { iq2000-sim }
}
"lm32-*-elf" {
set target_list { lm32-sim }
}
"m32c-*-elf" {
set target_list { m32c-sim }
}
"m68hc08-*-*" {
set target_list { m68hc08-sim }
}
"mep-*-elf" {
set target_list { mep-sim }
}
"mt-*-elf" {
set target_list { mt-sim }
}
"openrisc-*-elf" {
set target_list { openrisc-sim }
}
"or32-*-elf" {
set target_list { openrisc-sim }
}
"sh64-*-elf" {
set target_list { sh64-sim }
}
"xc16x-*-elf" {
set target_list { xc16x-sim }
}
"xstormy16-*-elf" {
set target_list { xstormy16-sid }
}
default {
send_user "ERROR: dejagnu.exp Unknown target $target_triplet\n"
exit 1
}
}
if [info exists target_list] {
send_user "target_list: $target_list\n"
} else {
send_user "target_list: unspecified\n"
}