|
From: Golam K. <gol...@te...> - 2017-11-27 01:51:30
|
Hi all, I am very new in Valgrind. I am trying to modify the Memcheck tool. I want to read a thread local variable from the user code when a "*malloc" *family functions is called and then print the value when Memcheck is reporting bugs in "*mc_errors.c*" file. I found an api named " *VG_(lookup_symbol_SLOW)*" from "*pub_core_debuginfo.h*" file. I can read the local and global variables using "*VG_(lookup_symbol_SLOW)*" and print the values with the bug report of Memcheck. As the thread local variables are dynamically reallocated this api can not give me the value of thread local variables. I want to know is there any internal api in valgrind to get the value of a thread local variables? I found an api named : "*valgrind_get_tls_addr*" which is called by the gdbserver using gdb information, is their any similar implementation which can be used in Memcheck tool? I already know the name of the thread local variable. Thanks in advance for the help. -- Regards Golam Kayas |