If you have two symbols with the same name (but pointing to different memory locations), it is totally the correct approach, to use the fully qualified symbol path names for both memory locations.
To find the fully symbol path names open the TRACE32 GUI, load your application and open the window sYmbol.Browse.sYmbol (via the command line or via Menu>View>Symbols>Browse). In the window sYmbol.Browse.sYmbol replace the last asterisk in the upper left corner by the name of your symbol. This should look like this:
In my case the symbol is called "mcount". As you can see I have it twice.
Now move the slider in the left lower corner (left to the horizontal scroll bar) to the right and you will see the fully qualified symbol name:
The columns labeled with "path" and "symbol" show now together the fully qualified symbol names.
In my example the full symbol name of my first variable is \\sieve\itm\mcount
, which means that this symbol comes from the module "itm" in the ELF file "sieve". (A module is a compilation unit aka. an object-file)
If you have two symbols with the same name in the same ELF which are in two different modules, which also have the same name, TRACE32 will extend the module name by parts of the file path to have again unique symbol path names.
Alternatively you can also replace the module name by the file path (of the underlying source file) in double-quotes. E.g. like this: \\sieve\"C:\project\src\itm.c"\mcount
Finally use the fully qualified symbol name with the API function T32_GetSymbol() to get the symbol's address via the remote API. E.g.: Like this
int main(void)
{
const char *symbol = "\\\\sieve\\itm\\mcount";
uint32_t address, size, reserved;
T32_Config( "NODE=", "localhost");
if ( T32_Init() != T32_OK )
exit(-1);
if (T32_Attach(1) != T32_OK)
exit(-2);
if (T32_GetSymbol (symbol, &address, &size, &reserved) == T32_OK)
printf("Symbol %-30s is at address 0x%08X with size %d\n", symbol, address, size);
T32_Exit();
return 0;
};