[COMMITTED] libsframe: revisit sframe_find_fre API

Jan Beulich jbeulich@suse.com
Fri May 26 07:30:21 GMT 2023


On 26.05.2023 09:01, Indu Bhagat via Binutils wrote:
> @@ -1022,40 +1049,28 @@ sframe_find_fre (sframe_decoder_ctx *ctx, int32_t pc,
>      bitmask = 0xff;
>  
>    fres = ctx->sfd_fres + fdep->sfde_func_start_fre_off;
> +  func_start_addr = fdep->sfde_func_start_address;
> +
>    for (i = 0; i < fdep->sfde_func_num_fres; i++)
>     {
> -     err = sframe_decode_fre (fres, &next_fre, fre_type, &esz);
> -     start_address = next_fre.fre_start_addr;
> +     err = sframe_decode_fre (fres, &cur_fre, fre_type, &size);
> +     if (err)
> +       return sframe_set_errno (&err, SFRAME_ERR_FRE_INVAL);
>  
> -     if (((fdep->sfde_func_start_address
> -	   + (int32_t) start_address) & bitmask) <= (pc & bitmask))
> +     start_ip = func_start_addr + cur_fre.fre_start_addr;
> +     end_ip_offset = sframe_fre_get_end_ip_offset (fdep, i, fres + size);
> +     end_ip = func_start_addr + end_ip_offset;
> +
> +     if ((start_ip & bitmask) > (pc & bitmask))
> +       return sframe_set_errno (&err, SFRAME_ERR_FRE_INVAL);
> +
> +     if (((start_ip & bitmask) <= (pc & bitmask))
> +	 && (end_ip & bitmask) >= (pc & bitmask))
>         {
> -	 sframe_frame_row_entry_copy (&cur_fre, &next_fre);
> -
> -	 /* Get the next FRE in sequence.  */
> -	 if (i < fdep->sfde_func_num_fres - 1)
> -	   {
> -	     sp += esz;

The buildbot failure just reported was found on the commit prior to this
one, which removed the declaration of sp. Please try to make sure that
every patch builds (and works) okay individually.

Jan


More information about the Binutils mailing list