vdfsplat / AppSrc / VdfSplat.src @ 65
History | View | Annotate | Download (27.7 KB)
| 1 | 8 | wil | //TH-Header | 
|---|---|---|---|
| 2 | //***************************************************************************************** | ||
| 3 | // Copyright (c) 2013 Antwise Solutions | ||
| 4 | // All rights reserved. | ||
| 5 | // | ||
| 6 | // $FileName : VdfSplat.src | ||
| 7 | 22 | wil | // $ProjectName : Splat ! Vdf Debugger | 
| 8 | 8 | wil | // $Authors : Wil van Antwerpen | 
| 9 | // $Created : 12.14.2013 23:42 | ||
| 10 | // $Type : GPLv2 | ||
| 11 | // | ||
| 12 | // Contents: | ||
| 13 | // | ||
| 14 | //***************************************************************************************** | ||
| 15 | //TH-RevisionStart | ||
| 16 | //TH-RevisionEnd | ||
| 17 | |||
| 18 | 22 | wil | Use DFAllEnt.pkg | 
| 19 | 49 | wil | Use cToolTipController.pkg | 
| 20 | 7 | wil | Use cDebugCJCommandBarSystem.pkg | 
| 21 | 10 | wil | Use vWin32fh.pkg | 
| 22 | Use seq_chnl.pkg | ||
| 23 | 35 | wil | Use cSplatApplication.pkg | 
| 24 | 43 | wil | Use cSplatPanel.pkg | 
| 25 | 2 | wil | |
| 26 | Object oHtmlHelp is a cHtmlHelp | ||
| 27 | End_Object | ||
| 28 | |||
| 29 | 35 | wil | Object oApplication is a cSplatApplication | 
| 30 | 2 | wil | Set peHelpType to htHtmlHelp | 
| 31 | 46 | wil | |
| 32 | 31 | wil | Set psAutoOpenWorkspace to "" // We're not using data files, the exe has to be completely self contained. | 
| 33 | 2 | wil | End_Object | 
| 34 | |||
| 35 | 49 | wil | Object oToolTipController is a cToolTipController | 
| 36 | Move Self to ghoToolTipController | ||
| 37 | End_Object | ||
| 38 | |||
| 39 | 2 | wil | Use oEditContextMenu.pkg | 
| 40 | Use oDEOEditContextMenu.pkg | ||
| 41 | |||
| 42 | 37 | wil | #IF (1=0) | 
| 43 | // This imagelist is a dummy, it is only used to have the Studio recognize | ||
| 44 | // which bitmaps are used in the application so that a "Scan Bitmaps" will always | ||
| 45 | // include the bitmaps as embedded resource. The imagelist itself is not used. | ||
| 46 | Object ImageContainer is a cImageList32 | ||
| 47 | Set piMaxImages to 10 | ||
| 48 | Procedure OnCreate | ||
| 49 | Integer iImage | ||
| 50 | Get AddImage "Debugger.bmp/t" to iImage | ||
| 51 | End_Procedure | ||
| 52 | End_Object | ||
| 53 | #ENDIF | ||
| 54 | |||
| 55 | 43 | wil | Object oMain is a cSplatPanel | 
| 56 | 2 | wil | Set Label to "VdfSplat" | 
| 57 | Set Location to 4 3 | ||
| 58 | 22 | wil | Set Size to 300 450 | 
| 59 | 2 | wil | |
| 60 | 8 | wil | // Make sure it can be used here already | 
| 61 | Use cDebuggerEngine.pkg | ||
| 62 | |||
| 63 | 7 | wil | |
| 64 | 65 | wil | Object oOpenProgramDialog Is an OpenDialog | 
| 65 | Set Dialog_Caption to "Select a DataFlex executable file to debug" | ||
| 66 | 7 | wil | Set Filter_String to 'Visual DataFlex Executables|*.exe' | 
| 67 | Set Initial_Folder to 'C:\Program Files\Visual DataFlex' | ||
| 68 | // Set MultiSelect_State To False | ||
| 69 | Set NoChangeDir_State To True // don't touch my current folder | ||
| 70 | Set CreatePrompt_State To False | ||
| 71 | Set HideReadOnly_State To True | ||
| 72 | Set Filter_Index to 2 | ||
| 73 | 22 | wil | End_Object | 
| 74 | 25 | wil | |
| 75 | Object oOpenSourceFileDialog is an OpenDialog | ||
| 76 | Set Filter_String to 'Visual DataFlex source|*.*' | ||
| 77 | // Set Initial_Folder to 'C:\Program Files\Visual DataFlex' | ||
| 78 | // Set MultiSelect_State To False | ||
| 79 | Set NoChangeDir_State To True // don't touch my current folder | ||
| 80 | Set CreatePrompt_State To False | ||
| 81 | Set HideReadOnly_State To True | ||
| 82 | Set Filter_Index to 2 | ||
| 83 | End_Object | ||
| 84 | 2 | wil | |
| 85 | 10 | wil | Procedure Warning_Box String sMessage String sCaption | 
| 86 | Integer eResponse | ||
| 87 | |||
| 88 | Get Message_Box sMessage sCaption MB_OK MB_ICONWARNING to eResponse | ||
| 89 | 22 | wil | End_Procedure // Warning_Box | 
| 90 | 10 | wil | |
| 91 | Procedure Fishy_Box String sMessage String sDebugfile | ||
| 92 |       Send Warning_Box ("Sorry but the debug file for the executable you choose\n\n"+;
 | ||
| 93 | sDebugfile+"\ndoesn't look like it is valid.\n\n"+sMessage+"\n\nPlease try again.") ; | ||
| 94 | "VdfSplat thinks this is fishy" | ||
| 95 | 22 | wil | End_Procedure // Fishy_Box | 
| 96 | 10 | wil | |
| 97 | // | ||
| 98 | // Reads the runtime version of the .dbg file passed. | ||
| 99 | 22 | wil | // The file must exist. | 
| 100 | 10 | wil | // | 
| 101 | Function ReadRuntimeVersion String sDebugFile Returns Integer | ||
| 102 | Integer iRuntime | ||
| 103 | 22 | wil | Integer iChIn | 
| 104 | 10 | wil | Integer iFileSize | 
| 105 | Integer iVdfMax | ||
| 106 | Integer iVdfMin | ||
| 107 | String sBinary | ||
| 108 | |||
| 109 | 22 | wil | Move 0 To iRuntime | 
| 110 | 10 | wil | Get vWin32_APIFileSize sDebugFile to iFileSize | 
| 111 | If (iFileSize > 40000) Begin | ||
| 112 | |||
| 113 | 22 | wil | Get Seq_Open_Input_Channel sDebugfile to iChIn | 
| 114 | 10 | wil |         Direct_Input channel iChIn ("binary:" + sDebugfile)
 | 
