This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gcc] Enable DW_OP_VAL_EXPRESSION support in dwarf module
OK.
On Wed, Nov 2, 2016 at 10:18 AM, Jiong Wang <jiong.wang@foss.arm.com> wrote:
> On 02/11/16 13:42, Jakub Jelinek wrote:
>>
>> On Wed, Nov 02, 2016 at 01:26:48PM +0000, Jiong Wang wrote:
>>>
>>> -/* A subroutine of dwarf2out_frame_debug, process a REG_CFA_EXPRESSION
>>> note. */
>>> +/* A subroutine of dwarf2out_frame_debug, process a REG_CFA_EXPRESSION
>>> note. */
>>
>>
>> Too long line.
>
>
> Hmm, it shows 80 columns under my editor. I guess '+' is counted in?
>
>>
>>> + /* RTL sequences inside PARALLEL are raw expression representation.
>>> +
>>> + mem_loc_descriptor can be used to build generic DWARF expressions
>>> for
>>> + DW_CFA_expression and DW_CFA_val_expression where the expression
>>> may can
>>> + not be represented using normal RTL sequences. In this case,
>>> group all
>>> + expression operations (DW_OP_*) inside a PARALLEL. For those
>>> DW_OP which
>>> + doesn't have RTL mapping, wrap it using UNSPEC. The logic for
>>> parsing
>>> + PARALLEL sequences is:
>>> +
>>> + foreach elem inside PARALLEL
>>> + if (elem is UNSPEC)
>>> + dw_op = XINT (elem, 1) (DWARF operation is kept as UNSPEC
>>> number)
>>> + oprnd1 = XVECEXP (elem, 0, 0)
>>> + oprnd2 = XVECEXP (elem, 0, 1)
>>> + else
>>> + call mem_loc_descriptor */
>>
>>
>> Not sure if it is a good idea to document in weirdly formatted
>> pseudo-language what the code actually does a few lines below. IMHO
>> either
>> express it in words, or don't express it at all.
>
>
> OK, fixed. I replaced these comments as some brief words.
>
>>
>>> + exp_result =
>>> + new_loc_descr ((enum dwarf_location_atom) dw_op,
>>> oprnd1,
>>> + oprnd2);
>>
>>
>> Wrong formatting, = should be on the next line.
>>
>>> + }
>>> + else
>>> + exp_result =
>>> + mem_loc_descriptor (elem, mode, mem_mode,
>>> + VAR_INIT_STATUS_INITIALIZED);
>>
>>
>> Likewise.
>
>
> Both fixed. Patch updated, please review.
>
>
> Thanks.
>
> gcc/
> 2016-11-02 Jiong Wang <jiong.wang@arm.com>
>
> * reg-notes.def (CFA_VAL_EXPRESSION): New entry.
> * dwarf2cfi.c (dwarf2out_frame_debug_cfa_val_expression): New
> function.
> (dwarf2out_frame_debug): Support REG_CFA_VAL_EXPRESSION.
> (output_cfa_loc): Support DW_CFA_val_expression.
> (output_cfa_loc_raw): Likewise.
> (output_cfi): Likewise.
> (output_cfi_directive): Likewise.
> * dwarf2out.c (dw_cfi_oprnd1_desc): Support DW_CFA_val_expression.
> (dw_cfi_oprnd2_desc): Likewise.
> (mem_loc_descriptor): Recognize new pattern generated for value
> expression.
>