Bug 10388 - Support DW_OP_call_frame_cfa
Summary: Support DW_OP_call_frame_cfa
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Mark Wielaard
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-14 09:35 UTC by Mark Wielaard
Modified: 2009-07-15 10:17 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2009-07-14 09:35:10 UTC
Currently there are several failures in sdt.exp and exelib.exp on fedora rawhide
because it has a newer gcc that supports a more compact debuginfo format by
using some dwarf3 features. In particular it now emits DW_OP_call_frame_cfa if
there is eh_frame information available. Systemtap and elfutils don't support
this yet. The failures look like:
Got "semantic error: dwarf_getlocation_addr (form 0xa): invalid DWARF

The dwarf isn't invalid, elfutils dwarf_get_location() just didn't recognize
DW_OP_call_frame_cfa (this has been fixed in elfutils git, not released yet),
and loc2c also doesn't handle DW_OP_call_frame_cfa. Adding support will rely on
the new elfutils cfi support (only available in git atm).

See also https://fedorahosted.org/pipermail/elfutils-devel/2009-July/000457.html
Comment 1 Mark Wielaard 2009-07-15 10:17:07 UTC
commit 00b01a991cc4300f18c747853e85841d187b1fa4
Author: Mark Wielaard <mjw@redhat.com>
Date:   Wed Jul 15 12:04:57 2009 +0200

    PR10388 Support DW_OP_call_frame_cfa.
    
    Depends on elfutils 0.142 cfi support.
    
    * loc2c.h (c_translate_location): Take (optional) Dwarf_Op *cfa_ops.
    * loc2c.c (translate): Recognize DW_OP_call_frame_cfa.
      (location_from_address): Take cfa_ops, examine fb_ops, if it is
      DW_OP_call_frame_cfa, pass cfa_ops to translate instead.
      (location_relative): Take cfa_ops, pass to location_from_address.
      (c_translate_location): Take cfa_ops, pass to location_from_address.
    * loc2c-test.c (handle_variable): Take cfa_ops, pass to c_translate_location
      when needed.
      (main): Fetch cfa_ops, pass to handle_variable.
    * dwflpp.h (struct dwflpp): Add new method get_cfa_ops.
    * dwflpp.cxx: Include elfutils/version.h.
      (translate_location): Fetch cfa_ops when necessary.
      (get_cfa_ops): New method.