Re: isremote and unix board special handling question
Jacob Bachmeyer <[email protected]>
| Newsgroups | gmane.comp.sysutils.dejagnu.general |
|---|---|
| Message-ID | <[email protected]> |
Steve Ellcey wrote:
> I have a question about the special handling of the 'unix' name in
> dejagnu. I am doing some GCC testing which uses dejagnu and I
> want to create a new baseboard (unix-sysroot) which is just like
> unix but sets ldflags so I can run GCC with a newly built glibc
> in a non-standard location.
>
My first guess is that you might want a new target, rather than a new
board ... oh, the manual seems to be silent on the matter. Read on for
details and a possible workaround.
> [...]
>
> Now when I did this, the GCC testsuite tried to run the testsuite
> as if unix-sysroot was a remote system. I was told I needed to
> set isremote to 0 so I put 'set_board_info isremote 0' in my
> unix-sysroot.exp file but it doesn't seem to be working. When
> I run dejagnu with -v options I see:
>
> board is unix-sysroot, isremote is 1
>
> [...]
>
> Does anyone know why setting isremote is not working? I put it in
> the beginning, end, and middle of my unix-sysroot.exp with no apparent
> affect. Is this why the exception for "unix" is still in framework.exp
> because isremote is not working? The code to check isremote in
> framework.exp looks correct, it seems more like my setting of isremote
> is either not taking effect or is getting overridden somewhere.
Another item on my TODO list is improving DejaGnu's manual, so I went
digging on this. First stop: set_board_info in lib/targetdb.exp; this
code is ancient, going substantially back to the "Initial revision":
==
proc set_board_info { entry value } {
global board_info board
if {![info exists board_info($board,$entry)]} {
set board_info($board,$entry) $value
}
}
==
As we see, set_board_info only works if the specified /entry/ has not
already been defined. So how is "set_board_info isremote 0" not
working? A grep for "set_board_info.*isremote" turns up nothing... a
broader pattern turned up this in load_board_description in runtest.exp
and similar logic in load_base_board_description:
==
if {![info exists board_info($whole_name,isremote)]} {
set board_info($whole_name,isremote) 1
if {[info exists board_type]} {
if { $board_type == "build" } {
set board_info($whole_name,isremote) 0
}
}
if { ${board_name} == [get_local_hostname] } {
set board_info($whole_name,isremote) 0
}
}
==
This is, of course, *before* actually loading the board description
file, so "set_board_info isremote" has no effect.
The simple workaround: insert "unset_board_info isremote" before
"set_board_info isremote 0".
-- Jacob