codekingpro/portable-devtools
114k
1��� �sphinx.addnodes��document���)��}�(� rawsource�� ��children�]�(�docutils.nodes��target���)��}�(h�
.. _debugger:�h]��2attributes�}�(�ids�]��classes�]��names�]��dupnames�]��backrefs�]��refid��debugger�u�tagname�h3�line�K�parent�h� _document�h�source��cD:\a\pgadmin-packaging-foundation\pgadmin-packaging-foundation\pgadmin4-8.6\docs\en_US\debugger.rst�ubh �section���)��}�(hhh]�(h �title���)��}�(h�`Debugger`:index:�h]�(h �index���)��}�(hhh]�h}�(h]�h]�h]�h]�h]��entries�]�(�single��Debugger��index-0�hNt�auhh/h"h#hKh h+ubh)��}�(hhh]�h}�(h]�h>ah]�h]�h]�h]�uhh4h h+ubh �Text����Debugger�����}�(h h+h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhh)h h&h!hh"h#hKubh �image���)��}�(h�L.. image:: images/debug_main.png5 :alt: Debugger page6 :align: center7�h]�h}�(h]�h]�h]�h]�h]��alt��
Debugger page��align��center��uri��images/debug_main.png��8candidates�}��*�hfsuhhUh"h#hKh h&h!hubh � paragraph���)��}�(hXU The debugger may be used to debug PL/pgSQL functions in PostgreSQL, as well as9EDB-SPL functions, stored procedures and packages in EDB Postgres Advanced10Server. The Debugger is available as an extension for your PostgreSQL11installation, and is distributed as part of Advanced Server. You must have12superuser privileges to use the debugger.�h]�hJXU The debugger may be used to debug PL/pgSQL functions in PostgreSQL, as well as13EDB-SPL functions, stored procedures and packages in EDB Postgres Advanced14Server. The Debugger is available as an extension for your PostgreSQL15installation, and is distributed as part of Advanced Server. You must have16superuser privileges to use the debugger.�����}�(h hlh!hh"NhNubah}�(h]�h]�h]�h]�h]�uhhjh"h#hKh h&h!hubhk)��}�(h��Before using the debugger, you must modify the *postgresql.conf* file, adding17the server-side debugger components to the value of the18*shared_preload_libraries* parameter, for example:�h]�(hJ�/Before using the debugger, you must modify the �����}�(h hzh!hh"NhNubh �emphasis���)��}�(h�*postgresql.conf*�h]�hJ�postgresql.conf�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh�h hzubhJ�F file, adding19the server-side debugger components to the value of the20�����}�(h hzh!hh"NhNubh�)��}�(h�*shared_preload_libraries*�h]�hJ�shared_preload_libraries�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh�h hzubhJ� parameter, for example:�����}�(h hzh!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhjh"h#hKh h&h!hubh �block_quote���)��}�(h�5shared_preload_libraries = '$libdir/plugin_debugger'21�h]�hk)��}�(h�4shared_preload_libraries = '$libdir/plugin_debugger'�h]�hJ�8shared_preload_libraries = ‘$libdir/plugin_debugger’�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhhjh"h#hKh h�ubah}�(h]�h]�h]�h]�h]�uhh�h"h#hKh h&h!hubhk)��}�(h�bAfter modifying the *shared_preload_libraries* parameter, restart the server to22apply the changes.�h]�(hJ�After modifying the �����}�(h h�h!hh"NhNubh�)��}�(h�*shared_preload_libraries*�h]�hJ�shared_preload_libraries�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh�h h�ubhJ�4 parameter, restart the server to23apply the changes.�����}�(h h�h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhjh"h#hKh h&h!hubhk)��}�(hX� The debugger may be used for either in-context debugging or direct debugging of24a target function or procedure. When you use the debugger for in-context25debugging, you set a breakpoint at the first line of a program; when a session26invokes the target, control is transferred to the debugger. When using direct27debugging, the debugger prompts you for any parameters required by the target,28and then allows you to step through the code.�h]�hJX� The debugger may be used for either in-context debugging or direct debugging of29a target function or procedure. When you use the debugger for in-context30debugging, you set a breakpoint at the first line of a program; when a session31invokes the target, control is transferred to the debugger. When using direct32debugging, the debugger prompts you for any parameters required by the target,33and then allows you to step through the code.�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhhjh"h#hKh h&h!hubh%)��}�(hhh]�(h*)��}�(h�In-context Debugging�h]�hJ�In-context Debugging�����}�(h h�h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh)h h�h!hh"h#hK"ubhk)��}�(h��To set a breakpoint at the first line of a program, right-click the name of the34object you would like to debug, and select *Set breakpoint* from the *Debugging*35sub-menu. The debugger window will open, waiting for another session to invoke36the program.�h]�(hJ�{To set a breakpoint at the first line of a program, right-click the name of the37object you would like to debug, and select �����}�(h j h!hh"NhNubh�)��}�(h�*Set breakpoint*�h]�hJ�Set breakpoint�����}�(h j h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh�h j ubhJ�38 from the �����}�(h j h!hh"NhNubh�)��}�(h�*Debugging*�h]�hJ� Debugging�����}�(h j! h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh�h j ubhJ�]39sub-menu. The debugger window will open, waiting for another session to invoke40the program.�����}�(h j h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhjh"h#hK$h h�h!hubhV)��}�(h�g.. image:: images/debug_set_breakpoint.png41 :alt: Debugger set a breakpoint demo42 :align: center43�h]�h}�(h]�h]�h]�h]�h]��alt��Debugger set a breakpoint demo��align��center��uri��images/debug_set_breakpoint.png�hg}�hijH suhhUh"h#hK)h h�h!hubhk)��}�(h��When another session invokes the target, the debugger will display the code,44allowing you to add break points, or step through line-by-line. The other45session is suspended until the debugging completes; then control is returned46to the session.�h]�hJ��When another session invokes the target, the debugger will display the code,47allowing you to add break points, or step through line-by-line. The other48session is suspended until the debugging completes; then control is returned49to the session.�����}�(h jJ h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhhjh"h#hK-h h�h!hubhV)��}�(h�Z.. image:: images/debug_ic_step_in.png50 :alt: Debugger step-in demo51 :align: center52�h]�h}�(h]�h]�h]�h]�h]��alt��Debugger step-in demo��align��center��uri��images/debug_ic_step_in.png�hg}�hijg suhhUh"h#hK2h h�h!hubeh}�(h]��in-context-debugging�ah]�h]��in-context debugging�ah]�h]�uhh$h h&h!hh"h#hK"ubh%)��}�(hhh]�(h*)��}�(h�Direct Debugging�h]�hJ�Direct Debugging�����}�(h jt h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh)h jq h!hh"h#hK7ubhk)��}�(hX53 To use the debugger for direct debugging, right click on the name of the object54that you wish to debug in the pgAdmin tree control and select *Debug* from the55*Debugging* sub-menu. The debugger window will open, prompting you for any56values required by the program:�h]�(hJ��To use the debugger for direct debugging, right click on the name of the object57that you wish to debug in the pgAdmin tree control and select �����}�(h j� h!hh"NhNubh�)��}�(h�*Debug*�h]�hJ�Debug�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh�h j� ubhJ�58 from the59�����}�(h j� h!hh"NhNubh�)��}�(h�*Debugging*�h]�hJ� Debugging�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh�h j� ubhJ�` sub-menu. The debugger window will open, prompting you for any60values required by the program:�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhjh"h#hK9h jq h!hubhV)��}�(h�G.. image:: images/debug_params.png61 :alt: Debugger parameter dialog62�h]�h}�(h]�h]�h]�h]�h]��alt��Debugger parameter dialog��uri��images/debug_params.png�hg}�hij� suhhUh"h#hK>h jq h!hubhk)��}�(h�NUse the fields on the *Debugger* dialog to provide a value for each parameter:�h]�(hJ�Use the fields on the �����}�(h j� h!hh"NhNubh�)��}�(h�63*Debugger*�h]�hJ�Debugger�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh�h j� ubhJ�. dialog to provide a value for each parameter:�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhjh"h#hKAh jq h!hubh�)��}�(hX� * The *Name* field contains the formal parameter name.64* The *Type* field contains the parameter data type.65* Check the *Null?* checkbox to indicate that the parameter is a NULL value.66* Check the *Expression?* checkbox if the Value field contains an expression.67* Use the *Value* field to provide the parameter value that will be passed to68 the program. When entering parameter values, type the value into the69 appropriate cell on the grid, or, leave the cell empty to represent NULL,70 enter '' (two single quotes) to represent an empty string, or to enter a71 literal string consisting of just two single quotes, enter \'\'. PostgreSQL72 8.4 and above supports variadic function parameters. These may be entered as73 a comma-delimited list of values, quoted and/or cast as required.74* Check the *Use default?* checkbox to indicate that the program should use75 the value in the Default Value field.76* The *Default Value* field contains the default value of the parameter.77�h]�h �bullet_list���)��}�(hhh]�(h � list_item���)��}�(h�4The *Name* field contains the formal parameter name.�h]�hk)��}�(hj� h]�(hJ�The �����}�(h j� h!hh"NhNubh�)��}�(h�*Name*�h]�hJ�Name�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh�h j� ubhJ�* field contains the formal parameter name.�����}�(h j� h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhjh"h#hKCh j� ubah}�(h]�h]�h]�h]�h]�uhj� h"h#hKCh j� ubj� )��}�(h�2The *Type* field contains the parameter data type.�h]�hk)��}�(hj h]�(hJ�The �����}�(h j h!hh"NhNubh�)��}�(h�*Type*�h]�hJ�Type�����}�(h j" h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh�h j ubhJ�( field contains the parameter data type.�����}�(h j h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhjh"h#hKDh j ubah}�(h]�h]�h]�h]�h]�uhj� h"h#hKDh j� ubj� )��}�(h�JCheck the *Null?* checkbox to indicate that the parameter is a NULL value.�h]�hk)��}�(hjB h]�(hJ�78Check the �����}�(h jD h!hh"NhNubh�)��}�(h�*Null?*�h]�hJ�Null?�����}�(h jK h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh�h jD ubhJ�9 checkbox to indicate that the parameter is a NULL value.�����}�(h jD h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhjh"h#hKEh j@ ubah}�(h]�h]�h]�h]�h]�uhj� h"h#hKEh j� ubj� )��}�(h�KCheck the *Expression?* checkbox if the Value field contains an expression.�h]�hk)��}�(hjk h]�(hJ�79Check the �����}�(h jm h!hh"NhNubh�)��}�(h�
*Expression?*�h]�hJ�Expression?�����}�(h jt h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh�h jm ubhJ�4 checkbox if the Value field contains an expression.�����}�(h jm h!hh"NhNubeh}�(h]�h]�h]�h]�h]�uhhjh"h#hKFh ji ubah}�(h]�h]�h]�h]�h]�uhj� h"h#hKFh j� ubj� )��}�(hX� Use the *Value* field to provide the parameter value that will be passed to80the program. When entering parameter values, type the value into the81appropriate cell on the grid, or, leave the cell empty to represent NULL,82enter '' (two single quotes) to represent an empty string, or to enter a83literal string consisting of just two single quotes, enter \'\'. PostgreSQL848.4 and above supports variadic function parameters. These may be entered as85a comma-delimited list of values, quoted and/or cast as required.�h]�hk)��}�(hX� Use the *Value* field to provide the parameter value that will be passed to86the program. When entering parameter values, type the value into the87appropriate cell on the grid, or, leave the cell empty to represent NULL,88enter '' (two single quotes) to represent an empty string, or to enter a89literal string consisting of just two single quotes, enter \'\'. PostgreSQL908.4 and above supports variadic function parameters. These may be entered as91a comma-delimited list of values, quoted and/or cast as required.�h]�(hJ�Use the �����}�(h j� h!hh"NhNubh�)��}�(h�*Value*�h]�hJ�Value�����}�(h j� h!hh"NhNubah}�(h]�h]�h]�h]�h]�uhh�h j� ubhJX� field to provide the parameter value that will be passed to92the program. When entering parameter values, type the value into the93appropriate cell on the grid, or, leave the cell empty to represent NULL,94enter ‘’ (two single quotes) to represent an empty string, or to enter a95literal string consisting of just two single quotes, enter '