Hello,
I'm basically trying to query the value of a struct element using a DSS script (.js) where the only instance of the struct I have is a pointer.
For example the code is something along the lines of:
...
typedef struct
{
INT32 my_element_a;
BOOL my_element_b;
UINT16 my_element_c;
}my_struct;
...
my_struct* my_struct_pointer;
...
My script (after connecting to the target and stopping at the appropriate breakpoint) does the following:
var my_address = debugSession.symbol.getAddress("my_struct_pointer->my_element_c")
var my_data = debugSession.memory.readData(Memory.Page.DATA, my_address, 16)
I am finding the following runtime error when my script reaches these lines:
getAddress: ENTRY sSymbol: my_struct_pointer->my_element_c
getAddress: Getting symbol package
getAddress: Looking-up symbol
SEVERE: Unable to get address for symbol: my_struct_pointer->my_element_c
1. How should one correctly access such variables (note that I have also tried java-like syntax of my_struct_pointer.my_element_c)?
2. As an aside, if the struct were constant, should I be querying the PROGRAM or DATA page? As I understand it, although my pointer would be in DATA memory, the address that I am searching for is in PROGRAM (non-volatile) memory, so I assume PROGRAM is correct in such a case; correct assumption?
Many thanks,
--
Joshua