public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] objdump/readelf: sframe: emit marker for FREs with mangled RA
@ 2022-12-17  6:20 Indu Bhagat
  0 siblings, 0 replies; only message in thread
From: Indu Bhagat @ 2022-12-17  6:20 UTC (permalink / raw)
  To: bfd-cvs, gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=49948bce0e9e310ea1506e84755a1cf9fdba8840

commit 49948bce0e9e310ea1506e84755a1cf9fdba8840
Author: Indu Bhagat <indu.bhagat@oracle.com>
Date:   Fri Dec 16 22:02:02 2022 -0800

    objdump/readelf: sframe: emit marker for FREs with mangled RA
    
    In the textual dump of the SFrame section, when an SFrame FRE recovers a
    mangled RA, use string "[s]" in the output to indicate that the return
    address is a signed (mangled) one.
    
    ChangeLog:
    
            * libsframe/sframe-dump.c (dump_sframe_func_with_fres): Postfix
            with "[s]" if RA is signed with authorization code.

Diff:
---
 libsframe/sframe-dump.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/libsframe/sframe-dump.c b/libsframe/sframe-dump.c
index 5b063c9962d..5f778bee338 100644
--- a/libsframe/sframe-dump.c
+++ b/libsframe/sframe-dump.c
@@ -116,7 +116,7 @@ dump_sframe_func_with_fres (sframe_decoder_ctx *sfd_ctx,
   char temp[100];
   memset (temp, 0, 100);
 
-  printf ("\n    %-7s%-8s %-10s%-10s%-10s", "STARTPC", fde_type_marker, "CFA", "FP", "RA");
+  printf ("\n    %-7s%-8s %-10s%-10s%-13s", "STARTPC", fde_type_marker, "CFA", "FP", "RA");
   for (j = 0; j < num_fres; j++)
     {
       sframe_decoder_get_fre (sfd_ctx, funcidx, j, &fre);
@@ -152,7 +152,14 @@ dump_sframe_func_with_fres (sframe_decoder_ctx *sfd_ctx,
 	sprintf (temp, "c%+d", ra_offset);
       else
 	strcpy (temp, "u");
-      printf ("%-10s", temp);
+      /* Mark SFrame FRE's RA information with "[s]" if the RA is mangled
+	 with signature bits.  */
+      const char *ra_mangled_p_str
+	= ((sframe_fre_get_ra_mangled_p (sfd_ctx, &fre, &err[2]))
+	   ? "[s]" : "   ");
+      size_t ra_mangled_p_str_size = strlen (ra_mangled_p_str);
+      strncat (temp, ra_mangled_p_str, ra_mangled_p_str_size);
+      printf ("%-13s", temp);
     }
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-17  6:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-17  6:20 [binutils-gdb] objdump/readelf: sframe: emit marker for FREs with mangled RA Indu Bhagat

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).