Roland Thanks for helping out. I got the problem, even though in Makefile I was specifying the elfutils -0.139 ldd showed that it was linking to libdw/libelf provided by elfutils-0.125 (shipped with system) and elfutils-0.125 is broken. Updating LD_LIBRARY_PATH helped.
Thanks a ton for bearing with me
Regards Sharyathi N
Roland McGrath wrote:
Your test program works correctly for me.
$ ./getscopes -e ~/redhat/tmp/usr/lib/debug/lib/modules/2.6.18-92.el5/vmlinux 0xffffffff800aa956
nscopes: 0 dwarf_getscopes error:no error $
When I debug it to see what's going on, the dwarf_getscopes call returned 2 as expected (not printed here). The line printed actually refers to the dwarf_getscopes_die call, despite the confusing message text. That call returned 0 as expected, since you called it on the CU itself, and by definition there are no containing scopes of a CU.
I tried it with elfutils-0.141-1.fc10.x86_64 on Fedora 10. If 0.139 or 0.140 works differently that's a surprise off hand--I don't recall any relevant fixes, but there might have been some.
Thanks, Roland