Fix in DEBUGF (incorrect output of eax..edi with %x)

New show_error_parameters (core/sys32.inc) from Ghost

git-svn-id: svn://kolibrios.org@656 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Mihail Semenyako (mike.dld) 2007-10-19 11:04:39 +00:00
parent 8c19251a65
commit a30801ba4b
2 changed files with 60 additions and 35 deletions

View File

@ -40,6 +40,10 @@ build_interrupt_table:
ret ret
iglobal iglobal
msg_sel_ker db "kernel", 0
msg_sel_app db "application", 0
sys_int: sys_int:
dd e0,debug_exc,e2,e3 dd e0,debug_exc,e2,e3
dd e4,e5,e6,e7 dd e4,e5,e6,e7
@ -178,41 +182,62 @@ uglobal
write_error_to dd 0x0 write_error_to dd 0x0
endg endg
;show_error_parameters:
;
; mov [write_error_to],process_pid+43
; mov eax,[CURRENT_TASK]
; shl eax, 5
; mov eax,[CURRENT_TASK+TASKDATA.pid+eax]
; call writehex
;
; mov [write_error_to],process_error+43
; mov eax,[error_interrupt]
; call writehex
;
; cmp dword [esp+4+4], os_code ; CS
; jnz @f
; ;mov esi,system_error
; ;call sys_msg_board_str
; DEBUGF 1,"%s",system_error
; @@:
; mov eax, [esp+4] ; EIP
;
; mov [write_error_to],process_eip+43
; call writehex
;
; ;mov esi,process_error
; ;call sys_msg_board_str
; DEBUGF 1,"%s",process_error
;
; ;mov esi,process_pid
; ;call sys_msg_board_str
; DEBUGF 1,"%s",process_pid
;
; ;mov esi,process_eip
; ;call sys_msg_board_str
; DEBUGF 1,"%s",process_eip
;
; ret
show_error_parameters: show_error_parameters:
diff16 '[esp]',0,$
mov [write_error_to],process_pid+43
mov eax,[CURRENT_TASK] mov eax,[CURRENT_TASK]
shl eax, 5 shl eax, 5
mov eax,[CURRENT_TASK+TASKDATA.pid+eax] DEBUGF 1, "K : Process - forced terminate PID: %x\n", [CURRENT_TASK + TASKDATA.pid + eax]
call writehex DEBUGF 1, "K : Exception : %x Error : xxxxxxxx\n", [error_interrupt]
DEBUGF 1, "K : EAX : %x EBX : %x ECX : %x\n", [esp + 0x20], [esp - 12 + 0x20], [esp - 4 + 0x20]
DEBUGF 1, "K : EDX : %x ESI : %x EDI : %x\n", [esp - 8 + 0x20], [esp - 24 + 0x20], [esp - 28 + 0x20]
DEBUGF 1, "K : EBP : %x EIP : %x ", [esp - 20 + 0x20], [esp + 4 + 0x20]
mov [write_error_to],process_error+43 mov eax, [esp + 8 + 0x20]
mov eax,[error_interrupt] mov edi, msg_sel_app
call writehex mov ebx, [esp + 16 + 0x20]
cmp eax, app_code
cmp dword [esp+4+4], os_code ; CS je @f
jnz @f mov edi, msg_sel_ker
;mov esi,system_error mov ebx, [esp - 16 + 0x20]
;call sys_msg_board_str
DEBUGF 1,"%s",system_error
@@: @@:
mov eax, [esp+4] ; EIP ; DEBUGF 1, "ESP : %x\nK : Flags : %x CS : %x (%s)\n", ebx, [esp + 12 + 0x20], eax, edi
DEBUGF 1, "ESP : %x\nK : Flags : %x CS : %x\n", ebx, [esp + 12 + 0x20], eax
mov [write_error_to],process_eip+43
call writehex
;mov esi,process_error
;call sys_msg_board_str
DEBUGF 1,"%s",process_error
;mov esi,process_pid
;call sys_msg_board_str
DEBUGF 1,"%s",process_pid
;mov esi,process_eip
;call sys_msg_board_str
DEBUGF 1,"%s",process_eip
ret ret
@ -853,4 +878,3 @@ build_scheduler:
; call boot_log ; call boot_log
ret ret

View File

@ -196,6 +196,7 @@ macro DEBUGH_N _sign,_num,_hex {
if ~_hex eq eax if ~_hex eq eax
mov eax,_hex mov eax,_hex
end if end if
mov edx,8
else if _hex in <ax,bx,cx,dx,si,di,bp,sp> else if _hex in <ax,bx,cx,dx,si,di,bp,sp>
if ~_hex eq ax if ~_hex eq ax
movzx eax,_hex movzx eax,_hex