Rev 750 | Rev 1076 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 750 | Rev 1056 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2007. 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: 750 $ |
8 | $Revision: 1056 $ |
9 | 9 | ||
10 | 10 | ||
Line 413... | Line 413... | ||
413 | shl eax, 8 |
413 | shl eax, 8 |
414 | or byte [SLOT_BASE+eax+APPDATA.event_mask+1], 1 ; set flag 100h |
414 | or byte [SLOT_BASE+eax+APPDATA.event_mask+1], 1 ; set flag 100h |
415 | .ret: |
415 | .ret: |
416 | ret |
416 | ret |
Line 417... | Line 417... | ||
417 | 417 | ||
418 | debug_exc: |
- | |
419 | test byte [esp+8+2], 2 |
- | |
420 | jnz v86_debug_exc |
- | |
421 | ; int 1 = #DB |
- | |
422 | save_ring3_context |
- | |
423 | cld |
- | |
424 | mov ax, app_data ;os_data |
- | |
425 | mov ds, ax |
- | |
426 | mov es, ax |
- | |
427 | mov eax, dr6 |
- | |
428 | push eax |
- | |
429 | xor eax, eax |
- | |
430 | mov dr6, eax |
- | |
431 | ; test if debugging |
- | |
432 | cli |
- | |
433 | mov eax, [current_slot] |
- | |
434 | mov eax, [eax+APPDATA.debugger_slot] |
- | |
435 | test eax, eax |
- | |
436 | jnz .debug |
- | |
437 | sti |
- | |
438 | ; not debuggee => say error and terminate |
- | |
439 | add esp, 0x20+4 |
- | |
440 | mov [error_interrupt], 1 |
- | |
441 | call show_error_parameters |
- | |
442 | mov edx, [TASK_BASE] |
- | |
443 | mov byte [edx+TASKDATA.state], 4 |
- | |
444 | jmp change_task |
- | |
445 | .debug: |
418 | debug_ex: |
446 | ; we are debugged process, notify debugger and suspend ourself |
419 | ; we are debugged process, notify debugger and suspend ourself |
- | 420 | ; eax=debugger PID |
|
- | 421 | mov edx, dr6 ; debug_message data=DR6_image |
|
447 | ; eax=debugger PID |
422 | xor ebx, ebx |
448 | pop edx |
423 | mov dr6, ebx |
449 | mov ebx, dr7 |
424 | mov ebx, dr7 |
450 | mov cl, not 1 |
- | |
451 | .l1: |
425 | mov cl, not 8 |
452 | test bl, 1 |
426 | .l1: shl bl,2 |
453 | jnz @f |
427 | jc @f |
454 | and dl, cl |
- | |
455 | @@: |
428 | and dl, cl |
456 | shr ebx, 2 |
429 | @@: sar cl,1 |
457 | add cl, cl |
- | |
458 | inc ecx |
430 | jc .l1 |
459 | cmp cl, not 10h |
431 | mov ecx,3 ; debug_message code=debug_exception |
460 | jnz .l1 |
432 | .notify: |
461 | push edx ; DR6 image |
433 | push edx ; debug_message data |
462 | mov ecx, [TASK_BASE] |
434 | mov ebx, [TASK_BASE] |
463 | push dword [ecx+TASKDATA.pid] ; PID |
- | |
464 | push 12 |
435 | push [ebx+TASKDATA.pid] ; PID |
465 | pop ecx |
436 | push ecx ; debug_message code |
466 | push 3 ; 3 = debug exception |
437 | mov ecx,12 ; debug_message size |
467 | call debugger_notify |
- | |
468 | pop ecx |
- | |
469 | pop ecx |
438 | call debugger_notify ;; only ONE using, inline ??? |
470 | pop ecx |
439 | add esp,12 |
471 | mov edx, [TASK_BASE] |
440 | mov edx, [TASK_BASE] |
472 | mov byte [edx+TASKDATA.state], 1 ; suspended |
441 | mov byte [edx+TASKDATA.state], 1 ; suspended |
473 | call change_task |
442 | call change_task |
474 | restore_ring3_context |
443 | restore_ring3_context |