| 115 | Read_Block channel iChIn sBinary 50 | ||
| 116 | Send Seq_Close_Channel iChIn | ||
| 117 | If (Left(sBinary,4)="VDFB") Begin | ||
| 118 | Move (Ascii(Mid(sBinary,1,5))) To iVdfMax | ||
| 119 | Move (Ascii(Mid(sBinary,1,9))) To iVdfMin | ||
| 120 | 16 | wil | If ((iVdfMax>2 and iVdfMax < 26) and (iVdfMin<5)) Begin | 
| 121 | 10 | wil | Move ((iVdfMax*10)+iVdfMin) To iRuntime | 
| 122 | End | ||
| 123 | Else Begin | ||
| 124 |             Send Fishy_Box ("The debug file suggests this is VDF version"*trim(iVdfMax)+"."+trim(iVdfMin)+"\nNot very likely that.") sDebugfile
 | ||
| 125 | 22 | wil | End | 
| 126 | 10 | wil | End | 
| 127 | Else Begin | ||
| 128 | Send Fishy_Box "The debug file signature is not correct." sDebugfile | ||
| 129 | End | ||
| 130 | End | ||
| 131 | Else Begin | ||
| 132 | Send Fishy_Box "It is wayyy too small." sDebugfile | ||
| 133 | 22 | wil | End | 
| 134 | 10 | wil | Function_Return iRuntime | 
| 135 | 22 | wil | End_Function // ReadRuntimeVersion | 
| 136 | 10 | wil | |
| 137 | 24 | wil | Procedure doOpenFile | 
| 138 | 27 | wil | Handle hoDebug | 
| 139 | 25 | wil | Handle hoEditor | 
| 140 | Handle hoDialog | ||
| 141 | Boolean bOpen | ||
| 142 | Boolean bIsValid | ||
| 143 | String sFileName | ||
| 144 | 24 | wil | |
| 145 | Get phoDebugger to hoDebug | ||
| 146 | If (hoDebug) Begin | ||
| 147 | 25 | wil | Move (oOpenSourceFileDialog(Self)) To hoDialog | 
| 148 | |||
| 149 | Get Show_Dialog of hoDialog to bOpen | ||
| 150 | If bOpen Begin | ||
| 151 | Get File_Name of hoDialog To sFileName | ||
| 152 | Get ComIsValidSourceFile of hoDebug sFileName To bIsValid | ||
| 153 | If (bIsValid) Begin | ||
| 154 | Get phoEditor to hoEditor | ||
| 155 | If (hoEditor) Begin | ||
| 156 | Send DoOpenSourceFile of hoEditor sFileName | ||
| 157 | End | ||
| 158 | End | ||
| 159 | Else Begin | ||
| 160 | Send Info_Box "source file is not part of selected program we are currently debugging." | ||
| 161 | End | ||
| 162 | End | ||
| 163 | |||
| 164 | 24 | wil | End | 
| 165 | End_Procedure // doOpenFile | ||
| 166 | |||
| 167 | 64 | wil | Procedure DoInitializeParameters | 
| 168 | Set piDebugfileVersion To 0 | ||
| 169 | //Set phoDebugger To 0 | ||
| 170 | Set psApplication Of ghoApplication To "" | ||
| 171 | End_Procedure | ||
| 172 | |||
| 173 | // | ||
| 174 | // Locates the debug file for the application binary passed. | ||
| 175 | // Returns TRUE if found and sets property piDebugFileVersion | ||
| 176 | // | ||
| 177 | Function ParseApplicationDebugFile String sApplication Returns Boolean | ||
| 178 | Boolean bExists | ||
| 179 | Integer iRuntime | ||
| 180 | String sExt | ||
| 181 | String sDebugfile | ||
| 182 | |||
| 183 | Get ParseFileExtension sApplication To sExt | ||
| 184 |       Move (Replace("."+sExt,sApplication,".dbg")) To sDebugfile
 | ||
