aboutsummaryrefslogtreecommitdiff
path: root/libsframe
diff options
context:
space:
mode:
authorIndu Bhagat <indu.bhagat@oracle.com>2023-06-09 11:14:05 -0700
committerIndu Bhagat <indu.bhagat@oracle.com>2023-06-09 11:14:05 -0700
commit937c461e41b866fc26d0c4ac6973ee3923267aab (patch)
tree8de2eba6adaa8ec7ce1e21fac5cb059742962ed7 /libsframe
parent05d63bafad71b534c041275831489f3e0dedcf3f (diff)
downloadbinutils-937c461e41b866fc26d0c4ac6973ee3923267aab.zip
binutils-937c461e41b866fc26d0c4ac6973ee3923267aab.tar.gz
binutils-937c461e41b866fc26d0c4ac6973ee3923267aab.tar.bz2
libsframe: fix sframe_find_fre for pltN entries
To find SFrame stack trace information from an FDE of type SFRAME_FDE_TYPE_PCMASK, sframe_find_fre () was doing an operation like, (start_ip_offset & 0xff) >= (pc & 0xff), etc. This is buggy and needs correction. The mask 0xff should be 0xf (to work for a pltN entry of size say, 16 bytes). At this time, the size of the pltN entry is implicitly assumed to be 16 bytes by libsframe. In next version of the SFrame format, we can encode this information explicitly in the SFrame FDE. For now, we should fix the code to at least behave correctly for the generated code and the generated SFrame stack trace information for the pltN entries on x86_64. libsframe/ * sframe.c (sframe_find_fre): Correct the bitmask used for SFrame FDEs of type SFRAME_FDE_TYPE_PCMASK.
Diffstat (limited to 'libsframe')
-rw-r--r--libsframe/sframe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libsframe/sframe.c b/libsframe/sframe.c
index a5f4a7f..7308a45 100644
--- a/libsframe/sframe.c
+++ b/libsframe/sframe.c
@@ -1066,7 +1066,7 @@ sframe_find_fre (sframe_decoder_ctx *ctx, int32_t pc,
/* FIXME - the bitmask should be picked per ABI or encoded in the format
somehow. For AMD64, the pltN entry stub is 16 bytes. */
if (fde_type == SFRAME_FDE_TYPE_PCMASK)
- bitmask = 0xff;
+ bitmask = 0xf;
fres = ctx->sfd_fres + fdep->sfde_func_start_fre_off;
func_start_addr = fdep->sfde_func_start_address;