Using the load launch configuration

To create a launch configuration that will load a compiled language application for debugging, complete the steps in this topic. The application must reside on the same AIX machine that is running the debugger user interface client.

About this task

Procedure

  1. Select File > New launch > Load a program from the debugger main menu.
  2. In the Name field, enter a name of your choice for the configuration that you are creating.
  3. Select the Main tab to bring it to the foreground.
  4. Enter the full path and name of the program that you want to debug in the Executable field. Alternatively, you can browse for the program by clicking Browse. Completion of this field is mandatory.
    Note: The Browse action only allows you to browse the machine that is running the debugger user interface client.
  5. In the Parameters field, enter any program parameters that are required by the application that you want to debug. This step is optional.
  6. Select the Run to main radio button to run to the main entry point of your program. Select the Stop in initialization radio button to stop before running any code in your application. For instance, stopping in initialization would allow you to debug the constructor of a static C++ object.
  7. Select the Advanced tab, in which you can make the following settings:
    • Always follow parent when process forks: This controls the behavior of the debugger when the debugged process calls fork(). If this check box is not selected, the debugger will stop and ask which process to debug. If this check box is selected, the debugger will not stop - it will continue to debug the parent process.
    • Show system threads: Some versions of the pthread library have a system thread, which runs the threading. By default, the debugger does not show this thread. Selecting this check box forces this thread to be shown. Most users will not need to display this.

      When this check box is selected, the engine will ignore the presence of the pthread library, and only show kernel threads.

    • Displayed tab width: Specifies the interval between tabs to be used when expanding tabs in the source file view of the user interface. The default is 8.
    • Enable deep step debug: By default, the step-debug function only checks the immediate sub-routine for debug information. If this check box is selected, the engine will step-into until a location with debug information is found. This can be slow if you have large amounts of code with no debug information.
    • Disable background debug information reading: The debugger reads and interprets debug information from the program being debugged only as it needs to. When this check box is not selected, the debugger will continue reading debug information while it is otherwise idle. This usually improves debug performance, but it may slow the debugger down if the program being debugged is extremely large.
    • Enable the engine service trace: This setting is used for diagnostic purposes. Select it only when instructed by an IBM service representative.
  8. To set the Source Lookup Path, select the Source tab and perform any of these tasks:
    • To add a source location, click Add. This will invoke the Add Source dialog box, in which you can select the type of source location to add. In the selection list in the Add Source dialog box, the Debug engine, Debug engine path, and File System Directory options are most applicable when debugging on AIX. If you choose Debug engine, the debug engine will be added to the source search path. The other two selections will result in a dialog box in which you can enter or browse for the source search path location that you want to use.
    • To remove an existing entry, select a source location and click Remove.
    • To set the order of existing entries, select a source location and click Up or Down to alter that location's placement.
      Note: In some cases, changing the placement of a location might not take effect until the next time the program is launched.

    If you want to search for all instances of the source file name in the source search path, select the Search for duplicate source files on the path check box. If you select this check box and the debugger finds multiple instances of the file name, you will be prompted by a dialog box to choose the correct source file.

  9. Select the Environment tab to bring it to the foreground. In the Environment page, you can set environment variables for your debug session. Settings that you make in this page will only affect your debug session.
    Note: Changes made in this tab will only affect the debug engine and the process to debugged.

    You might need to set environment variables for a variety of factors, for example, to specify the location of the executable for an application that is required for the debug session. To set environment variables in this page, perform any of these tasks:

    • By default, if you launched the workbench from a command line or batch file with environment variables set, these will be the default environment variables used for the debug session.
    • To add an environment variable for the debug session, click the New button and then complete the New Environment Variable dialog box with the appropriate values. The environment variable will be added to the default environment variables.
    • To remove an environment variable for the debug session, select it from the Environment variables to set list and then choose the Remove button.
    • Click Select to open a dialog box that allows you to add any variable that is currently in the environment.
  10. If all information mandatory to the launch configuration has been provided, the Debug and Apply push buttons will be enabled. Clicking Apply will save the launch configuration, at which point you can choose to close the dialog box without launching the debug session or you can click Debug to launch a debug session using the new launch configuration. If you click Debug, any changes to the launch configuration will be saved and a debug session will be launched.
    Tip: If you have not yet saved launch configuration settings and if you have made entries in the launch configuration settings that you want to remove or change, clicking Revert will remove all changes that you have made.
  11. If information mandatory to the launch configuration has not been provided or if there are errors in the information that you have provided, messages at the top of the dialog box will indicate what is missing.
  12. If you did not use the dialog box to launch a debug session (for example, you used it instead to create and save a launch configuration), click Close to exit the dialog box when you are finished working in it.

Results

To delete a launch configuration, select File > Launches > Delete Launches from the debugger main menu. This will open a dialog box, in which you can select the launch or launches that you want to remove.

To launch a debug session with a launch configuration that you have already created, select File > Launches > <launch>, where <launch> is the launch configuration name that you specified when creating the launch configuration. This will open the launch configuration dialog box with the saved settings for the launch configuration. You can edit these settings before using the launch configuration again.


Feedback