From: Sebastian M. <me...@ab...> - 2012-11-23 17:11:00
|
Hello Developers, I am using your libdwarf (0.6.1) in some proof-of-concept code to parse Dwarf debug info. While it works quite nice my "normal" Dwarf3&4 binaries, I run into trouble with the debug_types section (If I force the creation with g++-4.7 -gdwarf-4 -fdebug-types-section). My question: Is it possible you do not yet support that section? Do you plan to support it? If so: How & when? Or is my binary just broken (it's a very minimal example with forced debug_types section). What I did seems correct to me: > rc = dwarf_init(fd, DW_DLC_READ, NULL, NULL, &dbg, &de); > check_rc("dwarf_init", rc, true); > > rc = dwarf_get_types(dbg, &types, &count, &de); > check_rc("dwarf_get_types", rc, false); > > printf("Got %lli elements\n", count); > if(count > 0) { > for(int i = 0; i < count; i++) { > rc = dwarf_typename(types[i], &str, &de); > if(rc != DW_DLV_OK) str = "[invalid]"; > printf("Type #%i is %s\n", i, str); > } > } Output -- every . is an invalid char (like 0x004): > Type #0 is � > Type #1 is > Type #2 is L.. > Type #3 is ... > Type #11 is > Type #12 is .int > Type #13 is > Type #14 is w > Type #15 is . ... > Type #16 is U According to the docs the function should be used with the ".debug_typename" section, but according to the source it works on the ".debug_types"... Note: The SGI libdwarf seems to support the debug_types section since version 20111030. Though I didn't try it out on my example (I can do that next week, if you want to ;)). Thanks for any hints to what I might be missing (& thanks for the library :) Sebastian -------------------------------------- Sebastian Meyer ------------- AbsInt Angewandte Informatik GmbH Email: me...@Ab... Science Park 1 Tel: +49-681-38360-58 66123 Saarbrücken Fax: +49-681-38360-20 GERMANY WWW: http://www.AbsInt.com -------------------------------------------------------------------- Geschäftsführung: Dr.-Ing. Christian Ferdinand Eingetragen im Handelsregister des Amtsgerichts Saarbrücken, HRB 11234 |