Rev 1161 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1161 | Rev 1198 | ||
---|---|---|---|
Line 412... | Line 412... | ||
412 | mov eax, ebp |
412 | mov eax, ebp |
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 |
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: |
- | |
446 | ; we are debugged process, notify debugger and suspend ourself |
- | |
447 | ; eax=debugger PID |
- | |
448 | pop edx |
- | |
449 | mov ebx, dr7 |
- | |
450 | mov cl, not 1 |
- | |
451 | .l1: |
- | |
452 | test bl, 1 |
- | |
453 | jnz @f |
- | |
454 | and dl, cl |
- | |
455 | @@: |
- | |
456 | shr ebx, 2 |
- | |
457 | add cl, cl |
- | |
458 | inc ecx |
- | |
459 | cmp cl, not 10h |
- | |
460 | jnz .l1 |
- | |
461 | push edx ; DR6 image |
- | |
462 | mov ecx, [TASK_BASE] |
- | |
463 | push dword [ecx+TASKDATA.pid] ; PID |
- | |
464 | push 12 |
- | |
465 | pop ecx |
- | |
466 | push 3 ; 3 = debug exception |
- | |
467 | call debugger_notify |
- | |
468 | pop ecx |
- | |
469 | pop ecx |
- | |
470 | pop ecx |
- | |
471 | mov edx, [TASK_BASE] |
- | |
472 | mov byte [edx+TASKDATA.state], 1 ; suspended |
- | |
473 | call change_task |
- | |
474 | restore_ring3_context |
- | |
475 | iretd |
- |