Tool/software: Code Composer Studio
I'm facing an issue with the TI DSS debug scripting. My code is C++ based, using the TI simulator, and I am trying to set a breakpoint on an ASM label inside a class function, and:
- Read a local variable address
- Read a private class variable address
I am able to set the breakpoint, but upon trying to read the variable addresses, it’s as if they were not in scope.
My code looks something like this (compiled with no optimization):
myClass.h:
class MyClass
{
private:
int m_Var;
public:
MyClass() : m_Var(0) {}
void calc(void)
{
int local = 0;
local++;
asm(" .global dump\ndump: "); //label for breakpoint
local++;
}
}
My DSS script looks like this:
var script = ScriptingEnvironment.instance();
ds = script.getServer("DebugServer.1");
var ds;
ds.setConfig(...); //simulator
var debugSession0 = ds.openSession(".*_0");
debugSession0.target.connect();
debugSession0.memory.loadProgram(...);
var pcsave = debugSession0.symbol.getAddress("dump");
debugSession0.breakpoint.add(pcsave);
debugSession0.target.run();
debugSession0.target.waitForHalt();
if(debugSession0.expression.evaluate("PC") == pcsave)
{
print(pcsave)
var my_address = debugSession0.symbol.getAddress("local");
print(my_address);
var my_address = debugSession0.symbol.getAddress("this->m_Var"); //tried with (*this).m_Var as well, and with .expression.evaluate
print(my_address);
debugSession0.target.run();
}
Presumably the debugger should see both variables as the breakpoint stops at the label and they should be in scope, but I am getting „Unable to get address for symbol” errors from DSS.
Can anybody please help me with this issue?