Pgdbg: Difference between revisions

Jump to navigation Jump to search
222 bytes added ,  5 years ago
Marked this version for translation
(Marked this version for translation)
Line 1: Line 1:
<languages />
<languages />
<translate>
<translate>
<!--T:4-->
PGDBG is a powerful and simple tool for debugging both MPI-parallel and OpenMP thread-parallel Linux applications. It is included in the PGI compiler package and configured for OpenMP thread-parallel debugging.
PGDBG is a powerful and simple tool for debugging both MPI-parallel and OpenMP thread-parallel Linux applications. It is included in the PGI compiler package and configured for OpenMP thread-parallel debugging.


<!--T:5-->
For the most of the C, C++, or Fortran 77 codes one can use a regular GNU debugger such as GDB. However, the Fortran 90/95 programs are not handled very well by the GDB. The Portland Group has developed a debugger called [https://www.pgroup.com/products/tools.htm/pgdbg.htm pgdbg]  which is more suited for such codes. Pgdbg is provided in two modes: a graphical mode with the enabled X11 forwarding or a text mode.  
For the most of the C, C++, or Fortran 77 codes one can use a regular GNU debugger such as GDB. However, the Fortran 90/95 programs are not handled very well by the GDB. The Portland Group has developed a debugger called [https://www.pgroup.com/products/tools.htm/pgdbg.htm pgdbg]  which is more suited for such codes. Pgdbg is provided in two modes: a graphical mode with the enabled X11 forwarding or a text mode.  


= Quickstart guide =  
= Quickstart guide = <!--T:6-->
Using PGDBG usually consists of two steps:
Using PGDBG usually consists of two steps:
# '''Compilation''': Compile the code with the debugging enabled
# '''Compilation''': Compile the code with the debugging enabled
Line 21: Line 23:
{{Command|module load pgi/17.3}}
{{Command|module load pgi/17.3}}


== Compiling your code ==
== Compiling your code == <!--T:7-->
To be able to debug with pgdbg you first need to compile your code with debugging information enabled. With the pgdbg you do so by adding a debugging flag "-g":
To be able to debug with pgdbg you first need to compile your code with debugging information enabled. With the pgdbg you do so by adding a debugging flag "-g":
{{Command|pgcc -g program.c -o program}}
{{Command|pgcc -g program.c -o program}}


== Command-line mode ==  
== Command-line mode == <!--T:8-->
Once your code is compiled with the proper options, you can run the PGDBG for the analysis. The debugger's default user interface is a graphical user interface or GUI. However, if for some reasons you don't want to run in GUI or don't have X11 forwarding, you can run pgdbg in a text mode by adding an extra option "-text" :
Once your code is compiled with the proper options, you can run the PGDBG for the analysis. The debugger's default user interface is a graphical user interface or GUI. However, if for some reasons you don't want to run in GUI or don't have X11 forwarding, you can run pgdbg in a text mode by adding an extra option "-text" :
{{Command|pgdbg -text program arg1 arg2}}
{{Command|pgdbg -text program arg1 arg2}}


<!--T:9-->
Once the PGDBG is invoked in the command-line mode, you will have an access to prompt:
Once the PGDBG is invoked in the command-line mode, you will have an access to prompt:
{{Command
{{Command
Line 40: Line 43:
}}
}}


<!--T:10-->
Before you can debug you need to execute ''run'' in the prompt:
Before you can debug you need to execute ''run'' in the prompt:
{{Command
{{Command
Line 57: Line 61:
}}
}}


<!--T:11-->
For example, now we switch the context to thread with ID 2. Use command ''thread'' to do so:
For example, now we switch the context to thread with ID 2. Use command ''thread'' to do so:
{{Command ||result=
{{Command ||result=
Line 68: Line 73:
}}
}}


== Graphical mode ==
== Graphical mode == <!--T:12-->
This is the default user interface of the PGDBG debugger. If you have set the X11 forwarding then the PGDBG will start in the graphical mode in a pop-up window.  
This is the default user interface of the PGDBG debugger. If you have set the X11 forwarding then the PGDBG will start in the graphical mode in a pop-up window.  


<!--T:13-->
[[File:Pgdbg_gui_schematic.png|thumbnail|300px|PGDGB in graphical mode(click for a larger image)|left  ]]
[[File:Pgdbg_gui_schematic.png|thumbnail|300px|PGDGB in graphical mode(click for a larger image)|left  ]]
As the illustration shows, the GUI is divided into several areas:  
As the illustration shows, the GUI is divided into several areas:  
Line 79: Line 85:
* and debug information tabs.
* and debug information tabs.


=== Menu bar ===
=== Menu bar === <!--T:14-->
The main menu bar contains these menus: File, Edit, View, Connections, Debug and Help. This section describes these menus and their contents. You can navigate the menus using the mouse or the system’s mouseless modifier.
The main menu bar contains these menus: File, Edit, View, Connections, Debug and Help. This section describes these menus and their contents. You can navigate the menus using the mouse or the system’s mouseless modifier.


=== Main toolbar ===
=== Main toolbar === <!--T:15-->
The debugger's main toolbar contains several buttons and four drop-down lists. The first drop-down list displays the current process or in other words, the current thread. The list’s label changes depending on whether processes or threads are described. When multiple threads are available  use this drop-down list to specify which process or thread should be the current one.  
The debugger's main toolbar contains several buttons and four drop-down lists. The first drop-down list displays the current process or in other words, the current thread. The list’s label changes depending on whether processes or threads are described. When multiple threads are available  use this drop-down list to specify which process or thread should be the current one.  


<!--T:16-->
[[File:Pgdbg-toolbar-drop-down-lists.png|thumbnail|300px|Drop-Down Lists on Toolbar(click for a larger image)|left  ]]
[[File:Pgdbg-toolbar-drop-down-lists.png|thumbnail|300px|Drop-Down Lists on Toolbar(click for a larger image)|left  ]]


<!--T:17-->
The second drop-down list is labeled Apply. The selection in the Apply drop-down determines the set of processes and threads to which action commands are applied. The third drop-down list is labeled Display. The selection in the Display drop-down determines the set of processes and threads to which data display commands are applied.
The second drop-down list is labeled Apply. The selection in the Apply drop-down determines the set of processes and threads to which action commands are applied. The third drop-down list is labeled Display. The selection in the Display drop-down determines the set of processes and threads to which data display commands are applied.


<!--T:18-->
The fourth drop-down list, labeled as File, displays the source file that contains the current target location.
The fourth drop-down list, labeled as File, displays the source file that contains the current target location.


=== Source window ===
=== Source window === <!--T:19-->
The source window (shown on the figure below) and all of the debug information tabs are dockable tabs, meaning that they can be taken apart from the main window. This can be done by double-clicking the tab. The source window shows the source code for the current session.
The source window (shown on the figure below) and all of the debug information tabs are dockable tabs, meaning that they can be taken apart from the main window. This can be done by double-clicking the tab. The source window shows the source code for the current session.


<!--T:20-->
[[File:Pgdbg-source-win.png|thumbnail|300px|The source window contains a number of visual aids that allow you to know more about the execution of your code.(click for a larger image)|left  ]]
[[File:Pgdbg-source-win.png|thumbnail|300px|The source window contains a number of visual aids that allow you to know more about the execution of your code.(click for a larger image)|left  ]]


=== Program I/O Window ===
=== Program I/O Window === <!--T:21-->
Program output is displayed in the Program IO tab’s central window. Program input is entered into this tab’s Input field.
Program output is displayed in the Program IO tab’s central window. Program input is entered into this tab’s Input field.


=== Debug information tab ===
=== Debug information tab === <!--T:22-->
Debug information tabs take up the lower half of the debugger GUI. Each of these tabs provides a particular function or view of debug information. The following sections discuss the tabs as they appear from left-to-right in the GUI’s default configuration.
Debug information tabs take up the lower half of the debugger GUI. Each of these tabs provides a particular function or view of debug information. The following sections discuss the tabs as they appear from left-to-right in the GUI’s default configuration.


</translate>
</translate>
Bureaucrats, cc_docs_admin, cc_staff
2,306

edits

Navigation menu