Skip to content

Commit df0778d

Browse files
authored
Initialize R12 pointer from context in StackFrameIterator (#97903)
1 parent 3dd7871 commit df0778d

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ void StackFrameIterator::InternalInit(Thread * pThreadToWalk, PInvokeTransitionF
186186

187187
#ifdef TARGET_ARM
188188
m_RegDisplay.pLR = (PTR_UIntNative)PTR_HOST_MEMBER(PInvokeTransitionFrame, pFrame, m_RIP);
189-
m_RegDisplay.pR11 = (PTR_UIntNative)PTR_HOST_MEMBER(PInvokeTransitionFrame, pFrame, m_ChainPointer);
190189

191190
if (pFrame->m_Flags & PTFF_SAVE_R4) { m_RegDisplay.pR4 = pPreservedRegsCursor++; }
192191
if (pFrame->m_Flags & PTFF_SAVE_R5) { m_RegDisplay.pR5 = pPreservedRegsCursor++; }
@@ -632,6 +631,7 @@ void StackFrameIterator::InternalInit(Thread * pThreadToWalk, NATIVE_CONTEXT* pC
632631
m_RegDisplay.pR9 = (PTR_UIntNative)PTR_TO_REG(pCtx, R9);
633632
m_RegDisplay.pR10 = (PTR_UIntNative)PTR_TO_REG(pCtx, R10);
634633
m_RegDisplay.pR11 = (PTR_UIntNative)PTR_TO_REG(pCtx, R11);
634+
m_RegDisplay.pR12 = (PTR_UIntNative)PTR_TO_REG(pCtx, R12);
635635
m_RegDisplay.pLR = (PTR_UIntNative)PTR_TO_REG(pCtx, Lr);
636636
#else
637637
PORTABILITY_ASSERT("StackFrameIterator::InternalInit");

src/coreclr/nativeaot/Runtime/unix/UnixContext.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@
266266
#define MCREG_R9(mc) ((mc).arm_r9)
267267
#define MCREG_R10(mc) ((mc).arm_r10)
268268
#define MCREG_R11(mc) ((mc).arm_fp)
269+
#define MCREG_R12(mc) ((mc).arm_ip)
269270

270271
#elif defined(HOST_X86)
271272

@@ -526,6 +527,7 @@ uint64_t GetPC(void* context)
526527
uint64_t& UNIX_CONTEXT::R9(){ return (uint64_t&)MCREG_R9(ctx.uc_mcontext); }
527528
uint64_t& UNIX_CONTEXT::R10(){ return (uint64_t&)MCREG_R10(ctx.uc_mcontext); }
528529
uint64_t& UNIX_CONTEXT::R11(){ return (uint64_t&)MCREG_R11(ctx.uc_mcontext); }
530+
uint64_t& UNIX_CONTEXT::R12(){ return (uint64_t&)MCREG_R12(ctx.uc_mcontext); }
529531

530532
#else
531533
PORTABILITY_ASSERT("UNIX_CONTEXT");

src/coreclr/nativeaot/Runtime/unix/UnixContext.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ struct UNIX_CONTEXT
136136
uint64_t& R9();
137137
uint64_t& R10();
138138
uint64_t& R11();
139+
uint64_t& R12();
139140

140141
uintptr_t GetIp() { return (uintptr_t)Pc(); }
141142
uintptr_t GetSp() { return (uintptr_t)Sp(); }
@@ -155,6 +156,7 @@ struct UNIX_CONTEXT
155156
lambda((size_t*)&R9());
156157
lambda((size_t*)&R10());
157158
lambda((size_t*)&R11());
159+
lambda((size_t*)&R12());
158160
}
159161
#else
160162
PORTABILITY_ASSERT("UNIX_CONTEXT");

0 commit comments

Comments
 (0)