GDB4HPC EXTENSIONA VSCode extension that provides support for debugging multi-process applications with gdb4hpc. Gdb4hpc must be installed on the target machine; it is available as part of the Cray Programming Environment. The plugin is based on the gdb vscode plugin, with all the familiar next, step and continue buttons, variable values, and backtraces, but adds additional panels for:
The other key feature of gdb4hpc is the process set notation which aggregates identical results. Thus the value of a variable may be printed as:
To quickly highlight that the process in rank 801 is not behaving like the rest. The current online documentation for gdb4hpc and this vscode plugin are available here: https://cpe.ext.hpe.com/docs/latest/debugging-tools/gdb4hpc/guides/vscode-plugin.html
Getting StartedA launch.json file is needed. If it does not exist, create a launch.json file and copy the template below and modify as necessary.
Launching a debug jobOpen the Run and Debug panel on the left. Choose GDB4HPC in the Dropdown on the top of the panel. If GDB4HPC does not show up as an option, the extension is not installed properly or the launch.json file is not configured correctly. Press the green play button on the left of "GDB4HPC" to launch the debugger session. Once launched, this will be replaced by the pause, step, continue, next, and stop buttons.
ConsolesDifferent terminals are available on the bottom. Debug ConsoleThe Debug Console is the output console for GDB4HPC. Any information and warnings will show up here. If setupCommands is empty in the launch.json file, this Debug Console will be interactive until the "gdb4hpc" command is given which will then launch gdb4hpc. On a remote gdb4hpc connection, the Debug Console will display the remote machine information once it sets up the remote connection before the setupCommands or interactive user input can be processed. OutputThere is a drop down on the right to choose the Output Channel to view. Program Output will automatically become displayed whenever the application running produces output. Error Log will log all errors while the session is running. Errors also get displayed in a popup as they appear. Source Code DisplayThe screen displays the source code automatically when launched. The current line in the file will be highlighted for the first application and first rank by default. To change this, you can set the desired Application and Rank in the display filter. You can interact with the source code to set breakpoints and get current variable values by hovering. Left Side PanelThe left side panel provides extra ways to interact with the gui. Each section of this panel is described below. VariablesLocal variables and their values will appear here. If the value is different for different ranks it will show up as a separate field here. WatchIn this section, add a custom variable or expression to track. Call StackStack information is displayed including the threads and their current status. The current thread is marked with a selected label. BreakpointsTo set a breakpoint, you can click on the line number that you would like to break on in the source code panel and you can delete it by pressing on the line number again. After a breakpoint is created, it will be displayed under the breakpoint section of on the left side. You can enable, disable, and delete each breakpoint here.
FocusThis section allows you to see the lists of pe sets for GDB4HPC and change the focus used by GDB4HPC. The pe set in focus is marked as with *. Choose a different pe set to focus on by pressing the radio button next to it or adding it to the list by providing a name for it and its procset. If a name is omitted, the pe set will be temporary and will be removed from the list once it is no longer in focus.
Display FilterThis section allows the user to filter the information on the display. It does not change the focus in GDB4HPC. The user can add application and rank inforamation they want to be displayed to find information quicker. The user can set the application for the source code to highlight and focus on. DecompositionsTo create a decomposition, click the add button in the Decomposition section. This will make a popup appear on the top of the screen. In the pop-up enter a name for the decomposition (i.e. $decomp1) or a full decomposition command (i.e. $decomp1 10/2). If you enter in a command, the decomposition will be added to the decomposition section. If you enter just a name for the decomposition, a new popup will appear to add a decomposition subcommand. This popup will continue to reappear until it is dismissed. When the popup is dissmised, the decomposition will be saved and shown int the decomposition section.
CompareTo add a comparison, click on the add button in the comparison section. This will make a popup appear on the top of the screen where a comparison is inputted. Press enter to dismiss the popup and save the comparison. When you click the Compare button, all of the comparisons in the list that are enabled will be run. Toggle a comparison off if you do not wish to run it.
Assertion ScriptsTo add an assertion, click the add button in the Assertion section. This will make a popup appear on the top of the screen. Follow the instructions on creating the assertion script in the popup. Once a name and stop on error have been set, assertions can continue to be added until the popup is dismissed. Dismissing the popup will save the assertion script. Choose an assertion script from the list to run by selecting its radio button. Then click the Run button. Once it is done running, click on the Results button. This will update the display with the results of the run.
Further ReadingGdb4hpc has a more functionality available via the command line interface. See the online guides here: https://cpe.ext.hpe.com/docs/latest/debugging-tools/index.html#gdb4hpc |





