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 sub esp, 32+12+12
mov eax, 0x20202020
mov edi, .str_buf
stosd
stosd
stosd
stosd
mov edx, ebp mov edx, ebp
shl edx, 4 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] fld tword [_st0+edx]
fldlg2 fldlg2
fld tword [_st0+edx] fld tword [_st0+edx]
bt dword [_st0+edx+8], 15 bt dword [_st0+edx+8], 15 ;check sign flag
jnc @f jnc @f
fabs fabs
@@: @@:
@ -792,13 +834,6 @@ draw_fpu_register_2:
fimul dword [_10000000] fimul dword [_10000000]
fbstp tword [.bcd_man] fbstp tword [.bcd_man]
mov eax, 0x20202020
mov edi, .str_buf
stosd
stosd
stosd
stosd
lea esi, [.bcd_man-1] lea esi, [.bcd_man-1]
mov edi, .str_buf mov edi, .str_buf
@ -834,6 +869,7 @@ draw_fpu_register_2:
jnc .skip_hb jnc .skip_hb
mov al, '.' mov al, '.'
stosb stosb
.skip_hb: .skip_hb:
mov al, ah mov al, ah
and al, 0x0F and al, 0x0F
@ -841,6 +877,7 @@ draw_fpu_register_2:
bt eax, 16 bt eax, 16
jc .skip_lb jc .skip_lb
.write_lb: .write_lb:
add al,0x30 add al,0x30
stosb stosb
@ -848,9 +885,9 @@ draw_fpu_register_2:
jnc .skip_lb jnc .skip_lb
mov al, '.' mov al, '.'
stosb stosb
.skip_lb: .skip_lb:
dec ecx loop .mantis_2_str
jnz .mantis_2_str
mov ax, ' e' mov ax, ' e'
stosw stosw
@ -863,6 +900,7 @@ draw_fpu_register_2:
jne .exp_2_str jne .exp_2_str
mov al, '-' mov al, '-'
stosb stosb
.exp_2_str: .exp_2_str:
mov al, [esi+ecx] mov al, [esi+ecx]
test al, al test al, al
@ -877,25 +915,32 @@ draw_fpu_register_2:
bt eax, 16 bt eax, 16
jc .skip_hb2 jc .skip_hb2
.write_h2: .write_h2:
add al, 0x30 add al, 0x30
stosb stosb
btr eax, 16 btr eax, 16
stosb stosb
.skip_hb2: .skip_hb2:
mov al, ah mov al, ah
and al, 0x0F and al, 0x0F
jnz .write_lb2 jnz .write_lb2
bt eax, 16 bt eax, 16
jc .skip_lb2 jc .skip_lb2
.write_lb2: .write_lb2:
add al, 0x30 add al, 0x30
stosb stosb
btr eax, 16 btr eax, 16
.skip_lb2: .skip_lb2:
dec ecx loop .exp_2_str
jnz .exp_2_str
.display:
mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) mov ecx, (COLOR_TXT_INACTIVE or 0x40000000)
cmp [debuggee_pid], 0 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 "" format binary as ""
include '../../macros.inc' include '../../macros.inc'
@ -2334,7 +2334,7 @@ bSuspended db 0
bAfterGo db 0 bAfterGo db 0
temp_break dd 0 temp_break dd 0
reg_mode db 1 reg_mode db 1
_10000000 dd 10000000 _10000000 dd 100000000
include 'disasm_tbl.inc' include 'disasm_tbl.inc'
@ -2488,10 +2488,8 @@ _xmm6 rq 2
_xmm7 rq 2 _xmm7 rq 2
ctx_end: ctx_end:
oldcontext rb _ctx_flags-context oldcontext rb _ctx_flags-context
rd 2 rb 32
rq 4
oldfpucontext: oldfpucontext:
oldmmxcontext: rb sse_context-fpu_context oldmmxcontext: rb sse_context-fpu_context