systemtap : Able to access local variables but cannot access local pointers -


i have dumb question, wanted understand source code flow of system tap, trying access local variable using kernel.statement probe function, displays other variable except pointers.

probe module("module_path/proc_rw.ko").statement("my_write@module src path/proc_rw.c+9") {     printf("local = %s\n", $$locals) }   module code : static ssize_t my_write(struct file *f, const char __user *buf, size_t len, loff_t *off) {         pid_t pid;         int ret;         struct task_struct *task_local;         int *i;                ret=copy_from_user(c, buf, len);         i=&ret;         pid=simple_strtol(buf, null, 10);         task_local=pid_task(find_vpid(pid), pidtype_pid);         return len; } 

when execute above stap code, returns,

local = pid=0xf98 ret=0x0 task_local=? i=?

any understand why task_local , values not printed helpful.

regards, yash.

what you're seeing here artefact of compiler optimization. variables no longer used may have resources released (registers or stack frame slots reused), though theoretically in scope, there may no value read more.

you'd see same thing if ran gdb on analogous program , stepped far-down line, tried print variables. or try:

stap -l 'module("module_path/proc_rw.ko").statement("my_write@*:*")' 

to see dump of statements & variables available @ each.

also, see https://lkml.org/lkml/2015/4/23/605 kernel patch aimed undo recent (2014-10) undesirable reduction in debuginfo quality. (it wasn't merged.) can fix own module customizing own makefile.


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

java - Log4j2 configuration not found when running standalone application builded by shade plugin -

python - How do I create a list index that loops through integers in another list -