mjw at redhat dot com
2014-02-15 23:05:13 UTC
https://sourceware.org/bugzilla/show_bug.cgi?id=16596
Bug ID: 16596
Summary: Support DW_OP_GNU_entry_value in location expressions
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: translator
Assignee: systemtap at sourceware dot org
Reporter: mjw at redhat dot com
Newer GCC releases might produce DWARF location expressions for more arguments
or variables using DW_OP_GNU_entry_value. loc2c currently doesn't support such
location expressions. The description of DW_OP_GNU_entry_value (as DWARF5
extension) can be found at http://dwarfstd.org/ShowIssue.php?issue=100909.1
DW_OP_GNU_entry_value provides an DWARF expression (that can be retrieved
through dwarf_getlocation_attr in libdw elfutils 0.157+ as a location
attribute). Any register op used in the DW_OP_GNU_entry_value expression needs
to be evaluated as the value that register had upon entering the subprogram.
Getting the value of the register at the start of the subprogram can be done in
several ways.
If the register was used to pass an argument to the function then it might be
retrieved through finding the DW_TAG_call_site with DW_AT_low_pc pointing to
the function. The DW_TAG_call_site_parameter with a DW_AT_location of the
register will have as value the DW_AT_GNU_call_site_value. Note that this
location expression itself might use registers that need to be evaluated in the
caller frame (so might need an unwind step, which might fail to restore the
value if that register was caller-saved). Since there might be multiple call
sites the found value depends on the return address of the current function at
runtime (so might need a lookup table at runtime).
If the register was callee saved it should be possible to retrieve the value of
the register on function entry through CFI. This might be possible at
translation time using dwarf_cfi_addrframe and dwarf_frame_register.
Finally the needed registers can be collected by introducing an extra probe at
the first instruction of the subprogram. That probe stores the needed registers
as thread local values that can be retrieved by the probe later in the function
that might need them. This might also need an extra retprobe on the function to
delete the copy of the registers again.
Some example location expressions using DW_OP_GNU_entry_value can be found in
the elfutils tests/run-varlocs.sh.
Bug ID: 16596
Summary: Support DW_OP_GNU_entry_value in location expressions
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: translator
Assignee: systemtap at sourceware dot org
Reporter: mjw at redhat dot com
Newer GCC releases might produce DWARF location expressions for more arguments
or variables using DW_OP_GNU_entry_value. loc2c currently doesn't support such
location expressions. The description of DW_OP_GNU_entry_value (as DWARF5
extension) can be found at http://dwarfstd.org/ShowIssue.php?issue=100909.1
DW_OP_GNU_entry_value provides an DWARF expression (that can be retrieved
through dwarf_getlocation_attr in libdw elfutils 0.157+ as a location
attribute). Any register op used in the DW_OP_GNU_entry_value expression needs
to be evaluated as the value that register had upon entering the subprogram.
Getting the value of the register at the start of the subprogram can be done in
several ways.
If the register was used to pass an argument to the function then it might be
retrieved through finding the DW_TAG_call_site with DW_AT_low_pc pointing to
the function. The DW_TAG_call_site_parameter with a DW_AT_location of the
register will have as value the DW_AT_GNU_call_site_value. Note that this
location expression itself might use registers that need to be evaluated in the
caller frame (so might need an unwind step, which might fail to restore the
value if that register was caller-saved). Since there might be multiple call
sites the found value depends on the return address of the current function at
runtime (so might need a lookup table at runtime).
If the register was callee saved it should be possible to retrieve the value of
the register on function entry through CFI. This might be possible at
translation time using dwarf_cfi_addrframe and dwarf_frame_register.
Finally the needed registers can be collected by introducing an extra probe at
the first instruction of the subprogram. That probe stores the needed registers
as thread local values that can be retrieved by the probe later in the function
that might need them. This might also need an extra retprobe on the function to
delete the copy of the registers again.
Some example location expressions using DW_OP_GNU_entry_value can be found in
the elfutils tests/run-varlocs.sh.
--
You are receiving this mail because:
You are the assignee for the bug.
You are receiving this mail because:
You are the assignee for the bug.