| 185 | Get vFilePathExists sDebugfile to bExists | ||
| 186 | If (bExists=false) Begin | ||
| 187 |         Send Warning_Box ("Sorry but for the executable chosing the corresponding debug file\n"+;
 | ||
| 188 | sDebugfile+"\ncould not be located.\n\nPlease select again.") ; | ||
| 189 | "VdfSplat can't do that" | ||
| 190 | End | ||
| 191 | Else Begin | ||
| 192 | Get ReadRuntimeVersion sDebugfile To iRuntime | ||
| 193 | If (iRuntime=0) Begin | ||
| 194 | Move False To bExists | ||
| 195 | End | ||
| 196 | Else Begin | ||
| 197 | Set piDebugfileVersion To iRuntime | ||
| 198 | End | ||
| 199 | End | ||
| 200 | |||
| 201 | Function_Return bExists | ||
| 202 | End_Function | ||
| 203 | |||
| 204 | 7 | wil | Procedure doDebugRun | 
| 205 | 22 | wil | String sApplication | 
| 206 | Boolean bOpen | ||
| 207 | 10 | wil | Boolean bExists | 
| 208 | 64 | wil | Boolean bRestartMode | 
| 209 | 8 | wil | Handle hoDebug | 
| 210 | 22 | wil | Handle hoParent | 
| 211 | 7 | wil | Handle hoDialog | 
| 212 | 10 | wil | |
| 213 | 35 | wil | Get psApplication of ghoApplication To sApplication | 
| 214 | 22 | wil | If (sApplication = "") Begin | 
| 215 | 10 | wil | Move (oOpenProgramDialog(Self)) To hoDialog | 
| 216 | |||
| 217 | Get Show_Dialog of hoDialog to bOpen | ||
| 218 | If bOpen Begin | ||
| 219 | 17 | wil | Get File_Name of hoDialog To sApplication | 
| 220 | 22 | wil | // Don't tell me when I selected a file, just do it. | 
| 221 |             //Send Info_Box ("Selected file " + sApplication)
 | ||
| 222 | 10 | wil | End | 
| 223 | 35 | wil | Else Send Info_Box "You did not choose a file, nothing to debug." | 
| 224 | 10 | wil | |
| 225 | 22 | wil | End | 
| 226 | 10 | wil | If (sApplication="") Begin | 
| 227 | // Oh still no app? Use our hardcoded path | ||
| 228 | 35 | wil | Procedure_Return | 
| 229 | 22 | wil | End | 
| 230 | 64 | wil | Get ParseApplicationDebugFile sApplication To bExists | 
| 231 | |||
| 232 | Get phoDebugger to hoDebug | ||
| 233 | If (hoDebug) Begin | ||
| 234 | Get pbDebugRestart of hoDebug to bRestartMode | ||
| 235 | If (bRestartMode) Begin | ||
| 236 | Send Destroy of hoDebug | ||
| 237 | 65 | wil | Move 0 To hoDebug | 
| 238 | 10 | wil | End | 
| 239 | 22 | wil | End | 
| 240 | 10 | wil | If (bExists and hoDebug=0) Begin | 
| 241 | 20 | wil | // | 
| 242 | |||
| 243 | Get phoDebuggerHost To hoParent | ||
| 244 | 64 | wil | Get Create Of hoParent (RefClass(cDebuggerEngine)) To hoDebug | 
| 245 | 8 | wil | If (hoDebug) Begin | 
| 246 | Send DoCreateEngine of hoDebug | ||
| 247 | 20 | wil | End | 
| 248 | End | ||
| 249 | 10 | wil | If (bExists and hoDebug<>0) Begin | 
| 250 | |||
| 251 | 35 | wil | Set psApplication of ghoApplication To sApplication | 
| 252 | 20 | wil | Set ApplicationFileName of hoDebug To sApplication | 
| 253 | 38 | wil | // ?? | 
| 254 | Send DoSetCaptionLabel Of (oVdfDbg(oClientArea(Self))) sApplication | ||
| 255 | 60 | wil | Send DoStartDebug | 
| 256 | End | ||
| 257 | End_Procedure // doDebugRun | ||
| 258 | |||
| 259 | Procedure DoStartDebug | ||
| 260 | String sApplication | ||
| 261 | Integer iRuntime | ||
| 262 | Handle hoDebug | ||
| 263 | |||
| 264 | Get phoDebugger to hoDebug | ||
| 265 | If (hoDebug<>0) Begin | ||
| 266 | Get psApplication Of ghoApplication To sApplication | ||
| 267 | Get piDebugfileVersion To iRuntime | ||
| 268 | 7 | wil | //Send ComPause of hoDebug | 
| 269 | //Procedure ComStartProgram String llcmdLine Variant llwebApp Variant llurl | ||
| 270 | 16 | wil | If (iRuntime<181) Begin | 
| 271 | Send ComStartProgram of hoDebug sApplication false "" | ||
| 272 | End | ||
| 273 | Else Begin // noheap or heap? that's' the question. | ||
| 274 | Send ComStartProgram181 of hoDebug sApplication True false "" | ||
| 275 | End | ||
| 276 | 22 | wil | Send ComUpdateViews Of hoDebug | 
| 277 | End | ||
| 278 | 60 | wil | End_Procedure | 
| 279 | 7 | wil | |
| 280 | Procedure doStopDebug | ||
| 281 | 64 | wil | Boolean bPaused | 
| 282 | Boolean bBreakMode | ||
| 283 | Handle hoDebug | ||
| 284 | 7 | wil | |
| 285 | Get phoDebugger to hoDebug | ||
| 286 | If (hoDebug) Begin | ||
| 287 | 64 | wil | Get pbLimitedBreakMode of hoDebug to bBreakMode | 
| 288 | Get HasProgramPaused To bPaused | ||
| 289 | If (bPaused) Begin | ||
| 290 | //Send doDebugContinue | ||
| 291 | End | ||
| 292 | 7 | wil | Send ComStopProgram of hoDebug | 
| 293 | 20 | wil | Send ComUpdateViews Of hoDebug | 
| 294 | 64 | wil | If (bBreakMode=False) Begin | 
| 295 | // You cannot destroy the debugger on here as the messageloop has to run to get the debuggee back to run | ||
| 296 | // so killing it here would be out of sync with what you want. | ||
| 297 | //Send Destroy of hoDebug | ||
| 298 | Send DoInitializeParameters | ||
| 299 | 65 | wil | End | 
| 300 | 20 | wil | End | 
| 301 | 7 | wil | End_Procedure // doStopDebug | 
| 302 | |||
| 303 | 64 | wil | Procedure DoRestartDebug | 
| 304 | String sApplication | ||
| 305 | |||
| 306 | Get psApplication of ghoApplication To sApplication | ||
| 307 | Set pbDebugRestart of (phoDebugger(Self)) to True | ||
| 308 | Send DoStopDebug | ||
| 309 | //Sleep 1 | ||
| 310 | Set psApplication of ghoApplication To sApplication | ||
| 311 | End_Procedure | ||
| 312 | |||
| 313 | 2 | wil | Procedure doDebugPause | 
| 314 | Handle hoDebug | ||
| 315 | |||
| 316 | Get phoDebugger to hoDebug | ||
| 317 | If (hoDebug) Begin | ||
| 318 | Send ComPause of hoDebug | ||
| 319 | 22 | wil | Send ComUpdateViews Of hoDebug | 
| 320 | End | ||
| 321 | End_Procedure // doDebugPause | ||
| 322 | 2 | wil | |
| 323 | Procedure doDebugContinue | ||
| 324 | Handle hoDebug | ||
| 325 | |||
| 326 | Get phoDebugger to hoDebug | ||
| 327 | If (hoDebug) Begin | ||
| 328 | Send ComContinue of hoDebug | ||
| 329 | 22 | wil | Send ComUpdateViews Of hoDebug | 
| 330 | End | ||
| 331 | 2 | wil | End_Procedure // doDebugContinue | 
| 332 | |||
| 333 | Procedure doDebugStepOver | ||
| 334 | Handle hoDebug | ||
| 335 | |||
| 336 | Get phoDebugger to hoDebug | ||
| 337 | If (hoDebug) Begin | ||
| 338 | Send ComStepOver of hoDebug | ||
| 339 | 22 | wil | Send ComUpdateViews Of hoDebug | 
| 340 | End | ||
| 341 | End_Procedure // doDebugStepOver | ||
| 342 | 7 | wil | |
| 343 | Procedure doDebugStepInto | ||
| 344 | Handle hoDebug | ||
| 345 | |||
| 346 | Get phoDebugger to hoDebug | ||
| 347 | If (hoDebug) Begin | ||
| 348 | Send ComStepInto of hoDebug | ||
| 349 | 22 | wil | Send ComUpdateViews Of hoDebug | 
| 350 | End | ||
| 351 | 7 | wil | End_Procedure // doDebugStepInto | 
| 352 | |||
| 353 | Procedure doDebugStepOut | ||
| 354 | Handle hoDebug | ||
| 355 | |||
| 356 | Get phoDebugger to hoDebug | ||
| 357 | If (hoDebug) Begin | ||
| 358 | Send ComStepOut of hoDebug | ||
| 359 | 22 | wil | Send ComUpdateViews Of hoDebug | 
| 360 | End | ||
| 361 | 7 | wil | End_Procedure // doDebugStepOut | 
| 362 | 12 | wil | |
| 363 | 20 | wil | Procedure doSetBreakPoint | 
| 364 | 12 | wil | Integer iLine | 
| 365 | String sFileName | ||
| 366 | Boolean bSuccess | ||
| 367 | Handle hoDebugger | ||
| 368 | Handle hoEditor | ||
| 369 | |||
| 370 | Get phoDebugger to hoDebugger | ||
| 371 | Get phoEditor To hoEditor | ||
| 372 | If (hoDebugger<>0 and hoEditor<>0) begin | ||
| 373 | |||
| 374 | Get psFileName Of hoEditor To sFileName | ||
| 375 | 20 | wil | Get CurrentLine Of hoEditor To iLine | 
| 376 | 12 | wil | If (sFileName<>"" and iLine<>0) Begin | 
| 377 | 20 | wil | Get SetBreakPoint of hoDebugger sFileName (&iLine) To bSuccess | 
| 378 | 37 | wil | If (bSuccess=false) Begin | 
| 379 |             Send info_box ("Set breakpoint at line"*trim(iLine)*"Failed.\nReturned="*trim(bSuccess))
 | ||
