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