Subversion Repositories Kolibri OS

Rev

Rev 4285 | Rev 4590 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4285 Rev 4443
Line 880... Line 880...
880
 
880
 
881
;-----------------------------------------------------------------------------
881
;-----------------------------------------------------------------------------
Line 882... Line 882...
882
;                       Step execution event
882
;                       Step execution event
883
 
883
 
884
;Here we get [] argument at do step  times
884
;Here we get [] argument at do step  times
885
OnStep:
885
OnStepMultiple:
886
        cmp     [bSuspended], 0
886
        cmp     [bSuspended], 0
887
        jz      .running
-
 
888
        cmp     [step_num], 0
887
        jz      OnStep.running
889
        jg      .stepone
888
        mov     [step_num], 1
890
        mov     esi, [curarg]
889
        mov     esi, [curarg]
891
        cmp     esi, 0
890
        test    esi, esi
892
        jz	    .stepone
891
        jz      .do
893
        cmp     byte [esi], 0
892
        cmp     byte [esi], 0
894
        jz      .stepone
893
        jz      .do
895
        call    get_hex_number
894
        call    get_hex_number
896
        jc      .ret
895
        jc      .ret
897
        cmp     eax, 0 ; check if lesser or equal than 0
896
        cmp     eax, 0 ; check if lesser or equal than 0
-
 
897
        jle     .ret
-
 
898
        mov     [step_num], eax
898
        jle     .ret
899
.do:
-
 
900
        call    OnStep
-
 
901
        dec     [step_num]
-
 
902
        jnz     .do
Line 899... Line 903...
899
        mov     [step_num], eax
903
.ret:
-
 
904
        ret
-
 
905
 
900
        mov     [curarg], 0
906
OnStep:
901
 
907
        cmp     [bSuspended], 0
902
    .stepone:
908
        jz      .running
903
        call    get_context
909
        call    get_context
904
        or      byte [_eflags+1], 1             ; set TF
910
        or      byte [_eflags+1], 1             ; set TF
Line 939... Line 945...
939
        cmp     [bAfterGo], 0
945
        cmp     [bAfterGo], 0
940
        jz      @f
946
        jz      @f
941
        mov     [bAfterGo], 2
947
        mov     [bAfterGo], 2
Line 942... Line 948...
942
 
948
 
943
    @@:
-
 
944
        mov     eax, [step_num]
-
 
945
        dec     eax
-
 
946
        cmp     eax, 0
-
 
947
        jle     .ret
-
 
948
        mov     [step_num], eax
-
 
949
        jmp     .stepone
-
 
950
 
-
 
951
    .ret:
-
 
952
        mov     [step_num], 0
949
    @@:
Line 953... Line 950...
953
        ret
950
        ret
954
 
951
 
955
    ; return address is [ebp-4]
952
    ; return address is [ebp-4]
Line 1016... Line 1013...
1016
    .procone:
1013
    .procone:
1017
        mov     esi, [_eip]
1014
        mov     esi, [_eip]
Line 1018... Line 1015...
1018
 
1015
 
1019
    @@:
1016
    @@:
1020
        call    get_byte_nobreak
1017
        call    get_byte_nobreak
1021
        jc      OnStep.stepone
1018
        jc      OnStep
1022
        inc     esi
1019
        inc     esi
1023
    ; skip prefixes
1020
    ; skip prefixes
1024
        call    is_prefix
1021
        call    is_prefix
1025
        jz      @b
1022
        jz      @b
Line 1052... Line 1049...
1052
        jmp     .doit
1049
        jmp     .doit
Line 1053... Line 1050...
1053
 
1050
 
1054
    ; FF /2 = call
1051
    ; FF /2 = call
1055
    .noloop:
1052
    .noloop:
1056
        cmp     al, 0xFF
1053
        cmp     al, 0xFF
1057
        jnz     OnStep.stepone
1054
        jnz     OnStep
1058
        call    get_byte_nobreak
1055
        call    get_byte_nobreak
1059
        jc      OnStep.stepone
1056
        jc      OnStep
1060
        inc     esi
1057
        inc     esi
1061
        mov     cl, al
1058
        mov     cl, al
1062
        and     al, 00111000b
1059
        and     al, 00111000b
1063
        cmp     al, 00010000b
1060
        cmp     al, 00010000b
1064
        jnz     OnStep.stepone
1061
        jnz     OnStep
1065
    ; skip instruction
1062
    ; skip instruction
1066
        mov     al, cl
1063
        mov     al, cl
1067
        and     eax, 7
1064
        and     eax, 7
1068
        shr     cl, 6
1065
        shr     cl, 6
Line 1083... Line 1080...
1083
 
1080
 
1084
    .mod0:
1081
    .mod0:
1085
        cmp     al, 4
1082
        cmp     al, 4
1086
        jnz     @f
1083
        jnz     @f
1087
        call    get_byte_nobreak
1084
        call    get_byte_nobreak
1088
        jc      OnStep.stepone
1085
        jc      OnStep
1089
        inc     esi
1086
        inc     esi
Line 1090... Line 1087...
1090
        and     al, 7
1087
        and     al, 7
1091
 
1088
 
Line 1095... Line 1092...
1095
        add     esi, 4
1092
        add     esi, 4
Line 1096... Line 1093...
1096
 
1093
 
1097
    .doit:
1094
    .doit:
1098
    ; insert one-shot breakpoint at esi and resume
1095
    ; insert one-shot breakpoint at esi and resume
1099
        call    get_byte_nobreak
1096
        call    get_byte_nobreak
1100
        jc      OnStep.stepone
1097
        jc      OnStep
1101
        mov     eax, esi
1098
        mov     eax, esi
1102
        call    find_enabled_breakpoint
1099
        call    find_enabled_breakpoint
1103
        jz      @f
1100
        jz      @f
1104
        mov     eax, esi
1101
        mov     eax, esi
Line 2399... Line 2396...
2399
        db      9
2396
        db      9
2400
        dd      aSuspend, OnSuspend, SuspendSyntax, SuspendHelp
2397
        dd      aSuspend, OnSuspend, SuspendSyntax, SuspendHelp
2401
        db      9
2398
        db      9
2402
        dd      aResume, OnResume, ResumeSyntax, ResumeHelp
2399
        dd      aResume, OnResume, ResumeSyntax, ResumeHelp
2403
        db      0Bh
2400
        db      0Bh
2404
        dd      aStep, OnStep, StepSyntax, StepHelp
2401
        dd      aStep, OnStepMultiple, StepSyntax, StepHelp
2405
        db      0Bh
2402
        db      0Bh
2406
        dd      aProceed, OnProceed, ProceedSyntax, ProceedHelp
2403
        dd      aProceed, OnProceed, ProceedSyntax, ProceedHelp
2407
        db      0Bh
2404
        db      0Bh
2408
        dd      aCalc, OnCalc, CalcSyntax, CalcHelp
2405
        dd      aCalc, OnCalc, CalcSyntax, CalcHelp
2409
        db      0Eh
2406
        db      0Eh