Re: [PATCH 2/2] Move loaded_libs check into search_and_load_file

2019-03-07 Thread Jacob Bachmeyer
Ben Elliston wrote: The solution presented here has search_and_load_file take a callback function, this allows the "has this file been loaded already?" check to only be performed for the users that care, while also allowing the check to be deferred until we know exactly which file we are going to

Re: [PATCH 1/2] Use 'file join' to concatenate directory and filename

2019-03-07 Thread Jacob Bachmeyer
Andrew Burgess wrote: In search_and_load_file in once place 'file join' is used to concatenate a directory and a filename, while elsewhere in the function the concatenate is hard coded as a string "$dir/$initfile", assuming that '/' is used to join components. Presumably this is fine for all the

Re: [PATCH 2/2] Move loaded_libs check into search_and_load_file

2019-03-07 Thread Ben Elliston
> The solution presented here has search_and_load_file take a callback > function, this allows the "has this file been loaded already?" check > to only be performed for the users that care, while also allowing > the check to be deferred until we know exactly which file we are > going to load. I al

Re: [PATCH 1/2] Use 'file join' to concatenate directory and filename

2019-03-07 Thread Ben Elliston
On Thu, Mar 07, 2019 at 02:01:56PM +, Andrew Burgess wrote: > * runtest.exp (search_and_load_file): Join the directory and > filename once using 'file join'. Thanks, this is fine. Ben signature.asc Description: PGP signature ___ DejaG

[PATCH 1/2] Use 'file join' to concatenate directory and filename

2019-03-07 Thread Andrew Burgess
In search_and_load_file in once place 'file join' is used to concatenate a directory and a filename, while elsewhere in the function the concatenate is hard coded as a string "$dir/$initfile", assuming that '/' is used to join components. Presumably this is fine for all the targets dejagnu support

[PATCH 2/2] Move loaded_libs check into search_and_load_file

2019-03-07 Thread Andrew Burgess
Some users of search_and_load_file want to load the file only if it has not been loaded before, while others want to always load the file (this is might be because "that's what they've always done" rather than the design, but I'm not sure about that). However, changes to load_tool_init in this com

Re: PATCH: add search path for tool init file (part of fix for Automake

2019-03-07 Thread Andrew Burgess
Jacob, Thanks for your great explanation, and I'll definitely get GDB fixed so we no longer include the tool init file as a library. When you said: > > There's many calls to 'search_and_load_file' in dejagnu (the core of > > things like load_lib and load_tool_init), but only some of them are > >