public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Indu Bhagat <indu.bhagat@oracle.com>
To: binutils@sourceware.org
Cc: Indu Bhagat <indu.bhagat@oracle.com>
Subject: [COMMITTED, V2 3/6] libsframe: provide new access API for mangled RA bit
Date: Fri, 16 Dec 2022 22:41:25 -0800	[thread overview]
Message-ID: <20221217064128.11326-4-indu.bhagat@oracle.com> (raw)
In-Reply-To: <20221217064128.11326-1-indu.bhagat@oracle.com>

[No Change in V2]

include/ChangeLog:

	* sframe-api.h (sframe_fre_get_ra_mangled_p): New declaration.

ChangeLog:

	* libsframe/sframe.c (sframe_get_fre_ra_mangled_p): New
	definition.
	(sframe_fre_get_ra_mangled_p): New static function.
---
 include/sframe-api.h |  7 +++++++
 libsframe/sframe.c   | 18 ++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/include/sframe-api.h b/include/sframe-api.h
index c9db39eaaf0..bd1833558a4 100644
--- a/include/sframe-api.h
+++ b/include/sframe-api.h
@@ -21,6 +21,7 @@
 #define	_SFRAME_API_H
 
 #include <sframe.h>
+#include <stdbool.h>
 
 #ifdef	__cplusplus
 extern "C"
@@ -184,6 +185,12 @@ extern int32_t
 sframe_fre_get_ra_offset (sframe_decoder_ctx *dctx,
 			  sframe_frame_row_entry *fre, int *errp);
 
+/* Get whether the RA is mangled.  */
+
+extern bool
+sframe_fre_get_ra_mangled_p (sframe_decoder_ctx *dctx,
+			     sframe_frame_row_entry *fre, int *errp);
+
 /* The SFrame Encoder.  */
 
 /* Create an encoder context with the given SFrame format version VER, FLAGS
diff --git a/libsframe/sframe.c b/libsframe/sframe.c
index b17d3234236..b8fde2f04f8 100644
--- a/libsframe/sframe.c
+++ b/libsframe/sframe.c
@@ -124,6 +124,12 @@ sframe_fre_get_offset_size (unsigned char fre_info)
   return SFRAME_V1_FRE_OFFSET_SIZE (fre_info);
 }
 
+static bool
+sframe_get_fre_ra_mangled_p (unsigned char fre_info)
+{
+  return SFRAME_V1_FRE_MANGLED_RA_P (fre_info);
+}
+
 /* Access functions for info from function descriptor entry.  */
 
 static unsigned int
@@ -640,6 +646,18 @@ sframe_fre_get_ra_offset (sframe_decoder_ctx *dctx,
   return sframe_get_fre_offset (fre, SFRAME_FRE_RA_OFFSET_IDX, errp);
 }
 
+/* Get whether the RA is mangled.  */
+
+bool
+sframe_fre_get_ra_mangled_p (sframe_decoder_ctx *dctx ATTRIBUTE_UNUSED,
+			     sframe_frame_row_entry *fre, int *errp)
+{
+  if (fre == NULL || !sframe_fre_sanity_check_p (fre))
+    return sframe_set_errno (errp, SFRAME_ERR_FRE_INVAL);
+
+  return sframe_get_fre_ra_mangled_p (fre->fre_info);
+}
+
 static int
 sframe_frame_row_entry_copy (sframe_frame_row_entry *dst, sframe_frame_row_entry *src)
 {
-- 
2.37.2


  parent reply	other threads:[~2022-12-17  6:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-17  6:41 [COMMITTED, V2 0/6] SFrame: support for .cfi_negate_ra_state in aarch64 Indu Bhagat
2022-12-17  6:41 ` [COMMITTED, V2 1/6] sframe.h: add support for .cfi_negate_ra_state Indu Bhagat
2022-12-17  6:41 ` [COMMITTED, V2 2/6] gas: sframe: " Indu Bhagat
2022-12-17  6:41 ` Indu Bhagat [this message]
2022-12-17  6:41 ` [COMMITTED, V2 4/6] objdump/readelf: sframe: emit marker for FREs with mangled RA Indu Bhagat
2022-12-17  6:41 ` [COMMITTED, V2 5/6] gas: sframe: testsuite: add testcase for .cfi_negate_ra_state Indu Bhagat
2022-12-17  6:41 ` [COMMITTED, V2 6/6] sframe: doc: update spec for the mangled-RA bit in FRE 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=20221217064128.11326-4-indu.bhagat@oracle.com \
    --to=indu.bhagat@oracle.com \
    --cc=binutils@sourceware.org \
    /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).