Reputation: 1972
I am beginning to learn C from here. I was learning to use valgrind in Chapter-5, Exercise-4. The problem is explained in source-code window-17 on this page.
Upon Valgrind'ing the file (ex4.c), my output lacks from the Valgrind output shown on this page in the following ways;
???
instead of _itoa_word (_itoa.c:195)
Location of line numbers in C library files are not identified. Instead, the path to the shared library file (.so) is given.
WHAT I EXPECT
==3082== Use of uninitialised value of size 8
==3082== at 0x4E730EB: _itoa_word (_itoa.c:195)
==3082== by 0x4E743D8: vfprintf (vfprintf.c:1613)
==3082== by 0x4E7E6F9: printf (printf.c:35)
WHAT I GET
==14647== at 0x407D256: ??? (in /lib/tls/i686/cmov/libc-2.11.1.so)
==14647== by 0x4080B89: vfprintf (in /lib/tls/i686/cmov/libc-2.11.1.so)
==14647== by 0x40882BF: printf (in /lib/tls/i686/cmov/libc-2.11.1.so)
Please tell me how can I correct my valgrind output. I am using Ubuntu-10.10, 32 bit version. I installed Valgrind-3.8.1 using source. My gcc version is 4.3.3 and glibc version 2.11.1
Upvotes: 0
Views: 168
Reputation: 3206
Some Linux distributions come with libraries that have had their symbols stripped out. The resultant libraries are much smaller, but lack the function names you need to debug them in gdb or valgrind.
You can usually find a package that has the debug symbols for each one of these libraries. On Ubuntu, for example, it's the library's package name with a "-dbg" suffix. For the C library libc6, it's libc6-dbg. Install it with:
sudo aptitude install libc6-dbg
Upvotes: 1