mtdbg: improve output formatting

git-svn-id: svn://kolibrios.org@4906 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2014-04-27 20:55:11 +00:00
parent 8a789e9157
commit cab8cf62a6
2 changed files with 78 additions and 125 deletions

View File

@ -96,7 +96,7 @@ cmdline_y_size equ 10
registers_x_pos equ (data_x_pos + messages_x_size + 4) registers_x_pos equ (data_x_pos + messages_x_size + 4)
registers_y_pos equ (title_y_pos + title_y_size - 3) registers_y_pos equ (title_y_pos + title_y_size - 3)
registers_x_size equ 134 registers_x_size equ 134+2*6
registers_y_size equ (cmdline_y_pos + cmdline_y_size - registers_y_pos+1) registers_y_size equ (cmdline_y_pos + cmdline_y_size - registers_y_pos+1)
wnd_x_size equ (data_x_pos + messages_x_size + data_x_pos + registers_x_size+3) wnd_x_size equ (data_x_pos + messages_x_size + data_x_pos + registers_x_size+3)
@ -658,11 +658,12 @@ draw_title:
; in: esi->value, edx->string, ecx = string length, ebx = coord ; in: esi->value, edx->string, ecx = string length, ebx = coord
draw_register: draw_register:
push esi
push edx push edx
push ecx push ecx
push esi push ebp
mov eax, esi
mov esi, ecx mov ebp, ecx
mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) mov ecx, (COLOR_TXT_INACTIVE or 0x40000000)
cmp [debuggee_pid], 0 cmp [debuggee_pid], 0
@ -671,96 +672,43 @@ draw_register:
jz .cd jz .cd
mov ecx, (COLOR_TXT_NORMAL or 0x40000000) mov ecx, (COLOR_TXT_NORMAL or 0x40000000)
push edi mov eax, [esi]
mov edi, [eax] cmp eax, dword [esi+oldcontext-context]
cmp dword [eax+oldcontext-context], edi je .cd
pop edi
jz .cd
mov ecx, (COLOR_TXT_CHANGED or 0x40000000) mov ecx, (COLOR_TXT_CHANGED or 0x40000000)
.cd:
push eax ;store reg value
.cd: mov esi, ebp
; draw a text string in the window ; draw a text string in the window
mcall 4 mcall 4
imul esi, 60000h imul esi, 60000h
lea edx, [ebx+esi] lea edx, [ebx+esi]
mov esi, ecx mov esi, ecx
pop ecx pop ecx
; draw a number in the window ; draw a number in the window
mcall 47, 80101h rol ecx, 16
lea ebx, [edx+60000h*18] mcall 47, 0x00040100
mov esi, ecx
shr ecx, 16
add edx, (4*6+3) shl 16
mcall 47
pop ebp
pop ecx pop ecx
pop edx pop edx
pop esi
add edx, ecx add edx, ecx
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; Display FPU register (ST0 - ST7) content ; Display FPU register (ST0 - ST7) content
; ;
; in: esi->value, edx->string, ecx = string length, ebx = coord ; in: ebp->index, ebx = coord
draw_fpu_register:
push ebx
push edx
push ecx
push esi
sub esp, 8
fld tword [esi]
fistp qword [esp]
mov eax, esi
mov esi, ecx
mov ecx, (COLOR_TXT_INACTIVE or 0x40000000)
cmp [debuggee_pid], 0
jz .cd
cmp [bSuspended], 0
jz .cd
mov ecx, (COLOR_TXT_NORMAL or 0x40000000)
push edi
mov edi, [eax]
cmp dword [eax+oldcontext-context], edi
pop edi
jnz .scol
push edi
mov edi, [eax+4]
cmp dword [eax+oldcontext-context+4], edi
pop edi
jz .cd
.scol:
mov ecx, (COLOR_TXT_CHANGED or 0x40000000)
.cd:
; draw a text string in the window
mcall 4
imul esi, 60000h
lea edx, [ebx+esi]
mov esi, ecx
mov ecx, esp
; draw a number in the window
; color is the same as for previous text draw function
; ebx : [20] show 16 chars set [30] bit - qword
mcall 47, 40100101h
add esp, 8
pop ecx
lea ebx, [edx+60000h*18]
mov esi, ecx
pop ecx
pop edx
pop ebx
add edx, ecx
ret
;-----------------------------------------------------------------------------
; Display FPU register (ST0 - ST7) content
;
; in: esi->value, ebx = coord
draw_fpu_register_2: draw_fpu_register_2:
.str_buf equ esp .str_buf equ esp
@ -1000,14 +948,11 @@ draw_fpu_register_2:
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; Show FPU MMX register content ; Show FPU MMX register content
; ;
; in: esi->value, edx->string, ecx = string length, ebx = coord ; in: ebp index, ebx = coord
draw_mmx_register:
push ebx draw_mmx_register_2:
push edx
push ecx shl ebp, 4
push esi
mov eax, esi
mov esi, ecx
mov ecx, (COLOR_TXT_INACTIVE or 0x40000000) mov ecx, (COLOR_TXT_INACTIVE or 0x40000000)
cmp [debuggee_pid], 0 cmp [debuggee_pid], 0
@ -1016,38 +961,56 @@ draw_mmx_register:
jz .cd jz .cd
mov ecx, (COLOR_TXT_NORMAL or 0x40000000) mov ecx, (COLOR_TXT_NORMAL or 0x40000000)
push edi
mov edi, [eax]
cmp dword [eax+oldcontext-context], edi
pop edi
jnz .scol
push edi
mov edi, [eax+4]
cmp dword [eax+oldcontext-context+4], edi
pop edi
jz .cd
.scol: mov eax, dword [_mm0+ebp]
cmp eax, dword [_mm0+(oldcontext-context)+ebp]
jne .scol
mov eax, dword [_mm0+ebp+4]
cmp eax, dword [_mm0+(oldcontext-context)+ebp+4]
je .cd
.scol:
mov ecx, (COLOR_TXT_CHANGED or 0x40000000) mov ecx, (COLOR_TXT_CHANGED or 0x40000000)
.cd:
mov eax, ebp
shl eax, 16-4
add eax, 'MM0='
push eax ;write label into stack
.cd:
; draw a text string in the window ; draw a text string in the window
mcall 4
imul esi, 60000h mov eax, 4
lea edx, [ebx+esi] mov esi, eax
mov edx, esp
mov edi, COLOR_BG_NORMAL
int 0x40
mov esi, ecx mov esi, ecx
pop ecx mov [esp], ebx
; draw a number in the window
; color is the same as for previous draw text function mov ecx, dword [_mm0+ebp+4]
; ebx : [20] show 16 chars set [30] bit - qword rol ecx, 16
mcall 47, 40100101h lea edx, [ebx+0x180000]
lea ebx, [edx+60000h*18] mov ebx, 0x00040100
mov esi, ecx mcall 47 ;word #3
pop ecx
pop edx shr ecx, 16
add edx, (4*6+3) shl 16
mcall 47 ;word #2
mov ecx, dword [_mm0+ebp]
rol ecx, 16
add edx, (4*6+3) shl 16
mcall 47 ;word #1
shr ecx, 16
add edx, (4*6+3) shl 16
mcall 47 ;word #0
pop ebx pop ebx
add edx, ecx
shr ebp, 4
ret ret
; TODO add SSE registers ; TODO add SSE registers
@ -1171,23 +1134,22 @@ draw_main_registers:
push ebp push ebp
push 8 push 8
mov edx, mmx_strs xor ebp, ebp
mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+142 mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+142
mov esi, _mm0
align 4 align 4
.draw_mmx_regs: .draw_mmx_regs:
call draw_mmx_register call draw_mmx_register_2
add ebx, 10 add ebx, 10
add esi, 16 inc ebp
dec dword [esp] dec dword [esp]
jnz .draw_mmx_regs jnz .draw_mmx_regs
;FPU registers ;FPU registers
;int3 ;int3
nop ;nop
mov [esp], byte 8 mov [esp], byte 8
xor ebp, ebp xor ebp, ebp

View File

@ -2300,15 +2300,6 @@ fpu_strs:
db 'ST6=' db 'ST6='
db 'ST7=' db 'ST7='
mmx_strs:
db 'MM0='
db 'MM1='
db 'MM2='
db 'MM3='
db 'MM4='
db 'MM5='
db 'MM6='
db 'MM7='
sse_strs: sse_strs:
db '-XMM0-' db '-XMM0-'
db '-XMM1-' db '-XMM1-'
@ -2334,7 +2325,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 100000000 _10000000 dd 1000000000
include 'disasm_tbl.inc' include 'disasm_tbl.inc'
@ -2509,8 +2500,8 @@ oldavxcontext rb $-avx_context
end if end if
step_num dd 0 step_num dd ?
proc_num dd 0 proc_num dd ?
dumpread dd ? dumpread dd ?
dumppos dd ? dumppos dd ?
dumpdata rb dump_height*10h dumpdata rb dump_height*10h