diff options
author | Indu Bhagat <indu.bhagat@oracle.com> | 2024-04-19 16:48:17 -0700 |
---|---|---|
committer | Indu Bhagat <indu.bhagat@oracle.com> | 2024-07-09 10:23:31 -0700 |
commit | 4de9a5ccd666e218e5985d35895406f94db65f3c (patch) | |
tree | 8679be3365c28ed80b9631680ea3e996874ca816 | |
parent | 6dacff8a2f4d2c24648fb96334fb272b67beff7c (diff) | |
download | gdb-4de9a5ccd666e218e5985d35895406f94db65f3c.zip gdb-4de9a5ccd666e218e5985d35895406f94db65f3c.tar.gz gdb-4de9a5ccd666e218e5985d35895406f94db65f3c.tar.bz2 |
include: sframe: update code comments around SFrame FRE stack offsets
This also amends the incorrect comment:
offset3 (intrepreted as FP = CFA + offset2)
If RA tracking is enabled, the offset to recover FP is at the third
index. The SFrame format (V2) has assumption that if FP is saved on
stack, RA must have been saved as well. This is true for the currently
supported arch Aarch64. For AMD64, RA tracking per SFrame FRE is not
necessary.
In future, when extending support for more architectures, this will
likely need to be revisited.
include/
* sframe.h: Make the comments clearer by enumerating what
happens per-ABI.
-rw-r--r-- | include/sframe.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/include/sframe.h b/include/sframe.h index b3d0c2e..347dbc7 100644 --- a/include/sframe.h +++ b/include/sframe.h @@ -282,20 +282,22 @@ typedef struct sframe_fre_info S is the size of the stack frame offset for the FRE, and N is the number of stack frame offsets in the FRE - The offsets are interpreted in order as follows: + The interpretation of FRE stack offsets is ABI-specific: - offset1 (interpreted as CFA = BASE_REG + offset1) - - if RA is being tracked - offset2 (interpreted as RA = CFA + offset2) - if FP is being tracked - offset3 (intrepreted as FP = CFA + offset2) - fi - else + AMD64: + offset1 (interpreted as CFA = BASE_REG + offset1) if FP is being tracked offset2 (intrepreted as FP = CFA + offset2) fi - fi + + AARCH64: + offset1 (interpreted as CFA = BASE_REG + offset1) + if FP is being tracked (in other words, if frame record created) + offset2 (interpreted as RA = CFA + offset2) + offset3 (intrepreted as FP = CFA + offset3) + fi + Note that in AAPCS64, a frame record, if created, will save both FP and + LR on stack. */ /* Used when SFRAME_FRE_TYPE_ADDR1 is specified as FRE type. */ |