![]() |
|||
|
|
|
|
![]() |
|||
|
Prepare Your Program for DebuggingThe debugger supports the GNU C/C++ compilers, version 2.95 and up. To enable debugging your programs, the compiler needs to include debugging information in the executables that it builds. To this end, you can specify one of the following command line options when compiling your programs:
It is highly recommended that you turn off code optimizations (with the gcc -O0 command line flag). Note: Although the debugger should theoretically work with any compilers that emit debug information in either the STABS or DWARF format (such as Intel Compiler 8 and above), this is not widely tested. There are three ways you can debug a program:
Executing ProgramsTo execute a program from under the debugger, go to the File menu, then select Execute. The dialog box that pops up lets you select the executable file. If the name of the executable file contains white spaces, make sure to surround the filename with double quotes. Note: In text (console) mode, use theexec command.
By default, the program inherits the current environment, but you can add, remove, or edit the environment variables that are passed to the new process. To do so, in the Execute dialog, press the Environment button. Attaching to Running ProgramsTo attach to a running process, select File, then Attach. This brings up a dialog that lets you select from a tree of running processes (processes with higher privileges than your account are not shown). Loading a Core DumpCore files, or core dumps, are produced by the operating system when an application crashes (typically because it has received a signal that was not handled internally). This debugger can load core files so that applications can be debugged "post-mortem". Note:
Some shells may disable the generation of core dumps by default. To learn
more about how to enable core dumps, please consult your shell's manual pages. For
example, the Bourne Again Shell command for turning on core dumps is: To load a core file, select File, Open, Core File. The dialog that pops up lets you browse through core files and select the one that you wish to look at. Notes: In text mode, you can use the following commands:
In text mode, type: |
|
|
Home | Top | Up | Next | Community |
||