Consider the following C program: ```C int a = 3; void *p = &a; int main(void) { return 0; } ``` Compile it: ``` gcc -Wall -g a.c ``` Then run it with stap: ``` $ stap -e 'probe process.function("main") { p = @var("p"); println(usymname(p)); exit() }' -c ./a.out 0x601020 ``` It fails to return the string "a", which is the global C variable name in the target program. GDB does support resolving global C variables by default. For this example: ``` (gdb) p p $3 = (void *) 0x601020 <a> ``` We've got the variable symbol name `a` in the `p` command output here.
Or just use literal address values in GDB: ``` (gdb) p (void*)0x601020 $6 = (void *) 0x601020 <a> ``` It works too :)