GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing www.pgadmin.org — Debugger — pgAdmin 4 9.19 documentation
This page in other versions:
Latest
(9.19) | 9.18 | 9.17 | Development
Warning: this documentation is for a pre-release version of pgAdmin 4. Contents
Debugger¶
The debugger may be used to debug PL/pgSQL functions in PostgreSQL, as well as EDB-SPL functions, stored procedures and packages in EDB Postgres Advanced Server. The Debugger is available as an extension for your PostgreSQL installation, and is distributed as part of Advanced Server. You must have superuser privileges to use the debugger. Before using the debugger, you must modify the postgresql.conf file, adding the server-side debugger components to the value of the shared_preload_libraries parameter, for example:
After modifying the shared_preload_libraries parameter, restart the server to apply the changes. The debugger may be used for either in-context debugging or direct debugging of a target function or procedure. When you use the debugger for in-context debugging, you set a breakpoint at the first line of a program; when a session invokes the target, control is transferred to the debugger. When using direct debugging, the debugger prompts you for any parameters required by the target, and then allows you to step through the code. In-context Debugging¶To set a breakpoint at the first line of a program, right-click the name of the object you would like to debug, and select Set breakpoint from the Debugging sub-menu. The debugger window will open, waiting for another session to invoke the program.
When another session invokes the target, the debugger will display the code, allowing you to add break points, or step through line-by-line. The other session is suspended until the debugging completes; then control is returned to the session.
Direct Debugging¶To use the debugger for direct debugging, right click on the name of the object that you wish to debug in the pgAdmin tree control and select Debug from the Debugging sub-menu. The debugger window will open, prompting you for any values required by the program:
Use the fields on the Debugger dialog to provide a value for each parameter:
Provide values required by the program, and click the Debug button to start stepping through the program. The values of the arguments provided here are saved. The values will be pre-filled next time the dialog opens. To clear the values, use the Clear All button.
Using the Debugger¶The main debugger window consists of two panels and a context-sensitive toolbar. Use toolbar icons to manage breakpoints and step into or through code; hover over an icon for a tooltip that identifies the option associated with the icon. The toolbar options are:
The top panel of the debugger window displays the program body; click in the grey margin next to a line number to add a breakpoint. The highlighted line in the top panel is the line that is about to execute.
The lower panel of the debugger window provides a set of tabs that allow you to review information about the program:
As you step through a program, the Local variables tab displays the current value of each variable:
When you step into a subroutine, the Stack tab displays the call stack, including the name of each caller, the parameter values for each caller (if any), and the line number within each caller:
Select a caller to change focus to that stack frame and display the state of the caller in the upper panel. When the program completes, the Results tab displays the message returned by the server. If the program encounters an error, the Messages tab displays details:
| ||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |