Greetings all. I intend to merge the DATASYMS branch to trunk shortly. This branch adds the ability to read Dwarf3 type and variable information, and to use that to generate better descriptions of data addresses on thread stacks and in global variables. It also is potentially useful for tools which require descriptions of stack- and global-variables at instrumentation time. Here are a couple of examples of the output it can produce:
Location 0x60103e is 0 bytes inside nonstatic_global_def[2], a global variable declared at varinfo3.c:36 Location 0x7feffba09 is 1 byte inside a[3].xyzzy[21].c2[2], declared at varinfo4.c:45, in frame #1 of thread 1 These descriptions are created by reading Dwarf3 .debug_info section, and associated other sections. This branch also fixes reading of ELF data symbols. So, even if Dwarf3 information for global variables is absent or unreadable for whatever reason, at least the size and address of them is still available. I have modified Memcheck and Helgrind to use this new info. The modifications are trivial, since it merely requires calling the new functions VG_(get_data_description) and/or VG_(get_datasym_and_offset) to get the relevant info. The downside is that reading Dwarf3 is expensive in both time and memory. Despite considerable efforts at tuning, reading this stuff basically doubles the startup time of (eg) konqueror on Memcheck, if not worse, and adds a couple of hundred megabytes to the process size. Consequently, only text- and data-symbol reading are enabled by default. Tools that want Dwarf3 info must ask for it via the "var_info" "need" in the core/tool iface (include/pub_tool_iface.h). Only Helgrind and DRD make this request at present. Memcheck is able to make use of Dwarf3 info if it has been read, but does not read it by default. To allow users to force this information to be read, a flag --read-var-info=yes has been added. This is a core flag and so applies to all tools. The changes are fairly self contained and exist almost entirely within m_debuginfo. From outside the visible changes are: * The type "SegInfo" has been renamed to "DebugInfo", which is more accurate. * VG_(needs_data_syms) has been removed -- data sym reading is now always done * VG_(needs_var_info) has been added * VG_(get_datasym_and_offset) and VG_(get_data_description) have been added. This is a bit of a stupid interface and I might combine the two after the merge. * A new flag --read-var-info=no|yes [no] has been added * VG_(seginfo_sect_kind) should now work reliably -- it never really did before now. As part of this, the machinery for reading ELF symbol tables was majorly overhauled and is now more picky than it was before. I think I have it working reliably again, but there may still be bugs in it. Because the changes are mostly self contained, I don't expect this merge to cause any serious problems. Please complain if they do. J ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers