public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/12997] New: support dwarf4 .debug_types
@ 2011-07-13 15:24 fche at redhat dot com
  2011-07-14 11:22 ` [Bug translator/12997] " mjw at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: fche at redhat dot com @ 2011-07-13 15:24 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=12997

           Summary: support dwarf4 .debug_types
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap@sourceware.org
        ReportedBy: fche@redhat.com


It's coming soon, let's learn to use it.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug translator/12997] support dwarf4 .debug_types
  2011-07-13 15:24 [Bug translator/12997] New: support dwarf4 .debug_types fche at redhat dot com
@ 2011-07-14 11:22 ` mjw at redhat dot com
  2017-10-11 10:44 ` mark at klomp dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: mjw at redhat dot com @ 2011-07-14 11:22 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=12997

Mark Wielaard <mjw at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mjw at redhat dot com

--- Comment #1 from Mark Wielaard <mjw at redhat dot com> 2011-07-14 11:21:25 UTC ---
In theory this is simple. elfutils 0.148+ libdw supports dwarf_next_unit(),
which is like dwarf_next_cu(), but returns either a CU or TU , and
dwarf_offdie_types(), which gives a Dwarf_Die inside a TU, like dwarf_offdie()
provides a Dwarf_Die inside a CU. A DIE can have a DW_AT_signature to indicate
that a type declaration has been placed in a type unit. This has
DW_FORM_ref_sig8 which can be resolved through dwarf_formref_die().

This should work fine for user space (ET_EXEC and ET_DYN). In the case of
ET_REL (like kernel modules) there is an issue that libdw will not handle the
comdat section groups (there will be multiple .debug_type sections in different
groups, while it expects only one). This will have to be fixed in elfutils (or
some pre/post-processing tool that gets run on the kernel modules to first
resolve the comdat groups and merge the .debug_type sections).

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug translator/12997] support dwarf4 .debug_types
  2011-07-13 15:24 [Bug translator/12997] New: support dwarf4 .debug_types fche at redhat dot com
  2011-07-14 11:22 ` [Bug translator/12997] " mjw at redhat dot com
@ 2017-10-11 10:44 ` mark at klomp dot org
  2017-10-11 10:48 ` mjw at fedoraproject dot org
  2023-09-25 19:17 ` wcohen at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: mark at klomp dot org @ 2017-10-11 10:44 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=12997

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at klomp dot org

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug translator/12997] support dwarf4 .debug_types
  2011-07-13 15:24 [Bug translator/12997] New: support dwarf4 .debug_types fche at redhat dot com
  2011-07-14 11:22 ` [Bug translator/12997] " mjw at redhat dot com
  2017-10-11 10:44 ` mark at klomp dot org
@ 2017-10-11 10:48 ` mjw at fedoraproject dot org
  2023-09-25 19:17 ` wcohen at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: mjw at fedoraproject dot org @ 2017-10-11 10:48 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=12997

Mark Wielaard <mjw at fedoraproject dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|mjw at fedoraproject dot org       |

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug translator/12997] support dwarf4 .debug_types
  2011-07-13 15:24 [Bug translator/12997] New: support dwarf4 .debug_types fche at redhat dot com
                   ` (2 preceding siblings ...)
  2017-10-11 10:48 ` mjw at fedoraproject dot org
@ 2023-09-25 19:17 ` wcohen at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: wcohen at redhat dot com @ 2023-09-25 19:17 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=12997

William Cohen <wcohen at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wcohen at redhat dot com

--- Comment #2 from William Cohen <wcohen at redhat dot com> ---
This is partially addressed by git commit
337b7c44b1cd672f76e58166a562c12a300ddb20:

Author: Tom Tromey <tromey@redhat.com>  2012-03-16 12:44:14
Committer: Mark Wielaard <mjw@redhat.com>  2012-03-21 11:36:31
Parent: 1485ded3f2d709c9011bd9f340ce39b1930f7e32 (PR13876: same another test
case)
Child:  2a885a4a9ca1826187c97c7eb128b06b4a5222f2 (Depend on elfutils 0.148+,
document debug_types support requires 0.154+.)
Branches: master, remotes/origin/master and many more (54)
Follows: release-1.7
Precedes: release-1.8

    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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-09-25 19:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-13 15:24 [Bug translator/12997] New: support dwarf4 .debug_types fche at redhat dot com
2011-07-14 11:22 ` [Bug translator/12997] " mjw at redhat dot com
2017-10-11 10:44 ` mark at klomp dot org
2017-10-11 10:48 ` mjw at fedoraproject dot org
2023-09-25 19:17 ` wcohen at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).