From d2b821e9d11575d62553a4eb25443335df55812b Mon Sep 17 00:00:00 2001 From: rtldg Date: Mon, 3 Mar 2025 00:56:42 +0000 Subject: [PATCH] Make note about frame pointer --- core/sourcehook/sourcehook_hookmangen_x86_64.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/sourcehook/sourcehook_hookmangen_x86_64.cpp b/core/sourcehook/sourcehook_hookmangen_x86_64.cpp index 8cb7990..3a6113e 100644 --- a/core/sourcehook/sourcehook_hookmangen_x86_64.cpp +++ b/core/sourcehook/sourcehook_hookmangen_x86_64.cpp @@ -1488,8 +1488,8 @@ namespace SourceHook MSVC_ONLY(m_PubFunc.sub(rsp, 0x38)); // Shadow space 32 bytes + 2 * 8 bytes (for our parameters) + 8 bytes // TODO: GCC_ONLY(m_PubFunc.sub(rsp, 8+?)); - // Unnecessary according to AMD manual (Section 3.2.2 The Stack Frame) - // but GCC still does it anyways, so let's do it as well + // Frame pointer! We like working callstacks when debugging crashes! + // TODO: Might mean we don't have to `sub rsp, 8`? GCC_ONLY(m_PubFunc.push(rbp)); GCC_ONLY(m_PubFunc.mov(rbp, rsp));