[PATCH,V2 2/2] gas: sframe: partially process DWARF expressions in CFI_escape

Indu Bhagat indu.bhagat@oracle.com
Wed Feb 5 19:59:25 GMT 2025


On 2/5/25 8:31 AM, Jens Remus wrote:
> On 05.02.2025 00:10, Indu Bhagat wrote:
> 
>>   - Restructure functionality to accommodate the fact that a valid
>>     unwind info may be split across multiple .cfi_escape. If this is the
>>     case, the current implementation bails out.  Handling this case does
>>     not appear to be worth the effort.
> 
> Is that worth to be mentioned in the commit message?  How is multiple
> unwind info within one .cfi_escape handled?
> 

I remove the stubs between [Changes in VN] and [End of changes in VN] 
from the commit log before pushing. Admittedly this has caused confusion 
previously too...

Multiple unwind info within one .cfi_escape is not handled.  We skip 
generating FDE and warn the user.

>> diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c
> 
>> @@ -1121,7 +1121,8 @@ sframe_xlate_do_offset (struct sframe_xlate_ctx 
>> *xlate_ctx,
>>   static int
>>   sframe_xlate_do_val_offset (struct sframe_xlate_ctx *xlate_ctx 
>> ATTRIBUTE_UNUSED,
>> -                struct cfi_insn_data *cfi_insn)
>> +                struct cfi_insn_data *cfi_insn,
>> +                bool cfi_escape_p)
>>   {
>>     /* Previous value of register is CFA + offset.  However, if the 
>> specified
>>        register is not interesting (SP, FP, or RA reg), the current
>> @@ -1134,7 +1135,8 @@ sframe_xlate_do_val_offset (struct 
>> sframe_xlate_ctx *xlate_ctx ATTRIBUTE_UNUSED,
>>         /* Ignore SP reg, if offset matches assumed default rule.  */
>>         || (cfi_insn->u.ri.reg == SFRAME_CFA_SP_REG && cfi_insn- 
>> >u.ri.offset != 0))
>>       {
>> -      as_warn (_("skipping SFrame FDE; DW_CFA_val_offset with %s 
>> register %u"),
>> +      as_warn (_("skipping SFrame FDE; %sDW_CFA_val_offset with %s 
>> reg %u"),
>> +           cfi_escape_p ? ".cfi_escape " : "",
>>              sframe_register_name (cfi_insn->u.ri.reg), cfi_insn- 
>> >u.ri.reg);
> 
> Why not drop or adjust your preceding patch and use the following,
> as you touch the warning message anyway:
> 
>      as_warn (_("skipping SFrame FDE; %s with %s register %u"),
>          cfi_escape_p ? ".cfi_escape DW_CFA_val_offset" : 
> ".cfi_val_offset",
>          ...
> 

Ah right! :)
Will do.

>>         return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented.  */
>>       }
>> @@ -1310,6 +1312,173 @@ sframe_xlate_do_gnu_window_save (struct 
>> sframe_xlate_ctx *xlate_ctx,
>>     return SFRAME_XLATE_ERR_NOTREPRESENTED;  /* Not represented.  */
>>   }
> 
> Thanks and regards,
> Jens



More information about the Binutils mailing list