diff options
author | Jens Remus <jremus@linux.ibm.com> | 2024-05-16 13:55:44 +0200 |
---|---|---|
committer | Jens Remus <jremus@linux.ibm.com> | 2024-05-16 14:01:59 +0200 |
commit | 42c46c4c7c35678efcd8ba5bf57ae5882cdad79d (patch) | |
tree | a44060c79b238328ccaa7eaf9f6cef30eae8f112 /libsframe/sframe.c | |
parent | 15fb5989abdffd9d19b7aced839836aff7d32c94 (diff) | |
download | gdb-users/jremus/sframe-stacktracer-testsuite-s390x.zip gdb-users/jremus/sframe-stacktracer-testsuite-s390x.tar.gz gdb-users/jremus/sframe-stacktracer-testsuite-s390x.tar.bz2 |
s390: Initial support for s390xusers/jremus/sframe-stacktracer-testsuite-s390x
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Diffstat (limited to 'libsframe/sframe.c')
-rw-r--r-- | libsframe/sframe.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/libsframe/sframe.c b/libsframe/sframe.c index 460face..d112d7c 100644 --- a/libsframe/sframe.c +++ b/libsframe/sframe.c @@ -1159,6 +1159,40 @@ sframe_find_fre (sframe_decoder_ctx *ctx, int32_t pc, return sframe_set_errno (&err, SFRAME_ERR_FDE_INVAL); } +/* Find the first SFrame Row Entry of the SFrame Function Descriptor Entry + which contains the PC. Returns SFRAME_ERR if failure. */ + +int +sframe_find_fre0 (sframe_decoder_ctx *ctx, int32_t pc, + sframe_frame_row_entry *frep) +{ + sframe_frame_row_entry cur_fre; + sframe_func_desc_entry *fdep; + uint32_t fre_type; + const char *fres; + size_t size = 0; + int err = 0; + + if ((ctx == NULL) || (frep == NULL)) + return sframe_set_errno (&err, SFRAME_ERR_INVAL); + + /* Find the FDE which contains the PC, then scan its fre entries. */ + fdep = sframe_get_funcdesc_with_addr_internal (ctx, pc, &err); + if (fdep == NULL || ctx->sfd_fres == NULL) + return sframe_set_errno (&err, SFRAME_ERR_DCTX_INVAL); + + fre_type = sframe_get_fre_type (fdep); + + fres = ctx->sfd_fres + fdep->sfde_func_start_fre_off; + + err = sframe_decode_fre (fres, &cur_fre, fre_type, &size); + if (err) + return sframe_set_errno (&err, SFRAME_ERR_FRE_INVAL); + + sframe_frame_row_entry_copy (frep, &cur_fre); + return 0; +} + /* Return the number of function descriptor entries in the SFrame decoder DCTX. */ |