Rev 9709 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9709 | Rev 9715 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 9709 $ |
8 | $Revision: 9715 $ |
9 | 9 | ||
10 | 10 | ||
Line 153... | Line 153... | ||
153 | ; TODO legacy 32-bit FPU/MMX context |
153 | ; TODO legacy 32-bit FPU/MMX context |
154 | .std_ctx: |
154 | .std_ctx: |
155 | call get_debuggee_slot |
155 | call get_debuggee_slot |
156 | jc .ret |
156 | jc .ret |
Line 157... | Line 157... | ||
157 | 157 | ||
158 | shr eax, 8 |
158 | shr eax, BSF sizeof.APPDATA |
159 | cmp eax, [fpu_owner] |
159 | cmp eax, [fpu_owner] |
160 | jne @f |
160 | jne @f |
161 | inc bh ; set swap context flag |
161 | inc bh ; set swap context flag |
162 | @@: |
162 | @@: |
163 | shl eax, BSF sizeof.APPDATA |
163 | shl eax, BSF sizeof.APPDATA |
164 | mov edi, esi |
164 | mov edi, esi |
165 | mov eax, [eax+SLOT_BASE+APPDATA.pl0_stack] |
165 | mov eax, [SLOT_BASE + eax + APPDATA.pl0_stack] |
Line 166... | Line 166... | ||
166 | lea esi, [eax+RING0_STACK_SIZE] |
166 | lea esi, [eax + RING0_STACK_SIZE] |
167 | 167 | ||
168 | .ring0: |
168 | .ring0: |
Line 292... | Line 292... | ||
292 | btr dword [eax+10h], edx ; clear L bit |
292 | btr dword [eax + 10h], edx ; clear L bit |
293 | test byte [eax+10h], 55h |
293 | test byte [eax + 10h], 55h |
294 | jnz .okret |
294 | jnz .okret |
295 | ; imul eax, ebp, tss_step/32 |
295 | ; imul eax, ebp, tss_step/32 |
296 | ; and byte [eax + tss_data + TSS._trap], not 1 |
296 | ; and byte [eax + tss_data + TSS._trap], not 1 |
297 | and [ebp + SLOT_BASE+APPDATA.dbg_state], not 1 |
297 | and [SLOT_BASE + ebp + APPDATA.dbg_state], not 1 |
298 | .okret: |
298 | .okret: |
299 | and dword [esp+32], 0 |
299 | and dword [esp+32], 0 |
300 | sti |
300 | sti |
301 | ret |
301 | ret |
302 | .errret: |
302 | .errret: |
Line 339... | Line 339... | ||
339 | not ebx |
339 | not ebx |
340 | and [eax+10h+2], bx |
340 | and [eax + 10h+2], bx |
341 | or [eax+10h+2], dx ; set R/W and LEN fields |
341 | or [eax + 10h+2], dx ; set R/W and LEN fields |
342 | ; imul eax, ebp, tss_step/32 |
342 | ; imul eax, ebp, tss_step/32 |
343 | ; or byte [eax + tss_data + TSS._trap], 1 |
343 | ; or byte [eax + tss_data + TSS._trap], 1 |
344 | or [ebp + SLOT_BASE+APPDATA.dbg_state], 1 |
344 | or [SLOT_BASE + ebp + APPDATA.dbg_state], 1 |
345 | jmp .okret |
345 | jmp .okret |
Line 346... | Line 346... | ||
346 | 346 | ||
347 | debug_read_process_memory: |
347 | debug_read_process_memory: |
348 | ; in: |
348 | ; in: |
Line 352... | Line 352... | ||
352 | ; esi=address in debuggee |
352 | ; esi=address in debuggee |
353 | ; out: [esp+36]=sizeof(read) |
353 | ; out: [esp+36]=sizeof(read) |
354 | ; destroys all |
354 | ; destroys all |
355 | call get_debuggee_slot |
355 | call get_debuggee_slot |
356 | jc .err |
356 | jc .err |
357 | shr eax, 8 |
357 | shr eax, BSF sizeof.APPDATA |
358 | mov ecx, edi |
358 | mov ecx, edi |
359 | call read_process_memory |
359 | call read_process_memory |
360 | sti |
360 | sti |
361 | mov dword [esp+32], eax |
361 | mov dword [esp+32], eax |
362 | ret |
362 | ret |
Line 372... | Line 372... | ||
372 | ; esi=address in debuggee |
372 | ; esi=address in debuggee |
373 | ; out: [esp+36]=sizeof(write) |
373 | ; out: [esp+36]=sizeof(write) |
374 | ; destroys all |
374 | ; destroys all |
375 | call get_debuggee_slot |
375 | call get_debuggee_slot |
376 | jc debug_read_process_memory.err |
376 | jc debug_read_process_memory.err |
377 | shr eax, 8 |
377 | shr eax, BSF sizeof.APPDATA |
378 | mov ecx, edi |
378 | mov ecx, edi |
379 | call write_process_memory |
379 | call write_process_memory |
380 | sti |
380 | sti |
381 | mov [esp+32], eax |
381 | mov [esp+32], eax |
382 | ret |
382 | ret |
Line 391... | Line 391... | ||
391 | xchg ebp, eax |
391 | xchg ebp, eax |
392 | mov edi, [timer_ticks] |
392 | mov edi, [timer_ticks] |
393 | add edi, 500 ; 5 sec timeout |
393 | add edi, 500 ; 5 sec timeout |
394 | .1: |
394 | .1: |
395 | mov eax, ebp |
395 | mov eax, ebp |
396 | shl eax, 8 |
396 | shl eax, BSF sizeof.APPDATA |
397 | mov esi, [SLOT_BASE+eax+APPDATA.dbg_event_mem] |
397 | mov esi, [SLOT_BASE + eax + APPDATA.dbg_event_mem] |
398 | test esi, esi |
398 | test esi, esi |
399 | jz .ret |
399 | jz .ret |
400 | ; read buffer header |
400 | ; read buffer header |
401 | push ecx |
401 | push ecx |