Project

General

Profile

Revision 64

changed layout of debugger view, added some sort of logic for not showing evals on tooltips for keywords,
add debugger restart logic, fixed some icon assignments, fixed off by one line error in breakpoint activation

View differences:

cDebuggerEngine.pkg
119 119
    Forward Get Msg_Entering To Rval  // Do Normal Entering
120 120
    // if entering is ok and single item check shadow state of that item.
121 121
    If (Rval=0) Begin
122
      Get Item_Count To iCount
123
      Get Current_Item To iItem
122
//      Get Item_Count To iCount
123
//      Get Current_Item To iItem
124 124
//      Showln ("entering stack "+trim(iCount)*"current"*trim(iItem))
125 125
      //  Get Shadow_State Item 0 To Rval
126 126
    End
......
279 279
    Property Boolean        pbEngineActive        False
280 280
    Property Boolean pbProgramStarted      False
281 281
    Property Boolean pbProgramPaused       False
282
    Property Boolean pbLimitedBreakMode    False
283
    Property Boolean pbDebugRestart        False
282 284
    Property String[]       pAllMessages
283 285
    Property String[]       pAllProperties
286
    Property String[]       pLanguageKeywords
284 287
    Property tBreakPoints[] pBreakPoints
285 288
    
286 289
    Set Name To "oDebuggerEngine"
......
367 370
    Set pAllProperties to AllProperties
368 371
  End_Procedure
369 372
  
373
  Function IsLanguageKeyword String sKeyword Returns Boolean
374
    Boolean  bIsKeyword
375
    Integer  iCount
376
    Integer  iKeyword
377
    String[] Keywords
378
    
379
    Move false to bIsKeyword
380
    Move (lowercase(sKeyWord)) To sKeyword
381
    If (sKeyword<>"") Begin
382
      Get pLanguageKeywords To Keywords
383
      Move (SizeOfArray(Keywords)) To iCount
384
      Decrement iCount
385
      For iKeyWord From 0 To iCount
386
        If (Keywords[iKeyword]=sKeyword) Begin
387
          Move True To bIsKeyword
388
          Move iCount To iKeyword // stop
389
        End
390
      Loop
391
    End
392
    Function_Return bIsKeyword
393
  End_Function
394
  
370 395
  Function IsVariableProperty String sVariable Returns Boolean
371 396
    Integer  iCount
372 397
    Integer  iProp
......
753 778
  // Occurs after the program exits
754 779
  Procedure OnComProgramExit
755 780
    Boolean  bStartedFromCLI
756
    String[] AllMessages
757
    String[] AllProperties
781
    Boolean  bRestartMode
782
    String[] Empty
758 783
    Set pbProgramStarted To False
759 784
    Set pbProgramPaused  To False
760 785
    Send SaveBreakPointsToDisk
761 786
    Set ApplicationFileName To ""
762
    Move (ResizeArray(Allmessages,0))   To AllMessages
763
    Move (ResizeArray(AllProperties,0)) To AllProperties
764
    Set pAllMessages   to AllMessages
765
    Set pAllProperties to AllProperties
766
    Get pbStartedFromCLI of ghoApplication To bStartedFromCLI
767
    If (bStartedFromCli) Begin
768
      // debug session was started from the command line.
769
      // Stopping the debug session normally should stop the debugger as well.
770
      Send Exit_Application
787
    Move (ResizeArray(Empty,0))   To Empty
788
    Set pAllMessages      To Empty
789
    Set pAllProperties    To Empty
790
    Set pLanguageKeywords To Empty
791
    Get pbDebugRestart to bRestartMode
792
    If (bRestartMode) Begin
793
      Send DoDebugRun
771 794
    End
795
    Else Begin
796
      Get pbStartedFromCLI of ghoApplication To bStartedFromCLI
797
      If (bStartedFromCli) Begin
798
        // debug session was started from the command line.
799
        // Stopping the debug session normally should stop the debugger as well.
800
        Send Exit_Application
801
      End
802
    End
772 803
  End_Procedure
773 804

  
774 805
  // Occurs if there is an error starting the program
......
816 847
        Send SetDebuggerAsForegroundApp
817 848
      End
818 849
      Send doOpenSourceFileAtLine of hoEditor llfile llline
819
      Send doActivateCallStack  // only displays if exists or not.
850
      Send doActivateDebugPanels  // only displays if exists or not.
820 851
    End
821 852
  End_Procedure
822 853
  
823 854
  //
824 855
  // Occurs when the program execution is paused
