This section describes how to use the Insight GUI in all application debugging scenarios, including the analysis of a process dump. The use of the GDB command line interface is described in the following sections.
Before starting Insight, make sure that:
RDBC is running on the target (for standard application debugging). If RDBC is not running, run it without any argument.
RDBD is running on the host (for process dump analysis).
The name of the Insight executable differs according to the target platform and takes the form target-type-chorusos-gdb. Thus, depending on the platform, type one of the following to start Insight:
$ sparc-chorusos-gdb
$ powerpc-chorusos-gdb
$ i386-chorusos-gdb
By default, the Insight GUI is started when you start GDB. The main window of the Insight GUI is shown in Figure 2-2.
The following procedures describe how to connect to the target using the Insight GUI and how to load the application to be debugged.
Open the Target Selection Window.
Select File -> Target Settings to display the Target Selection window:
Select ChorusOS Applicative Debug from the Target list.
Specify the target or host name.
In the Target name field, type the remote target name or IP address (to perform a standard application debug) or the host name or IP address of the machine on which RDBD is running (to analyze a process dump).
Specify the port.
In the Port number field, type RDBC (equivalent to 2072), RDBD (equivalent to 0) or a different port number to use for the connection.
Click OK to save the target settings.
Select Run -> Connect to target.
The connection has been completed successfully when the message Successfully connected
is displayed.
If you select Run -> Connect to target before you have set your target or loaded an executable, the Target Selection window is displayed automatically.
All GDB commands are accessible from the Insight Console window. In addition, certain commands are accessible from the various ChorusOS windows.
Select File -> Open.
The Load New Executable window is displayed:
Select the application to debug and click Open.
After you have selected the application, the source of the application is displayed in the Source window:
All GDB commands have an equivalent in Insight. All the commands are accessible from the Insight Console. In addition, certain commands are accessible from the ChorusOS windows.
For additional information on using the Insight GUI, refer to the README.GDBTK file, located in install_dir/chorus-family/opt/gdb/doc/.
The way in which you execute an application depends on whether you are performing standard application debugging or analyzing a process dump.
If you are performing standard application debugging, the application can be executed in three ways:
Select Run from the Run menu.
Click the Run button on the toolbar.
When GDB is busy (during the execution of a program, for example) the Run button is replaced by a Stop button. Use this button to stop the application.
Select View -> Console and use the run command in the View -> Console window.
If nothing happens when you attempt to execute your application in Insight, perform the following checks:
Open the Console window and type run.
If the following message is displayed:
Warning: executable path does not match the path translation. Unable to create remote process, File not found (maybe / has changed).
refer to "Loading and Executing the Application" for assistance in solving the problem.
If you consistently have the same problem, check whether your program links to one or more dynamic libraries. If your program does link to dyamic libraries, you must add the environment variable LD_LIBRARY_PATH, with a value set to the path where the libraries are located.
You can add the library path environment variable using the ChorusOS Environment Variables window (see "Displaying ChorusOS Environment Variables" for more information), or using the Console window. To add the variable using the Console window, type:
(chgdb) rdbsetenv LD_LIBRARY_PATH=/bin/examples:/bin/lib PATH=/bin:/sbin HOST= TZ=GMT0 LD_LIBRARY_PATH=/bin/examples:/bin/lib (chgdb) |
where LD_LIBRARY_PATH is the path to the libraries.
Before performing a process dump analysis, select the process dump you want to analyze. Use the ChorusOS Processes window to attach to the process dump. See "Displaying ChorusOS Processes" for more information.
Alternatively, you can use the command-line interface in the Console window.