[Bug tapsets/23506] New: tapset function usymname() cannot translate the addresses of C static/global variables
agentzh at gmail dot com
sourceware-bugzilla@sourceware.org
Fri Aug 10 18:13:00 GMT 2018
https://sourceware.org/bugzilla/show_bug.cgi?id=23506
Bug ID: 23506
Summary: tapset function usymname() cannot translate the
addresses of C static/global variables
Product: systemtap
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: tapsets
Assignee: systemtap at sourceware dot org
Reporter: agentzh at gmail dot com
Target Milestone: ---
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.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Systemtap
mailing list