I have a following program:
int b2[4];
int foo()
{
static int b2[10];
b2[5] = 4;
}
int main()
{
static int b2[10];
int b[5];
b[0] = 1;
b2[9] = 4;
int *ptr = b;
int c = *(ptr + 10);
foo();
return 0;
}
I want to distinguish between different b2 arrays defined in functions foo, main and globally. I can collect all the symbols using:
symbols = set(currentProgram.getSymbolTable().getAllSymbols(True))
for s in symbols:
print(s.getName())
But, there is no way to distinguish between static (in functional namespace) and global symbols.
Ghidra GUI shows me something like: b2.1913 <- main , b2.1917 <- foo, b2 <- global.
Thus I can easily distinguish between these symbols using GUI.
Thanks in advanced for your help.