|
From: Y G. A. N. <gir...@ap...> - 2007-11-09 10:28:58
|
Hi Valgrinders, What are my options if I wanted to use valgrind in a static linking environment (say, something like busybox). I searched for documents and list archives and this is a summary of what I discovered: [1] http://article.gmane.org/gmane.comp.debugging.valgrind/3 Based on the above, it is probably possible to link coregrind and memcheck object files statically and generate a binary that runs under valgrind's control. I tried this (used vg 3.2.3) and failed. I - Added VEX/libvex_x86_linux.a to the list of libs to be linked in - removed one of coregrind/libcoregrind_x86_linux_a-m_debuglog.o coregrind/valgrind-m_debuglog.o because they were the same file. - moved coregrind/valgrind-launcher.o out of the way because it did not do much for my purpose. After that I did not understand how I should be avoiding the re-definition of main (my own and coregrind/m_main.c) and _start (crt1.o and coregrind/m_main.c). Is it possible that I call my own main sometime in coregrind/m_main.c:main()? What do I do with _start? I used collect2 directly (instead of ld) and avoided linking in crt1.o but I could not make much headway after that. I came across this: [2] http://article.gmane.org/gmane.comp.debugging.valgrind/1230 Which indicates that things have changed from 2.1.0 to 2.1.1 and the earlier thread that I found was from pre-2.1.0 era. [3] http://article.gmane.org/gmane.comp.debugging.valgrind/4906 What does "visible symbol table entry for the function to be intercepted" mean? From this thread also, it looks like linking valgrind code statically to other code is not easy. Is it possible to use valgrind the way I am trying to? Cheers, Giridhar --=20 Y Giridhar Appaji Nag | http://www.appaji.net/ |