825 856
  Procedure OnComProgramPaused String llfile UInteger llline Boolean lllimitedBreakMode
826
    Set pbProgramPaused  To True
857
    Set pbProgramPaused    To True
858
    Set pbLimitedBreakMode To lllimitedBreakMode
827 859
    Send OnProgramPaused llfile llline lllimitedBreakMode
828 860
  End_Procedure
829 861

  
830 862
  // Occurs when the program execution resumes
831 863
  Procedure OnComProgramContinue
832
    Set pbProgramPaused  To False
864
    Set pbProgramPaused    To False
865
    Set pbLimitedBreakMode To False
833 866
  End_Procedure
834 867

  
835 868
  // Occurs after a change requiring views to be refreshed
......
871 904
    //Send Info_box lldescription "WebApp FATAL Error"
872 905
    Showln lleventid lltext
873 906
  End_Procedure
907
  
908
  Procedure AddKeyword String sWord
909
    Integer  iCount
910
    String[] Keywords
911
    
912
    Get pLanguageKeywords To Keywords
913
    Move (SizeOfArray(Keywords)) To iCount
914
    Move (Lowercase(sWord)) To Keywords[iCount]
915
    Set pLanguageKeywords To Keywords
916
  End_Procedure
917
  
918
  // Language keywords are not evaluated in the tooltip
919
  Procedure AddLanguageKeywords
920
    Send AddKeyword "End_Function"
921
    Send AddKeyword "End_Procedure"
922
    Send AddKeyword "Function"
923
    Send AddKeyword "Move"
924
    Send AddKeyword "Procedure"
925
    Send AddKeyword "Send"
926
    Send AddKeyword "Showln"
927
    Send AddKeyword "To"
928
    Send AddKeyword "UChar[]"
929
  End_Procedure
874 930

  
875 931
  
876 932
  Procedure doCreateCallStack
......
965 1021
      If (hoVariables) Begin
966 1022
        Set phoLocalVariables  To hoVariables
967 1023
        Set Name               Of hoVariables To "oLocalVariables"
968
        Send CreateObjectCallback of hoParent hoVariables
969 1024
        
970 1025
        Send CreateComObject   Of hoVariables
971 1026
        Get IsComObjectCreated Of hoVariables To bCreated
972 1027
        If (bCreated) Begin
973 1028
          Set ComWindowType Of hoVariables To 0 // locals
974 1029
        End
1030
        Send CreateObjectCallback of hoParent hoVariables
975 1031
      End
976 1032
    End
977 1033
  End_Procedure // doCreateLocalVariables
......
996 1052
  End_Procedure // doCreateTables
997 1053

  
998 1054

  
999
  
1000
  Procedure doActivateCallStack
1055
  // we MUST send activate to the debug panels to make them display.
1056
  Procedure doActivateDebugPanels
1001 1057
    Handle  hoCallStack
1058
    Handle  hoLocalVars
1059
    Handle  hoGlobalVars
1002 1060
    Boolean bCreated
1003 1061

  
1004 1062
    Get phoCallStack To hoCallStack
1005 1063
    If (hoCallStack) Begin
1006 1064
      Get IsComObjectCreated Of hoCallStack To bCreated
1007 1065
      If (bCreated) Begin
1008
        Send Activate of hoCallStack  // we MUST send activate to the callstack to make it display itself
1066
        Send Activate of hoCallStack
1009 1067
      End
1010 1068
    End
1011
  End_Procedure // doActivateCallStack
1012 1069

  
1070
    Get phoLocalVariables To hoLocalVars
1071
    If (hoLocalVars) Begin
1072
      Get IsComObjectCreated Of hoLocalVars To bCreated
1073
      If (bCreated) Begin
1074
        Send Activate of hoLocalVars
1075
      End
1076
    End
1013 1077

  
1078
    Get phoGlobalVariables To hoGlobalVars
1079
    If (hoGlobalVars) Begin
1080
      Get IsComObjectCreated Of hoGlobalVars To bCreated
1081
      If (bCreated) Begin
1082
        Send Activate of hoGlobalVars
1083
      End
1084
    End
1085
  End_Procedure
1086

  
1087

  
1014 1088
  
1015 1089
  Procedure DoCreateEngine
1016 1090
    Boolean bCreated
......
1037 1111
    Send doCreateLocalVariables
1038 1112
    
1039 1113
    Send doCreateTablesWindow
1114
    
1115
    Send AddLanguageKeywords
1040 1116
  End_Procedure // DoCreateEngine
1041 1117

  
1042 1118
  

Also available in: Unified diff