| 380 | End | ||
| 381 | 20 | wil | //Send ComSetMarginImages iLine 1 | 
| 382 | End | ||
| 383 | 12 | wil | End | 
| 384 | 20 | wil | End_Procedure | 
| 385 | |||
| 386 | Procedure doRemoveBreakPoint | ||
| 387 | Integer iLine | ||
| 388 | String sFileName | ||
| 389 | Boolean bSuccess | ||
| 390 | Handle hoDebugger | ||
| 391 | Handle hoEditor | ||
| 392 | |||
| 393 | Get phoDebugger to hoDebugger | ||
| 394 | Get phoEditor To hoEditor | ||
| 395 | If (hoDebugger<>0 and hoEditor<>0) begin | ||
| 396 | |||
| 397 | Get psFileName Of hoEditor To sFileName | ||
| 398 | Get CurrentLine Of hoEditor To iLine | ||
| 399 | If (sFileName<>"" and iLine<>0) Begin | ||
| 400 | Get RemoveBreakPoint of hoDebugger sFileName (&iLine) To bSuccess | ||
| 401 | 37 | wil | If (bSuccess=false) Begin | 
| 402 |             Send info_box ("Removing breakpoint at line"*trim(iLine)*"Failed.\nReturned="*trim(bSuccess))
 | ||
