libsframe: update the semantics of sframe_fre_get_ra_offset
Until now, sframe_fre_get_ra_offset () would return
SFRAME_ERR_FREOFFSET_NOPRESENT if the ABI uses fixed RA offset (e.g.,
AMD64). A stack tracer, then, will call an explicit
sframe_decoder_get_fixed_ra_offset () to get the RA offset.
On second look, it appears to make sense to hide these details of
whether the RA offset is fixed or not from the consumer. Now, with the
changed semantics, the call to sframe_fre_get_ra_offset () will fetch
the fixed RA offset if applicable, or get the RA offset from FRE when
there is no fixed RA offset.
Adjustments need to be made to ensure the textual dump remains the same
as preivous. Currently, e.g., if RA is not being tracked per FRE,
following is seen with objdump --sframe:
STARTPC CFA FP RA
000000000000NNNN sp+X u u
This patch changes the behavior of sframe_fre_get_ra_offset: it turns an
error into non-error. This change will be included with the next
release of libsframe, where all exposed symbols will be versioned for
the first time.
libsframe/
* sframe.c (sframe_fre_get_ra_offset): Return the fixed offset,
if applicable. Else return the RA offset from the FRE.
* sframe-dump.c (dump_sframe_func_with_fres): Make adjustments
to keep the textual dump same as previous.