Hi I was testing one of my application written using libdw library provided by elfutils-0.141/elfutils-0.137 and it consistently hit error with dwarf_getscopes(). API returned -1 and dwarf_errmsg() returned (null). This problem was observed when the application is made to run over 64 bit vmlinux (with debug info) image, The function address are 64 bit and of the format 0xffffffff800aa89f. Same code works fine with other non vmlinux executables, in which address is 32 bit, Same code works fine on ppc64 and on 64 bit vmlinux image on that machine.
--------------------------------------------------------------------------- Ex: Pseudo code of what I was trying
#define Addr 0xffffffff800aa956 <== Hard Coded function pc
int main(int argc, char *argv[]) { fd = open_file(argv[1] /* Vmlinux Executable */); elf_descriptor = elf_begin(fd, elf_cmd, (Elf *) 0); dbg = dwarf_begin_elf(elf_descriptor, dwarf_cmd, NULL); process_debug_information(dbg) }
int process_debug_information(Dwarf *dbg, Dwarf_Addr *addr) { Dwarf_Die result_cu; Dwarf_Die *cu_die;
//Find the Required Compiler Unit cu_die = dwarf_addrdie(dbg,Addr,&result_cu); <== PASS
//Find the required Function Die nscopes = dwarf_getscopes(cu_die,addr, &scopes); <== FAIL /* This returns -1 and dwarf_errmsg() returns null */ }
--------------------------------------------------------------------------- If some can help me with this bug fixing it will be of great help
Thanks Sharyathi Nagesh