Skip to content

Commit b6266a6

Browse files
authored
[RISC-V, LOONGARCH64] Fix FuncEvalHijack stackallocation (#88493)
1 parent e05b3e7 commit b6266a6

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/coreclr/debug/ee/loongarch64/dbghelpers.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// hijacking stub used to perform a func-eval, see Debugger::FuncEvalSetup() for use.
99
//
1010
// on entry:
11-
// x0 : pointer to DebuggerEval object
11+
// a0 : pointer to DebuggerEval object
1212
//
1313

1414
// @dbgtodo- once we port Funceval, use the ExceptionHijack stub instead of this func-eval stub.
@@ -17,9 +17,9 @@ NESTED_ENTRY FuncEvalHijack, _TEXT, UnhandledExceptionHandlerUnix
1717
// you change the prolog you will also need to update the personality routine.
1818

1919
// push arg to the stack so our personality routine can find it
20-
// push lr to get good stacktrace in debugger
20+
// push ra to get good stacktrace in debugger
2121
// $fp,$ra
22-
PROLOG_SAVE_REG_PAIR_INDEXED 22, 1, -32
22+
PROLOG_SAVE_REG_PAIR_INDEXED 22, 1, 32
2323
st.d $a0, $sp, 16
2424

2525
// FuncEvalHijackWorker returns the address we should jump to.

src/coreclr/debug/ee/riscv64/dbghelpers.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ NESTED_ENTRY FuncEvalHijack, _TEXT, UnhandledExceptionHandlerUnix
1717
// you change the prolog you will also need to update the personality routine.
1818

1919
// push arg to the stack so our personality routine can find it
20-
// push lr to get good stacktrace in debugger
21-
PROLOG_SAVE_REG_PAIR_INDEXED fp, ra, -32
20+
// push ra to get good stacktrace in debugger
21+
PROLOG_SAVE_REG_PAIR_INDEXED fp, ra, 32
2222
sd a0, 16(sp)
2323

2424
// FuncEvalHijackWorker returns the address we should jump to.

src/coreclr/pal/src/arch/loongarch64/activationhandlerwrapper.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ C_FUNC(ActivationHandlerReturnOffset):
1111

1212
NESTED_ENTRY ActivationHandlerWrapper, _TEXT, NoHandler
1313
// $fp,$ra
14-
PROLOG_SAVE_REG_PAIR_INDEXED 22, 1, -(16 + CONTEXT_Size)
14+
PROLOG_SAVE_REG_PAIR_INDEXED 22, 1, (16 + CONTEXT_Size)
1515
// Should never actually run
1616
EMIT_BREAKPOINT
1717
bl EXTERNAL_C_FUNC(ActivationHandler)

src/coreclr/pal/src/arch/loongarch64/dispatchexceptionwrapper.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ C_FUNC(PAL_DispatchExceptionReturnOffset):
3434

3535
NESTED_ENTRY PAL_DispatchExceptionWrapper, _TEXT, NoHandler
3636
// $fp,$ra
37-
PROLOG_SAVE_REG_PAIR_INDEXED 22, 1, -16
37+
PROLOG_SAVE_REG_PAIR_INDEXED 22, 1, 16
3838
// Should never actually run
3939
EMIT_BREAKPOINT
4040
bl EXTERNAL_C_FUNC(PAL_DispatchException)

0 commit comments

Comments
 (0)