1

I'm currently writing some kind of a "skeleton" for tests to be performed using Lauterbach scripts.

In this skeleton I want to have a part in which all test specific definitions shall be done, e.g. functions to set breaks on, variables to be altered etc. This part shall be just near the top of the script file, so that other users do not have to go through the complete script file, changing values here and there.

Some of the variables that'll be used are defined function-local within the C-code to be tested. So, these become available to the Lauterbach script only once the scope of that function has been entered - which is deeply within the skeleton script code.

Is there a way to define a macro for these variables just way before the scope has been entered?

Let's give some example structure:

LOCAL &funcToTest      // the function we want to test
LOCAL &varToBeSet      // a variable within the function we want to alter
LOCAL &valueToBeSet    // the value we want to set &varToBeSet to 
... // some more definitions here
&funcToTest=someFunc
&varToBeSet=status    
&valueToBeSet=1      
... // some test code following here that sets up log files, screen areas
... // start the program to be tested etc.
IF (Register(PC)==ADDRESS.OFFSET(&funcToTest))
(
  // OK - we've hit the breakpoint inside the function to test
  ... // Run to some point where we can set the local variable
  Var.Set &varToBeSet=&valueToBeSet
  ... // Go on with the program and see what happens - this will be logged
)

The problem is that Lauterbach complains at the line &varToBeSet=status with Symbol not found in this context - which is correct, because it is a local variable.

Looking at the symbols via View->Symbols->SymbolsTreeView (or by giving the command Symbol.List.Tree) I can find the symbol (in this particular case found under the node some_module.some_function.status). Clicking on it gives the information in the TRACE32 status status line \\some_app\some_module\some_func\status with type (auto STATUS), scope local, location stack.

Changing my script to read &varToBeSet=\\some_app\some_module\some_func\status instead of &varToBeSet=status, however, does not help much. In this case Lauterbach complains with no access to that symbol.

Is there a way, I can delay evaluation of the macro to some point where it is actually used instead of having it evaluated when it is defined?

Thoran
  • 163
  • 1
  • 9
  • Minor remark: The correct capitalization is "sYmbol.List.TREE". The short command would be "y.l.tree". – dev15 Apr 30 '18 at 09:31

1 Answers1

1

Use quotes:

&varToBeSet="\\some_app\some_module\some_func\status"
dev15
  • 665
  • 3
  • 14