]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libsframe: update the semantics of sframe_fre_get_fp_offset
authorIndu Bhagat <indu.bhagat@oracle.com>
Tue, 27 Jun 2023 18:55:00 +0000 (11:55 -0700)
committerIndu Bhagat <indu.bhagat@oracle.com>
Tue, 27 Jun 2023 19:01:56 +0000 (12:01 -0700)
commit526960c9121d58a532a8c32752f134bb1e0f76b4
treeed99f5788aa9f5ac437e94d25894626e7f578162
parent36aecb4197c035ac5f6a83e1f396290cbe1236a4
libsframe: update the semantics of sframe_fre_get_fp_offset

Until now, sframe_fre_get_fp_offset () would return
SFRAME_ERR_FREOFFSET_NOPRESENT if the ABI uses fixed FP offset.  A stack
tracer, then, would call an explicit sframe_decoder_get_fixed_fp_offset ()
to get the FP offset.

On second look, it appears to make sense to hide these details of
whether the FP offset is fixed or not in an ABI from the consumer.  Now,
with the changed semantics, the call to sframe_fre_get_fp_offset () will
fetch the fixed FP offset if applicable, or get the FP offset from FRE
when there is no fixed FP offset.

This patch changes the behavior of sframe_fre_get_fp_offset (): it turns
an error into non-error.  This change will be included with the next
release of libsframe, where all the exposed symbols will be versioned
with version node LIBSFRAME_1.0 for the first time.

libsframe/
* sframe.c (sframe_fre_get_fp_offset): Return the fixed offset, if
applicable. Else return the FP offset from the FRE.
libsframe/sframe.c