]> sourceware.org Git - systemtap.git/commit - dwflpp.cxx
Partial fix for PR12997 - support dwarf4 .debug_types
authorTom Tromey <tromey@redhat.com>
Fri, 16 Mar 2012 16:44:14 +0000 (10:44 -0600)
committerMark Wielaard <mjw@redhat.com>
Wed, 21 Mar 2012 15:36:31 +0000 (16:36 +0100)
commit337b7c44b1cd672f76e58166a562c12a300ddb20
tree18316c7ce47605e804c05074c54db943ddcc4f0a
parent1485ded3f2d709c9011bd9f340ce39b1930f7e32
Partial fix for PR12997 - support dwarf4 .debug_types

This fix does not solve the ET_REL case pointed out in the PR.
However, it does work ok for ordinary code.

    * dwflpp.cxx (dwflpp::iterate_over_cus): Add 'want_types' argument.
    Iterate over type units.
    (dwflpp::declaration_resolve_other_cus): Update.
    (dwflpp::iterate_single_function): Update.
    (dwflpp::iterate_over_globals): Also allow DW_TAG_type_unit.
    * dwflpp.h (module_tus_read_t): New typedef.
    (dwflpp::iterate_over_cus): Update.
    (dwflpp::module_tus_read): New member.
    * tapsets.cxx (dwarf_query::query_module_dwarf): Update.
    (tracepoint_query::handle_query_module): Update.
    * testsuite/systemtap.pass1-4/debugtypes.cxx: New file.
    * testsuite/systemtap.pass1-4/debugtypes.exp: New file.
    * testsuite/systemtap.pass1-4/debugtypes.stp: New file.

I built gdb with '-gdwarf-4 -fdebug-types-section'.
Then I tried this stap script:

probe process("/home/tromey/gnu/archer/build/gdb/gdb").function("dwarf2_attr") {
      println(@cast($dwarf2_per_objfile, "struct dwarf2_per_objfile")->objfile)
}

With Fedora 16 stap:

barimba. stap -p2 /tmp/q.stp
semantic error: type definition 'struct dwarf2_per_objfile' not found: identifier '@cast' at /tmp/q.stp:2:15
        source:       println(@cast($dwarf2_per_objfile, "struct dwarf2_per_objfile")->objfile)
                              ^
Pass 2: analysis failed.  Try again with another '--vp 01' option.

After the patch, this works.
dwflpp.cxx
dwflpp.h
tapsets.cxx
testsuite/systemtap.pass1-4/debugtypes.cxx [new file with mode: 0644]
testsuite/systemtap.pass1-4/debugtypes.exp [new file with mode: 0644]
testsuite/systemtap.pass1-4/debugtypes.stp [new file with mode: 0755]
This page took 0.024008 seconds and 5 git commands to generate.