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:

VdfSplat.src
163 163
      End
164 164
    End_Procedure // doOpenFile
165 165
    
166
    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
    
166 203
    Procedure doDebugRun
167 204
      String  sApplication
168
      String  sExt
169
      String  sDebugfile
170
      Integer iRuntime
171 205
      Boolean bOpen
172 206
      Boolean bExists
207
      Boolean bRestartMode
173 208
      Handle  hoDebug
174 209
      Handle  hoParent
175 210
      Handle  hoDialog
176 211
      
177
      Set piDebugfileVersion To 0
178

  
179 212
      Get psApplication of ghoApplication To sApplication
180 213
      If (sApplication = "") Begin
181 214
        Move (oOpenProgramDialog(Self)) To hoDialog
......
193 226
        // Oh still no app? Use our hardcoded path
194 227
        Procedure_Return
195 228
      End
196
      Get ParseFileExtension sApplication To sExt
197
      Move (Replace("."+sExt,sApplication,".dbg")) To sDebugfile
198
      Get vFilePathExists sDebugfile to bExists
199
      If (bExists=false) Begin
200
        Send Warning_Box ("Sorry but for the executable chosing the corresponding debug file\n"+;
201
               sDebugfile+"\ncould not be located.\n\nPlease select again.") ;
202
               "VdfSplat can't do that"
203
      End
204
      Else Begin
205
        Get ReadRuntimeVersion sDebugfile To iRuntime
206
        If (iRuntime=0) Begin
207
          Move False To bExists
229
      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 
208 237
        End
209 238
      End
210
        
211
      Get phoDebugger to hoDebug
212 239
      If (bExists and hoDebug=0) Begin
213 240
        //
214 241

  
215 242
        Get phoDebuggerHost To hoParent
216
        Set piDebugfileVersion To iRuntime
217
        Get Create Of hoParent U_cDebuggerEngine To hoDebug
243
        Get Create Of hoParent (RefClass(cDebuggerEngine)) To hoDebug
218 244
        If (hoDebug) Begin
219 245
          Send DoCreateEngine of hoDebug
220 246
        End
......
251 277
    End_Procedure
252 278
    
253 279
    Procedure doStopDebug
254
      Handle hoDebug
280
      Boolean bPaused
281
      Boolean bBreakMode
282
      Handle  hoDebug
255 283
      
256 284
      Get phoDebugger to hoDebug
257 285
      If (hoDebug) Begin
286
        Get pbLimitedBreakMode of hoDebug to bBreakMode
287
        Get HasProgramPaused To bPaused
288
        If (bPaused) Begin
289
          //Send doDebugContinue
290
        End
258 291
        Send ComStopProgram of hoDebug
259 292
        Send ComUpdateViews Of hoDebug
260
        Set psApplication of ghoApplication To ""
293
        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  
261 299
      End
262 300
    End_Procedure // doStopDebug
263 301
    
302
    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
    
264 312
    Procedure doDebugPause
265 313
      Handle hoDebug
266 314
      
......
390 438
    //
391 439
    // A program can only be paused after it has started
392 440
    // This is used as an indication that we can step through the source
393
    //
441
    // The property pbProgramPaused is set on both a breakpoint and on a Pause
394 442
    Function HasProgramPaused Returns Boolean
395 443
      Boolean bPaused
396 444
      Boolean bStarted

Also available in: Unified diff