The Debugging Process
Debugging an application is an iterative process in which application
errors are identified and corrected. In general, quickly identifying and
locating errors in code is essential to successfully debugging your application.
The methods of monitoring and debugging code in an application are:
- by compiling--All syntax errors and object reference
errors are reported when you compile code or generate a module. Correct
these errors in the PL/SQL Editor before runtime.
- by displaying debug messages--If the runtime parameter DEBUG_MESSAGES
is set to YES, you can monitor the execution of code within triggers during
runtime. Whenever an event causes a trigger to fire at runtime, the Builder
displays a message box just before the trigger is fired. The message specifies
the name of the trigger that is being executed and the level at which it is
defined, which enables you to check if certain triggers are firing, the origin
and level of the triggers, and the time when they fire.
- by invoking the debugger at runtime--When you
run your application in debug mode, you can step through code line-by-line
and monitor the execution of code within triggers or called PL/SQL program
units. This helps you to identify the line of code that is causing a logical
application error.
The first method enables you to debug code before runtime whereas the
other two methods enable you to debug code while the application is running.
In particular the third method, using the debugger, enables you to monitor
and modify the runtime environment while the application is running. You
can also set breakpoints to analyze the application state at specific
points.
Debugging an application using the integrated, interactive PL/SQL debugger
in the Builder could involve the following stages:
- Run the application in debug mode.
- Pause the application at a certain point in its
execution to examine the runtime environment.
- Set breakpoints in the code to suspend its execution
at specific locations.
- Modify variable values and form item values to
test the effect.
- Step through the code to examine how each line
affects the environment and the application.
Note: Breakpoints
can be set before you run the application in debug mode. Also, breakpoints
set in a Builder session are discarded when you exit the session.
Related Topics
About Starting the Debugger
Creating a Breakpoint
Stepping Through Code
Suspending Application Execution During Debugging
Terminating a Debugger
Session