From: Kai W. <kai...@gm...> - 2012-11-24 17:15:56
|
Hello, The ".debug_types" in the source code is indeed a typo. It should be ".debug_typenames". The DWARF4 .debug_types section is not yet supported by this libdwarf implementation, but we have plans to add support for it in the near future. Thanks for pointing this out. Best Regards, Kai On Fri, Nov 23, 2012 at 05:53:21PM +0100, Sebastian Meyer wrote: > 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 > > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > Elftoolchain-developers mailing list > Elf...@li... > https://lists.sourceforge.net/lists/listinfo/elftoolchain-developers |