DEBUG FASTER DEBUG SMARTER Primo Gabrijeli thedelphigeek http
DEBUG FASTER DEBUG SMARTER Primož Gabrijelčič @thedelphigeek http: //primoz. gabrijelcic. org Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
INFO Slides and code are available at http: //thedelphigeek. com/p/presentations. html Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
BASICS • • • F 9 Shift+Ctrl+F 9 Ctrl+F 2 F 4 F 8 F 7 Shift+F 8 F 5 Shift+F 5 Run with debugging Run without debugging Program reset Run to current position Step over Trace into Trace to next source line Run until return Toggle breakpoint Enable/disable breakpoint Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
SETTINGS / PROJECT OPTIONS • Project, Options, Delphi Compiler, Compiling • Optimization • Debug information • Use debug. dcu‘s • Selective Debugging Expert by Uwe Raabe http: //www. uweraabe. de/Blog/2015/05/08/selective-debugging/ Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
SETTINGS / IDE OPTIONS • Tools, Options, Debugger Options • General • Event log Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
BREAKPOINTS Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
PROPERTIES • Enabled • Shift-F 5 • Condition • slow • code • Debug. Break(condition) • Pass count • slow • Narrowing down reproducible problems Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
SIDE EFFECTS • Break • Log message • Eval expression • Output. Debug. String • Loggers (Code. Site …) • Log to console • Log call stack Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
GROUPS • • Group Enable group Disable group manual toggle Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
MULTITHREADED PROGRAMS • Properties, Thread • Freeze all other threads • Thaw all threads Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
EXCEPTIONS • Tools, Options • Debugger Options • Embarcadero Debuggers • Language Exceptions • Ignore subsequent exceptions • Handle subsequent exceptions • Exception. Class Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
HARDWARE BREAKPOINTS • Address • Code execution • Can be set on read-only memory • Data access • Limited number • DR 0 … DR 3 • Disabled on program restart Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
TIPS AND TRICKS • Run until return • Moving a breakpoint • with mouse • Options, Line number • Moving execution point • with mouse • Set next statement • “repeat last statement” • Call stack breakpoints • Disable/enable all Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
Q&A Slides and code are available at http: //thedelphigeek. com/p/presentations. html Code. Rage XI – Productivity, Platforms and Performance – embt. co/Code. Rage. XI
- Slides: 14