mtdbg: handle some special floating-point values

git-svn-id: svn://kolibrios.org@4901 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2014-04-27 11:16:25 +00:00
parent 7a4d9fd314
commit 618c2d10ed
2 changed files with 61 additions and 18 deletions

View File

@ -762,13 +762,55 @@ draw_fpu_register_2:
sub esp, 32+12+12
mov eax, 0x20202020
mov edi, .str_buf
stosd
stosd
stosd
stosd
mov edx, ebp
shl edx, 4
movzx eax, word [_fsw]
shr eax, 11
add eax, ebp
and eax, 7
bt dword [_ftw], eax
jc .A6M
mov dword [.str_buf],' epm'
mov word [.str_buf+4],'ty'
jmp .display
mov cx, [_st0+edx+8]
and cx, 0x7FFF ;clear sign flag
jz .A6M
cmp cx, 0x7FFF
jne .decode
mov dword [.str_buf], ' inv'
mov dword [.str_buf+4], 'alid'
jmp .display
.A6M:
mov eax, dword [_st0+edx]
or eax, dword [_st0+edx+4]
jnz .decode
mov dword [.str_buf], ' 0.0'
jmp .display
.decode:
fld tword [_st0+edx]
fldlg2
fld tword [_st0+edx]
bt dword [_st0+edx+8], 15
bt dword [_st0+edx+8], 15 ;check sign flag
jnc @f
fabs
@@:
@ -792,13 +834,6 @@ draw_fpu_register_2:
fimul dword [_10000000]
fbstp tword [.bcd_man]
mov eax, 0x20202020
mov edi, .str_buf
stosd
stosd
stosd
stosd
lea esi, [.bcd_man-1]
mov edi, .str_buf
@ -834,6 +869,7 @@ draw_fpu_register_2:
jnc .skip_hb
mov al, '.'
stosb
.skip_hb:
mov al, ah
and al, 0x0F
@ -841,6 +877,7 @@ draw_fpu_register_2:
bt eax, 16
jc .skip_lb
.write_lb:
add al,0x30
stosb
@ -848,9 +885,9 @@ draw_fpu_register_2:
jnc .skip_lb
mov al, '.'
stosb
.skip_lb:
dec ecx
jnz .mantis_2_str
loop .mantis_2_str
mov ax, ' e'
stosw
@ -863,6 +900,7 @@ draw_fpu_register_2:
jne .exp_2_str
mov al, '-'
stosb
.exp_2_str:
mov al, [esi+ecx]
test al, al
@ -877,25 +915,32 @@ draw_fpu_register_2:
bt eax, 16
jc .skip_hb2
.write_h2:
add al, 0x30
stosb
btr eax, 16
stosb
.skip_hb2:
mov al, ah
and al, 0x0F
jnz .write_lb2
bt eax, 16
jc .skip_lb2
.write_lb2:
add al, 0x30
stosb
btr eax, 16
.skip_lb2:
dec ecx
jnz .exp_2_str
loop .exp_2_str
.display:
mov ecx, (COLOR_TXT_INACTIVE or 0x40000000)
cmp [debuggee_pid], 0

View File

@ -1,5 +1,5 @@
COLOR_THEME fix BLACK_ON_WHITE
;COLOR_THEME fix BLACK_ON_WHITE
COLOR_THEME fix MOVIEOS
format binary as ""
include '../../macros.inc'
@ -2334,7 +2334,7 @@ bSuspended db 0
bAfterGo db 0
temp_break dd 0
reg_mode db 1
_10000000 dd 10000000
_10000000 dd 100000000
include 'disasm_tbl.inc'
@ -2488,10 +2488,8 @@ _xmm6 rq 2
_xmm7 rq 2
ctx_end:
oldcontext rb _ctx_flags-context
rd 2
rq 4
rb 32
oldfpucontext:
oldmmxcontext: rb sse_context-fpu_context