Reactos

[RTL] x64/ARM: Alias RtlpBreakWithStatusInstruction to DbgBreakPointWithStatus; x64: fix a bug.

RtlpBreakWithStatusInstruction is just a label for KD.

On machines that have register calling conventions (basically all except
x86), the `Status` parameter for `DbgBreakPointWithStatus` is stored in
the first argument register.

https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-dbgbreakpointwithstatus

On the x64 platform, `DbgBreakPointWithStatus` only uses the ECX register
and leaves EAX untouched. Verified on Windows.

+8 -19
+7 -14
sdk/lib/rtl/amd64/debug_asm.S
··· 8 8 9 9 #include <asm.inc> 10 10 11 - /* GLOBALS ****************************************************************/ 12 - 13 - PUBLIC DbgBreakPoint 14 - PUBLIC DbgBreakPointWithStatus 15 - PUBLIC DbgUserBreakPoint 16 - PUBLIC DebugService 17 - PUBLIC DebugService2 18 - PUBLIC RtlpBreakWithStatusInstruction 19 - 20 11 /* FUNCTIONS ***************************************************************/ 21 12 22 13 .code64 23 14 15 + PUBLIC DbgUserBreakPoint 24 16 DbgUserBreakPoint: 17 + PUBLIC DbgBreakPoint 25 18 .PROC DbgBreakPoint 26 19 .endprolog 27 20 int 3 28 21 ret 29 22 .ENDP 30 23 24 + PUBLIC RtlpBreakWithStatusInstruction 25 + RtlpBreakWithStatusInstruction: 26 + PUBLIC DbgBreakPointWithStatus 31 27 .PROC DbgBreakPointWithStatus 32 28 .endprolog 33 - mov eax, ecx 34 - .ENDP 35 - 36 - .PROC RtlpBreakWithStatusInstruction 37 - .endprolog 38 29 int 3 39 30 ret 40 31 .ENDP 41 32 33 + PUBLIC DebugService2 42 34 DebugService2: 43 35 44 36 /* Pass the service number in eax */ ··· 56 48 * IN PVOID Argument1, // <r9> = [rsp + 32] 57 49 * IN PVOID Argument2); // [rsp + 40] 58 50 */ 51 + PUBLIC DebugService 59 52 DebugService: 60 53 61 54 /* Prepare registers for interrupt */
+1 -5
sdk/lib/rtl/arm/debug_asm.S
··· 21 21 LEAF_END DbgUserBreakPoint 22 22 23 23 LEAF_ENTRY DbgBreakPointWithStatus 24 - __debugbreak 25 - bx lr 26 - LEAF_END 27 - 28 - LEAF_ENTRY RtlpBreakWithStatusInstruction 24 + ALTERNATE_ENTRY RtlpBreakWithStatusInstruction 29 25 __debugbreak 30 26 bx lr 31 27 LEAF_END