| 403 | End | ||
| 404 | 20 | wil | //Send ComSetMarginImages iLine 1 | 
| 405 | End | ||
| 406 | End | ||
| 407 | End_Procedure | ||
| 408 | 2 | wil | |
| 409 | 8 | wil | // | 
| 410 | //Procedure doCreateCallStack | ||
| 411 | // Boolean bCreated | ||
| 412 | // Handle hoCallStack | ||
| 413 | // | ||
| 414 | 22 | wil | // | 
| 415 | 8 | wil | // Get phoCallStack To hoCallStack | 
| 416 | // If (hoCallStack) Begin | ||
| 417 | // Send CreateComObject of hoCallStack | ||
| 418 | // Get IsComObjectCreated Of hoCallStack To bCreated | ||
| 419 | // Showln "callstack [" bCreated "]" | ||
| 420 | // If (bCreated) Begin | ||
| 421 | 22 | wil | // Send RegisterComEvents Of hoCallStack | 
| 422 | 8 | wil | // //Set ComWindowType Of hoGlobals To 1 // global | 
| 423 | 22 | wil | // End | 
| 424 | 8 | wil | // End | 
| 425 | //End_Procedure // doCreateCallStack | ||
| 426 | 2 | wil | |
| 427 | 7 | wil | Function HasProgramStarted Returns Boolean | 
| 428 | Boolean bStarted | ||
| 429 | Handle hoDebugger | ||
| 430 | |||
| 431 | Move False To bStarted | ||
| 432 | Get phoDebugger To hoDebugger | ||
| 433 | If (hoDebugger) Begin | ||
| 434 | Get pbProgramStarted of hoDebugger To bStarted | ||
| 435 | 22 | wil | End | 
| 436 | 7 | wil | Function_Return bStarted | 
| 437 | 22 | wil | End_Function // HasProgramStarted | 
| 438 | 2 | wil | |
| 439 | 7 | wil | // | 
| 440 | // A program can only be paused after it has started | ||
| 441 | // This is used as an indication that we can step through the source | ||
| 442 | 64 | wil | // The property pbProgramPaused is set on both a breakpoint and on a Pause | 
| 443 | 7 | wil | Function HasProgramPaused Returns Boolean | 
| 444 | 22 | wil | Boolean bPaused | 
| 445 | 7 | wil | Boolean bStarted | 
| 446 | Handle hoDebugger | ||
| 447 | |||
| 448 | Move False To bPaused | ||
| 449 | Get HasProgramStarted To bStarted | ||
| 450 | If (bStarted) Begin | ||
| 451 | Get phoDebugger To hoDebugger | ||
| 452 | If (hoDebugger) Begin | ||
| 453 | Get pbProgramPaused of hoDebugger to bPaused | ||
| 454 | 22 | wil | End | 
| 455 | End | ||
| 456 | 7 | wil | Function_Return bPaused | 
| 457 | 22 | wil | End_Function // HasProgramPaused | 
| 458 | 7 | wil | |
| 459 | 37 | wil | // | 
| 460 | // A breakpoint can only be removed if we have existing breakpoints | ||
| 461 | // | ||
| 462 | Function HasBreakpoints Returns Boolean | ||
| 463 | Boolean bHasBreakPoints | ||
| 464 | Boolean bStarted | ||
| 465 | Handle hoDebugger | ||
| 466 | |||
| 467 | Move False To bHasBreakPoints | ||
| 468 | Get HasProgramStarted To bStarted | ||
| 469 | If (bStarted) Begin | ||
| 470 | Get phoDebugger To hoDebugger | ||
| 471 | If (hoDebugger) Begin | ||
| 472 | Get HasBreakPoints of hoDebugger to bHasBreakPoints | ||
| 473 | End | ||
| 474 | End | ||
| 475 | Function_Return bHasBreakPoints | ||
| 476 | End_Function // HasBreakPoints | ||
| 477 | 7 | wil | |
| 478 | 37 | wil | |
| 479 | 2 | wil | |
| 480 | 7 | wil | Object oCommandBarSystem is a cDebugCJCommandBarSystem | 
| 481 | 2 | wil | |
| 482 | Procedure OnCreateCommandBars | ||
| 483 | Handle hoOptions | ||
| 484 | Get OptionsObject to hoOptions | ||
| 485 | Forward Send OnCreateCommandBars | ||
| 486 | End_Procedure | ||
| 487 | 7 | wil | |
| 488 | 2 | wil | |
| 489 | Object oMenuBar is a cCJMenuBar | ||
| 490 | |||
| 491 | Object oFileMenu is a cCJMenuItem | ||
| 492 | 22 | wil | Set peControlType to xtpControlPopup | 
| 493 | 2 | wil | Set psCaption to "&File" | 
| 494 | Set psDescription to "Find, Save, Delete, Clear information or quit this application." | ||
| 495 | Set psCategory to "Menus" | ||
| 496 | |||
| 497 | Object oClearMenuItem is a cCJClearMenuItem | ||
| 498 | Set pbAddToDesignerMenu to True | ||
| 499 | End_Object | ||
| 500 | |||
| 501 | Object oClearAllMenu is a cCJClearAllMenuItem | ||
| 502 | Set pbAddToDesignerMenu to True | ||
| 503 | End_Object | ||
| 504 | |||
| 505 | Object oPromptMenuItem is a cCJPromptMenuItem | ||
| 506 | Set pbAddToDesignerMenu to True | ||
| 507 | Set pbControlBeginGroup to True | ||
| 508 | End_Object | ||
| 509 | |||
| 510 | Object oCJDebugPauseMenuItem is a cCJDebugPauseMenuItem | ||
| 511 | Set pbAddToDesignerMenu to True | ||
| 512 | Set pbControlBeginGroup to True | ||
| 513 | End_Object | ||
| 514 | |||
| 515 | Object oFindNextMenu is a cCJFindNextMenuItem | ||
| 516 | Set pbAddToDesignerMenu to True | ||
| 517 | End_Object | ||
| 518 | |||
| 519 | Object oFindPreviousMenu is a cCJFindPreviousMenuItem | ||
| 520 | Set pbAddToDesignerMenu to True | ||
| 521 | End_Object | ||
| 522 | |||
| 523 | Object oFindFirstMenu is a cCJFindFirstMenuItem | ||
| 524 | Set pbAddToDesignerMenu to True | ||
| 525 | End_Object | ||
| 526 | |||
| 527 | Object oFindLastMenu is a cCJFindLastMenuItem | ||
| 528 | Set pbAddToDesignerMenu to True | ||
| 529 | End_Object | ||
| 530 | |||
| 531 | Object oSaveMenuItem is a cCJSaveMenuItem | ||
| 532 | Set pbAddToDesignerMenu to True | ||
| 533 | Set pbControlBeginGroup to True | ||
| 534 | End_Object | ||
| 535 | |||
| 536 | Object oDeleteMenuItem is a cCJDeleteMenuItem | ||
| 537 | Set pbAddToDesignerMenu to True | ||
| 538 | End_Object | ||
| 539 | |||
| 540 | Object oExitMenu is a cCJExitMenuItem | ||
| 541 | Set pbControlBeginGroup to True | ||
| 542 | End_Object | ||
| 543 | |||
| 544 | End_Object | ||
| 545 | |||
| 546 | Object oViewMenu is a cCJMenuItem | ||
| 547 | Set peControlType to xtpControlPopup | ||
| 548 | Set psCaption to "&View" | ||
| 549 | Set psToolTip to "View" | ||
| 550 | Set psDescription to "Available Views" | ||
| 551 | |||
| 552 | Object ooVdfdbgMenuItem is a cCJMenuItem | ||
| 553 | 7 | wil | Set psCaption to "Debugger View" | 
| 554 | Set psTooltip to "The debugger main view" | ||
| 555 | 2 | wil | |
| 556 | Procedure OnExecute Variant vCommandBarControl | ||
| 557 | Handle hoClient | ||
| 558 | Get Client_Id to hoClient | ||
| 559 | Send Activate_oVdfdbg of hoClient | ||
| 560 | End_Procedure | ||
| 561 | End_Object | ||
| 562 | 24 | wil | |
| 563 | Object oObjectInspectorMenuItem is a cCJMenuItem | ||
| 564 | Set psCaption to "Object Inspector Ctrl+L" | ||
| 565 | Set psTooltip to "Inspect the objects in the running program" | ||
| 566 | |||
| 567 | Procedure OnExecute Variant vCommandBarControl | ||
| 568 | Handle hoClient | ||
| 569 | Get Client_Id to hoClient | ||
| 570 | Send doActivateObjectInspectorPanel of hoClient | ||
| 571 | End_Procedure | ||
| 572 | |||
| 573 | Function IsEnabled Returns Boolean | ||
| 574 | Boolean bPaused | ||
| 575 | |||
| 576 | Get HasProgramPaused To bPaused | ||
| 577 | Function_Return bPaused | ||
| 578 | End_Function | ||
| 579 | End_Object | ||
| 580 | 2 | wil | End_Object | 
| 581 | |||
| 582 | Object oNavigateMenu is a cCJMenuItem | ||
| 583 | 22 | wil | Set peControlType to xtpControlPopup | 
| 584 | Set psCaption to "&Navigate" | ||
| 585 | Set psTooltip to "Navigate" | ||
| 586 | 2 | wil | Set psDescription to "Move to different areas of the application" | 
| 587 | |||
| 588 | Object oNextAreaMenu is a cCJNextAreaMenu | ||
| 589 | End_Object | ||
| 590 | |||
| 591 | Object oPriorAreaMenu is a cCJPriorAreaMenu | ||
| 592 | End_Object | ||
| 593 | |||
| 594 | Object oNextViewMenu is a cCJNextViewMenu | ||
| 595 | End_Object | ||
| 596 | |||
| 597 | Object oPriorViewMenu is a cCJPriorViewMenu | ||
| 598 | End_Object | ||
| 599 | |||
| 600 | Object oPromptMenu is a cCJPromptMenuItem | ||
| 601 | Set pbControlBeginGroup to True | ||
| 602 | End_Object | ||
| 603 | |||
| 604 | Object oZoomMenu is a cCJZoomMenuItem | ||
| 605 | End_Object | ||
| 606 | |||
| 607 | End_Object | ||
| 608 | |||
| 609 | Object oWindowMenu is a cCJMDIWindowsMenuItem | ||
| 610 | Set peControlType to xtpControlPopup | ||
| 611 | Set psCaption to "&Window" | ||
| 612 | Set psToolTip to "Window" | ||
| 613 | 22 | wil | Set psDescription to "Display Current Views and set other display options." | 
| 614 | 2 | wil | |
| 615 | 22 | wil | // These are the static windows items. More will be created in onInitPopup | 
| 616 | 2 | wil | Object oDisplayOptionsMenu is a cCJMenuItem | 
| 617 | 22 | wil | Set peControlType to xtpControlPopup | 
| 618 | 2 | wil | Set psCaption to "&Display Options" | 
| 619 | Set psToolTip to "Display Options" | ||
| 620 | Set psDescription to "Set display options" | ||
| 621 | |||
| 622 | Object oStatusbarMenu is a cCJStatusbarMenuItem | ||
| 623 | End_Object | ||
| 624 | |||
| 625 | Object oAutoArrangeIconsMenu is a cCJAutoArrangeIconsMenuItem | ||
| 626 | End_Object | ||
| 627 | |||
| 628 | Object oRestoreMenusMenu is a cCJRestoreMenusMenuItem | ||
| 629 | Set pbControlBeginGroup to True | ||
| 630 | End_Object | ||
| 631 | |||
| 632 | End_Object | ||
| 633 | |||
| 634 | Object oCascadeMenu is a cCJCascadeMenuItem | ||
| 635 | Set pbControlBeginGroup to True | ||
| 636 | End_Object | ||
| 637 | |||
| 638 | Object oHorizTile is a cCJTileHorizontally | ||
| 639 | End_Object | ||
| 640 | |||
| 641 | Object oVertTile is a cCJTileVertically | ||
| 642 | End_Object | ||
| 643 | |||
| 644 | Object oMinimizeMenuItem is a cCJMinimizeWindowsMenuItem | ||
| 645 | Set pbControlBeginGroup to True | ||
| 646 | End_Object | ||
| 647 | |||
| 648 | Object oRestoreMenuItem is a cCJRestoreWindowsMenuItem | ||
| 649 | End_Object | ||
| 650 | |||
| 651 | Object oArrangeIconsMenuItem is a cCJAutoArrangeIconsMenuItem | ||
| 652 | Set pbControlBeginGroup to True | ||
| 653 | End_Object | ||
| 654 | |||
| 655 | End_Object | ||
| 656 | |||
| 657 | Object oHelpMenu is a cCJMenuItem | ||
| 658 | 22 | wil | Set peControlType to xtpControlPopup | 
| 659 | 2 | wil | Set psCaption to "&Help" | 
| 660 | Set psDescription to "Access Information for learning and using this DataFlex application." | ||
| 661 | Set psToolTip to "Help" | ||
| 662 | |||
| 663 | 22 | wil | Object oHelpMenuItem is a cCJHelpMenuItem | 
| 664 | 2 | wil | End_Object | 
| 665 | |||
| 666 | Object oAboutMenuItem is a cCJAboutMenuItem | ||
| 667 | End_Object | ||
| 668 | |||
| 669 | End_Object | ||
| 670 | |||
| 671 | End_Object | ||
| 672 | |||
| 673 | 7 | wil | Object oDebugToolBar is a cCJToolbar | 
| 674 | Set psTitle to "Debugging Toolbar" | ||
| 675 | 2 | wil | |
| 676 | 7 | wil | |
| 677 | Object oStartDebugButton is a cCJStartDebugMenuItem | ||
| 678 | 2 | wil | End_Object | 
| 679 | |||
| 680 | 7 | wil | Object oStopDebugButton is a cCJStopDebugMenuItem | 
| 681 | 2 | wil | End_Object | 
| 682 | |||
| 683 | 60 | wil | Object oRestartDebugButton is a cCJRestartDebugMenuItem | 
| 684 | End_Object | ||
| 685 | |||
| 686 | 2 | wil | Object oDebugPauseButton is a cCJDebugPauseMenuItem | 
| 687 | End_Object | ||
| 688 | |||
| 689 | 7 | wil | Object oDebugContinueButton is a cCJDebugContinueMenuItem | 
| 690 | End_Object | ||
| 691 | |||
| 692 | 2 | wil | Object oDebugStepOverButton is a cCJStepOverMenuItem | 
| 693 | End_Object | ||
| 694 | |||
| 695 | 7 | wil | Object oDebugStepIntoButton is a cCJStepIntoMenuItem | 
| 696 | 2 | wil | End_Object | 
| 697 | 7 | wil | |
| 698 | Object oDebugStepOutButton is a cCJStepOutMenuItem | ||
| 699 | End_Object | ||
| 700 | |||
| 701 | 2 | wil | |
| 702 | End_Object | ||
| 703 | 27 | wil | |
| 704 | 24 | wil | Object oFileToolbar is a cCJToolbar | 
| 705 | Set psTitle To "Open Source Toolbar" | ||
| 706 | Object oFileOpen is a cCJOpenFileMenuItem | ||
| 707 | End_Object | ||
| 708 | End_Object | ||
| 709 | 2 | wil | |
| 710 | 21 | wil | Object oBreakPointToolBar is a cCJToolbar | 
| 711 | Set psTitle to "Breakpoint Toolbar" | ||
| 712 | |||
| 713 | Object oAddBreakpointButton is a cCJAddBreakpointMenuItem | ||
| 714 | End_Object | ||
| 715 | |||
| 716 | Object oRemoveBreakpointButton is a cCJRemoveBreakpointMenuItem | ||
| 717 | End_Object | ||
| 718 | End_Object | ||
| 719 | |||
| 720 | 2 | wil | Object oEditToolBar is a cCJToolbar | 
| 721 | Set psTitle to "Edit Toolbar" | ||
| 722 | |||
| 723 | Object oCutToolbarItem is a cCJCutMenuItem | ||
| 724 | End_Object | ||
| 725 | |||
| 726 | Object oCopyToolbarItem is a cCJCopyMenuItem | ||
| 727 | End_Object | ||
| 728 | |||
| 729 | Object oPasteToolbarItem is a cCJPasteMenuItem | ||
| 730 | End_Object | ||
| 731 | |||
| 732 | Object oDeleteEditToolbarItem is a cCJDeleteEditMenuItem | ||
| 733 | Set pbControlBeginGroup to True | ||
| 734 | End_Object | ||
| 735 | |||
| 736 | End_Object | ||
| 737 | |||
| 738 | Object oStatusBar is a cCJStatusBar | ||
| 739 | |||
| 740 | Object oStatusPane1 is a cCJStatusBarPane | ||
| 741 | Set piID to sbpIDIdlePane | ||
| 742 | Set pbStyleStretch to True | ||
| 743 | 24 | wil | Set psText To "" | 
| 744 | 2 | wil | End_Object | 
| 745 | |||
| 746 | Object oStatusPane2 is a cCJStatusBarPane | ||
| 747 | Set phoViewPane to Self | ||
| 748 | Set pbStyleStretch to True | ||
| 749 | 24 | wil | Set psText To "" | 
| 750 | 2 | wil | End_Object | 
| 751 | 7 | wil | |
| 752 | Object oStatusPane3 is a cCJStatusBarPane | ||
| 753 | Set pbStyleStretch to True | ||
| 754 | Set psText To "testing 888" | ||
| 755 | End_Object | ||
| 756 | 27 | wil | |
| 757 | 38 | wil | Function EditorHandle Returns Handle | 
| 758 | Handle hoEditor | ||
| 759 | Boolean bIsCreated | ||
| 760 | |||
| 761 | Get phoEditor To hoEditor | ||
| 762 | If (hoEditor) Begin | ||
| 763 | Get IsComObjectCreated Of hoEditor To bIsCreated | ||
| 764 | If (bIsCreated=false) Begin | ||
| 765 | Move 0 To hoEditor | ||
| 766 | End | ||
| 767 | End | ||
| 768 | Function_Return hoEditor | ||
| 769 | End_Function | ||
| 770 | |||
| 771 | 24 | wil | Function EditorCurrentLine Returns Integer | 
| 772 | Handle hoEditor | ||
| 773 | Integer iCount | ||
| 774 | |||
| 775 | 38 | wil | Get EditorHandle To hoEditor | 
| 776 | 24 | wil | If (hoEditor) Begin | 
| 777 | Get CurrentLine Of hoEditor To iCount | ||
| 778 | End | ||
| 779 | Function_Return iCount | ||
| 780 | End_Function // EditorCurrentLine | ||
| 781 | 4 | wil | |
| 782 | Function EditorLineCount Returns Integer | ||
| 783 | Handle hoEditor | ||
| 784 | Integer iCount | ||
| 785 | |||
| 786 | 38 | wil | Get EditorHandle To hoEditor | 
| 787 | 4 | wil | If (hoEditor) Begin | 
| 788 | Get ComLineCount Of hoEditor To iCount | ||
| 789 | End | ||
| 790 | Function_Return iCount | ||
| 791 | 22 | wil | End_Function // EditorLineCount | 
| 792 | 24 | wil | |
| 793 | Procedure Show_Status_Help String sStatusHelp | ||
| 794 | Integer iLine | ||
| 795 | 38 | wil | Handle hoEditor | 
| 796 | String sFileName | ||
| 797 | 24 | wil | |
| 798 | 38 | wil | Move "" To sFileName | 
| 799 | Get EditorHandle To hoEditor | ||
| 800 | If (hoEditor) Begin | ||
| 801 | Get psFileName of hoEditor To sFileName | ||
| 802 | End | ||
| 803 | 24 | wil | Get EditorCurrentLine To iLine | 
| 804 |               Set psText Of oStatusPane1 To ("Line: "+trim(iLine))
 | ||
