public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Indu Bhagat <indu.bhagat@oracle.com>
Cc: binutils@sourceware.org
Subject: Re: [COMMITTED] libsframe: revisit sframe_find_fre API
Date: Fri, 26 May 2023 09:30:21 +0200	[thread overview]
Message-ID: <b27b6d81-1b10-9e2f-98c9-5285161f1a23@suse.com> (raw)
In-Reply-To: <20230526070132.4185600-3-indu.bhagat@oracle.com>

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

  reply	other threads:[~2023-05-26  7:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26  7:01 [COMMITTED] libsframe: use uint8_t data type for FRE info related stubs Indu Bhagat
2023-05-26  7:01 ` [COMMITTED] libsframe: use const char * consistently for immutable FRE buffers Indu Bhagat
2023-05-26  7:01 ` [COMMITTED] libsframe: revisit sframe_find_fre API Indu Bhagat
2023-05-26  7:30   ` Jan Beulich [this message]
2023-05-26  7:43     ` Indu Bhagat
2023-05-26  7:01 ` [COMMITTED] sframe/doc: minor improvements for readability Indu Bhagat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b27b6d81-1b10-9e2f-98c9-5285161f1a23@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=indu.bhagat@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).