Re: isremote and unix board special handling question

Pedro Alves <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
On 11/28/2018 02:27 AM, Ben Elliston wrote:
> On Tue, Nov 27, 2018 at 06:53:17PM -0600, Jacob Bachmeyer wrote:
> 
>> As we see, set_board_info only works if the specified /entry/ has not
>> already been defined.
> 
> That is consistent with the manual:
> 
>   @node set_board_info procedure, [...]
>   This checks if @code{board_info} array's field @emph{entry} has been
>   set already and if not, then sets it to @emph{value}.
> 
> Rob, I never understood why this was so. Why not just override board
> settings? Perhaps that explains why I have seen DejaGnu baseboard
> definitions that modify the board_info array directly rather than go
> via proc set_board_info.

Yeah, GDB does in its internal board files.  Non-remote boards source
a file with this:

~~~~~
  16 # By default, DejaGnu makes the board remote unless the board name
  17 # matches localhost.  Sourcing this script from a board file forces
  18 # the board to be NOT remote.
  19 
  20 global board
  21 global board_info
  22 # Remove any target variant specifications from the name.
  23 set baseboard [lindex [split $board "/"] 0]
  24 set board_info($baseboard,isremote) 0
~~~~~

That's from:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/testsuite/boards/local-board.exp;h=df9e5bf588d13b6fe535439e51c6f5fd1ed231fb;hb=HEAD

Thanks,
Pedro Alves
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.