| 805 | 38 | wil |               Set psText Of oStatusPane2 To ("File: "+sFileName)
 | 
| 806 | 24 | wil | End_Procedure | 
| 807 | 2 | wil | |
| 808 | End_Object | ||
| 809 | |||
| 810 | End_Object | ||
| 811 | |||
| 812 | Object oClientArea is a ClientArea | ||
| 813 | Use StdAbout.pkg | ||
| 814 | 40 | wil | Use ObjectInspector.dg | 
| 815 | 7 | wil | Use Vdfdbg.vw | 
| 816 | 2 | wil | |
| 817 | 24 | wil | Procedure doActivateObjectInspectorPanel | 
| 818 | 53 | wil | Send StartObjectInspector | 
| 819 | 24 | wil | End_Procedure | 
| 820 | |||
| 821 | 37 | wil | |
| 822 | |||
| 823 | 2 | wil | Procedure Activate_About | 
| 824 | 37 | wil | String sTitle sCopyright sVersion sBitmap sAuthor | 
| 825 | |||
| 826 | // string sVal sVal2 sVal3 | ||
| 827 | // move (SysConf(sysconf_os_name)) to sVal | ||
| 828 | // send Info_box sVal "Os Name" | ||
| 829 | // move (SysConf(sysconf_os_short_name)) to sVal2 | ||
| 830 | // send Info_box sVal2 "os short name" | ||
| 831 | // move (SysConf(sysconf_os_major_rev)) to sVal3 | ||
| 832 | // send Info_Box sVal3 "os major revision" | ||
| 833 | // // | ||
| 834 | Move "VdfSplat" to sTitle | ||
| 835 | Move "Alfa 1" to sVersion | ||
| 836 | Move "Copyright 2015, GPL v2, Antwise Solutions" to sCopyright | ||
| 837 | Move "Author: Wil van Antwerpen" to sAuthor | ||
| 838 | Move "Debugger.bmp/t" to sBitMap | ||
| 839 | Send DoAbout sTitle sVersion sCopyright sAuthor sBitMap | ||
| 840 | 2 | wil | End_Procedure | 
| 841 | |||
| 842 | End_Object | ||
| 843 | |||
| 844 | End_Object | ||
| 845 | |||
| 846 | 35 | wil | |
| 847 | Procedure StartDebugging | ||
| 848 | String sApplication | ||
| 849 | Handle hoClient | ||
| 850 | |||
| 851 | Get Client_Id Of oMain To hoClient | ||
| 852 | If (hoClient) Begin | ||
| 853 | Send Activate_oVdfdbg of hoClient | ||
| 854 | Get psApplication of ghoApplication to sApplication | ||
| 855 | If (sApplication<>"") Begin | ||
| 856 | Send doDebugRun of hoClient | ||
| 857 | End | ||
| 858 | End | ||
| 859 | End_Procedure | ||
| 860 | |||
| 861 | Send StartDebugging | ||
| 862 | 2 | wil | Start_UI |