Toad's optional Debugger module provides you with the functionality to easily debug PL/SQL procedures, functions, and triggers. In addition, you can debug SQL scripts using Script debugging, and Java using Java debugging.
To see if you have the debugger module installed, select Help|About. The Options entry at the top of the window should include Debugger.
To use the Debugger
Note: If you are debugging on a RAC instance, see the Debugging on a RAC tips.
Enter code into the Editor.
From the Debug menu, select the debugger you want to use (DBMS, JDWP, or Script)
Make sure the
debug button is depressed and then compile your code with
debug information by clicking Compile Code button.
Set Breakpoints and Watches.
Click the lightning bolt to execute code. Execution will stop if it encounters a breakpoint.
You can execute code slowly by using the following instead:
Step over - will step through the code, but if there is a called subroutine, it forces execution to skip the subroutine rather than stepping into it.
Trace into - steps into code one line at a time: called subroutines will be opened and stepped through as well.
Trace out of - skips the rest of the called procedure and returns you to the original code.
Run to cursor - executes code only to the location of your cursor.
To end a debugging session while you are stepping through code
Click the Halt button on the toolbar.