Hello!
I have two questions regarding Debug Server Scripting (DSS). First: it's really a nice way to automate things, e.g. loading and executing an executable with a standalone batch file which can included in an automatic build process.
Now I also want to automate execution profiling/ benchmarking and also verification, i.e. I use the profiling clock and a DSP-internal timer to count the clock cycles the algorithm takes. For verification purpose I also want to read back the results and compare against a gold model.
Robust way of setting breakpoints
You can set breakpoints using the activeDS.breakpoint.add() method. I have seen two options:
- calling activeDS.symbol.getAddress("my_function") first on a function name (symbol)
- calling activeDS.breakpoint.add("main.c", 76) to set a breakpoint at a specific line in a specific source code file.
Now assume that I have (at least partly) auto-generated code. I can use the getAddress("my_function"), but I want to stop before the function is called. With the current method it seems, that the function was already entered. In my belief the stack is then already set up. The problem is: the local variables of my calling function are out of scope, but I want to read or modify them before the function call.
Is there an easy way to accomplish this?
As an alternative I have tried using the second approach with setting the breakpoint at a specific line number. This sets a breakpoint before the function call, which is fine. The problem: I am not very flexible concerning code-generation here. That means the location of the function call will move within the source file and I'd have to modify the DSS script manually after every automatic code genration -- which would not be straight-forward.
Is there a way to determine the addresses of specific function calls? This would also be interesting if I called a function from different originating locations.
Reading a value
I want to read the value of a variable in the DSS script. I have figured out that this can be done using
- activeDS.expression.evaluate("my_varname")
Is there an even smarter way to read a variable? Or a specifc memory location?
Thank you for your help.
Best regards,
Matthias
