TDbg - FiveWin Debugger

Fuente: source/classes/fwdbg.prg

Standalone class

TDbg is a full-featured source-level debugger for FiveWin applications. It provides a graphical debug window (oDlg) containing up to nine XBrowse panels for inspecting source code, call stack, local/private variables, arrays, objects, breakpoints, work areas, SET commands, and profiler data. The debugger is activated by compiling with #pragma /b+ or passing the /b command-line flag.

Key DATA Members

DATATypeDescription
oDlgTDialogThe debugger dialog window
oBrwTXBrowseArray or object for 9 browse panels (source, stack, vars, arrays, objects, breakpoints, areas, SETs, profiler)
aStackArrayCurrent call stack entries
aModulesArrayLoaded source modules
aBreakArrayBreakpoint definitions
aTraceArrayTrace log entries

Methods

MethodDescription
New()Create the debugger instance
Activate()Open and display the debugger dialog window
Exec()Execute the debugger main loop
DbgNext()Step to the next source line
DbgGo()Continue execution until the next breakpoint
DbgNextRoutine()Step over (execute subroutine calls without stepping into them)
DbgSetBreak( cMod, nLine )Set a breakpoint at a specific module and line
DbgSetTrace( lOn )Enable or disable trace logging
DbgEditVar( cVarName )Open an editor to modify a variable's value
DbgEditObj( oObj )Open an object inspector for a given object

Example: Debug Session

// Add this pragma to modules you want to debug:
#pragma /b+

#include "FiveWin.ch"

function Main()

   local cName := "FiveWin"
   local nCount := 0

   // The debugger opens automatically when the program
   // is compiled with /b+ and FWDbg.lib is linked.

   // Use F5 to continue, F8 to step, F9 for breakpoints
   for nCount := 1 to 5
      ? "Iteration:", nCount
      ProcessItem( cName )
   next

return nil

function ProcessItem( cItem )

   ? "Processing:", cItem

return nil

Notes

Ver También