2005-12-08 23:56:12 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS Run-Time Library
|
|
|
|
* PURPOSE: Debug Routines
|
2015-11-07 12:22:52 +00:00
|
|
|
* FILE: lib/rtl/i386/debug_asm.S
|
2005-12-08 23:56:12 +00:00
|
|
|
* PROGRAMER: Alex Ionescu (alex@relsoft.net)
|
|
|
|
*/
|
|
|
|
|
2010-11-27 22:12:15 +00:00
|
|
|
#include <asm.inc>
|
2005-12-08 23:56:12 +00:00
|
|
|
|
|
|
|
/* FUNCTIONS ***************************************************************/
|
|
|
|
|
2010-11-27 22:12:15 +00:00
|
|
|
.code
|
|
|
|
|
2015-10-12 17:11:56 +00:00
|
|
|
PUBLIC _DbgBreakPointNoBugCheck@0
|
2011-10-13 15:16:29 +00:00
|
|
|
FUNC _DbgBreakPointNoBugCheck@0
|
2011-09-05 22:18:56 +00:00
|
|
|
FPO 0, 0, 0, 0, 0, FRAME_FPO
|
2015-10-12 17:11:56 +00:00
|
|
|
|
|
|
|
/* Do breakpoint */
|
2006-08-31 18:10:11 +00:00
|
|
|
int 3
|
|
|
|
ret
|
2015-10-12 17:11:56 +00:00
|
|
|
|
2011-10-13 15:16:29 +00:00
|
|
|
ENDFUNC
|
2006-08-31 18:10:11 +00:00
|
|
|
|
2015-10-12 17:11:56 +00:00
|
|
|
|
|
|
|
PUBLIC _DbgUserBreakPoint@0
|
2005-12-08 23:56:12 +00:00
|
|
|
_DbgUserBreakPoint@0:
|
2015-10-12 17:11:56 +00:00
|
|
|
PUBLIC _DbgBreakPoint@0
|
2011-10-13 15:16:29 +00:00
|
|
|
FUNC _DbgBreakPoint@0
|
2011-09-05 22:18:56 +00:00
|
|
|
FPO 0, 0, 0, 0, 0, FRAME_FPO
|
2015-10-12 17:11:56 +00:00
|
|
|
|
|
|
|
/* Do breakpoint */
|
2005-12-08 23:56:12 +00:00
|
|
|
int 3
|
|
|
|
ret
|
2015-10-12 17:11:56 +00:00
|
|
|
|
2011-10-13 15:16:29 +00:00
|
|
|
ENDFUNC
|
2006-08-31 18:10:11 +00:00
|
|
|
|
2015-10-12 17:11:56 +00:00
|
|
|
|
|
|
|
PUBLIC _DbgBreakPointWithStatus@4
|
2011-10-13 15:16:29 +00:00
|
|
|
FUNC _DbgBreakPointWithStatus@4
|
2011-09-05 22:18:56 +00:00
|
|
|
FPO 0, 1, 0, 0, 0, FRAME_FPO
|
2015-10-12 17:11:56 +00:00
|
|
|
|
|
|
|
/* Put Status in EAX */
|
2005-12-08 23:56:12 +00:00
|
|
|
mov eax, [esp+4]
|
2007-02-19 18:52:23 +00:00
|
|
|
|
2015-10-12 17:11:56 +00:00
|
|
|
PUBLIC _RtlpBreakWithStatusInstruction@0
|
|
|
|
GLOBAL_LABEL _RtlpBreakWithStatusInstruction@0
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Do a "labeled" breakpoint -- the KD data block has a "BreakpointWithStatus" field
|
|
|
|
* pointing to this label, letting a debugger easily check that a breakpoint has occured here
|
|
|
|
* and thereby know that there is a Status for it to retrieve from EAX
|
|
|
|
*
|
|
|
|
* In other words, Status is passed as an argument directly to the debugger
|
|
|
|
*/
|
2005-12-08 23:56:12 +00:00
|
|
|
int 3
|
|
|
|
ret 4
|
2015-10-12 17:11:56 +00:00
|
|
|
|
2011-10-13 15:16:29 +00:00
|
|
|
ENDFUNC
|
2005-12-08 23:56:12 +00:00
|
|
|
|
2015-10-12 17:11:56 +00:00
|
|
|
|
|
|
|
PUBLIC _DebugService2@12
|
2011-10-13 15:16:29 +00:00
|
|
|
FUNC _DebugService2@12
|
2011-09-05 22:18:56 +00:00
|
|
|
FPO 0, 3, 3, 0, 1, FRAME_NONFPO
|
2007-01-24 19:48:34 +00:00
|
|
|
|
2015-10-12 17:11:56 +00:00
|
|
|
/* Set up the stack */
|
2007-01-24 19:48:34 +00:00
|
|
|
push ebp
|
2017-09-29 17:32:11 +00:00
|
|
|
CFI_ADJUST_CFA_OFFSET 4
|
|
|
|
CFI_REL_OFFSET ebp, 0
|
2007-01-24 19:48:34 +00:00
|
|
|
mov ebp, esp
|
2017-09-29 17:32:11 +00:00
|
|
|
CFI_DEF_CFA_REGISTER ebp
|
2007-01-24 19:48:34 +00:00
|
|
|
|
|
|
|
/* Call the interrupt */
|
|
|
|
mov eax, [ebp+16]
|
|
|
|
mov ecx, [ebp+8]
|
|
|
|
mov edx, [ebp+12]
|
2010-11-27 22:12:15 +00:00
|
|
|
int HEX(2D)
|
2007-03-03 04:39:25 +00:00
|
|
|
int 3
|
2007-01-24 19:48:34 +00:00
|
|
|
|
2015-10-12 17:11:56 +00:00
|
|
|
/* Return */
|
2007-01-24 19:48:34 +00:00
|
|
|
pop ebp
|
2017-09-29 17:32:11 +00:00
|
|
|
CFI_SAME_VALUE ebp
|
|
|
|
CFI_DEF_CFA esp, 12
|
2007-01-24 19:48:34 +00:00
|
|
|
ret 12
|
2015-10-12 17:11:56 +00:00
|
|
|
|
2011-10-13 15:16:29 +00:00
|
|
|
ENDFUNC
|
2007-01-24 19:48:34 +00:00
|
|
|
|
2015-10-12 17:11:56 +00:00
|
|
|
|
|
|
|
PUBLIC _DebugService@20
|
2011-10-13 15:16:29 +00:00
|
|
|
FUNC _DebugService@20
|
2011-09-05 22:18:56 +00:00
|
|
|
FPO 0, 5, 3, 0, 1, FRAME_NONFPO
|
2005-12-08 23:56:12 +00:00
|
|
|
|
2015-10-12 17:11:56 +00:00
|
|
|
/* Set up the stack */
|
2005-12-08 23:56:12 +00:00
|
|
|
push ebp
|
2017-09-29 17:32:11 +00:00
|
|
|
CFI_ADJUST_CFA_OFFSET 4
|
|
|
|
CFI_REL_OFFSET ebp, 0
|
2005-12-08 23:56:12 +00:00
|
|
|
mov ebp, esp
|
2017-09-29 17:32:11 +00:00
|
|
|
CFI_DEF_CFA_REGISTER ebp
|
2011-09-05 22:18:56 +00:00
|
|
|
|
2015-10-12 17:11:56 +00:00
|
|
|
/* Save non-volatiles */
|
2005-12-08 23:56:12 +00:00
|
|
|
push ebx
|
2017-09-29 17:32:11 +00:00
|
|
|
CFI_REL_OFFSET ebx, -4
|
2005-12-08 23:56:12 +00:00
|
|
|
push edi
|
2017-09-29 17:32:11 +00:00
|
|
|
CFI_REL_OFFSET edi, -8
|
2011-09-05 22:18:56 +00:00
|
|
|
|
2005-12-08 23:56:12 +00:00
|
|
|
/* Call the Interrupt */
|
|
|
|
mov eax, [ebp+8]
|
|
|
|
mov ecx, [ebp+12]
|
|
|
|
mov edx, [ebp+16]
|
|
|
|
mov ebx, [ebp+20]
|
|
|
|
mov edi, [ebp+24]
|
2010-11-27 22:12:15 +00:00
|
|
|
int HEX(2D)
|
2007-03-03 04:39:25 +00:00
|
|
|
int 3
|
2011-09-05 22:18:56 +00:00
|
|
|
|
2015-10-12 17:11:56 +00:00
|
|
|
/* Restore non-volatiles */
|
2005-12-08 23:56:12 +00:00
|
|
|
pop edi
|
2017-09-29 17:32:11 +00:00
|
|
|
CFI_SAME_VALUE edi
|
2005-12-08 23:56:12 +00:00
|
|
|
pop ebx
|
2017-09-29 17:32:11 +00:00
|
|
|
CFI_SAME_VALUE ebx
|
2011-09-05 22:18:56 +00:00
|
|
|
|
2005-12-08 23:56:12 +00:00
|
|
|
/* Return */
|
2008-11-14 19:14:00 +00:00
|
|
|
pop ebp
|
2017-09-29 17:32:11 +00:00
|
|
|
CFI_SAME_VALUE ebp
|
|
|
|
CFI_DEF_CFA esp, 20
|
2005-12-08 23:56:12 +00:00
|
|
|
ret 20
|
2015-10-12 17:11:56 +00:00
|
|
|
|
2011-10-13 15:16:29 +00:00
|
|
|
ENDFUNC
|
2010-11-27 22:12:15 +00:00
|
|
|
|
|
|
|
END
|