| Red Hat Docs > Manuals > GNUPro Toolkit Manuals > |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following documentation serves as a general reference for debugging with GNUPro Toolkit's graphical user interface, Insight. In addition to this information, see Insight's Help menu for discussion of general functionality and use of menus, buttons, or other features; see also Insight, GDB's Alternative Interface and the Examples of Debugging with Insight documentation in GNUPro Debugging Tools (see http://www.redhat.com/docs/manuals/gnupro/).
gdb -nw command for non-windowing command
line work.}
insight |
Insight launches, displaying the Source Window (figure \text\{Source Window the main window interface for Insight, {Source Window, the main window interface for Insight}}).

The menu selections in the Source Window are File, Run, View, Control, Plugin, Preferences, and Help. To work with the other windows for debugging purposes specific to your project, use the View menu or the buttons in the toolbar.

When the debugger runs, the button turns into the Stop button (figure Stop button).

The Stop button interrupts the debugging process for a project, provided that the underlying hardware and protocols support such interruptions. Generally, machines that are connected to boards cannot interrupt programs on those boards. In such cases, a dialog box appears as a prompt asking if you want to abandon the session and if the debugger should detach from the target. For an embedded project, click Run; then click the Continue button (figure Continue button).

For more information on Insight, see its Help menu. For examples of debugging session procedures for using Insight, see the following documentation (the content assumes familiarity with debugging procedures).
To specify how source code appears and to change debugging settings, from the Preferences menu, select Source.
When debugging remotely, you can find the processor name and identification coded of the target board by selecting Plugin => from the Source Window.
CPU Information, information which is obtained from the processor's response to the CPUID instruction (target changes with every target architecture for Insight; environment variables that you set help Insight automatically to determine this functionality). To add identification codes to the debugger's table of processors, see the GDB Internals documentation, distributed with the source code.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To select a source file, or to specify what to display when examining a source file when debugging, use the following processes.
hello.c in figure Source file selection).

main function displays).

@ with a number in the search text box in the top right of
the Source Window. Press Enter. figure @ref{Figure {Searching for a specific,, {Searching for a specific}
line in source code}, shows a
jump to line 8 in the hello.c source file.

| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A breakpoint can be set at any executable line in a source file.
Executable lines are marked by a minus sign in the left margin of the Source Window. When the cursor is over a minus sign for an executable line, the cursor changes to a circle. When the cursor is in this state, a breakpoint can be set. The Breakpoints window is for managing the breakpoints: disabling them, enabling them, or erasing them; an enabled breakpoint is one for which the debugging session will stop, a disabled breakpoint is one which the debugging session ignores.
The following exercise steps you through setting four breakpoints in a function, as well as running the program and viewing changed values in local variables.
For more information about breakpoints, see the standard documentation for Insight: Insight, GDB's Alternative Interface and the Examples of Debugging with Insight documentation in GNUPro Debugging Tools; also see http://www.redhat.com/docs/manuals/gnupro/).
Clicking the line again will remove the breakpoint.



The following excersize illustrates how to view local variables, and use this information while using breakpoints:
b variable in hello.c).

b variable in hello.c).

hello.c in
figure Results of setting breakpoint for line 17, and results in
figure @xref{Figure Executable after changing local variable's values,, Executable after changing local variable's values}).

| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can select threads and set breakpoints on one or more threads when debugging a multi-threaded application with Insight.
A process can have multiple threads running concurrently, each performing a different task, such as waiting for events or something time-consuming that a program does not need to complete before resuming. The thread debugging facility allows you to observe all threads while your program runs. However, whenever the debugging process is active, one thread in particular is always the focus of debugging. This thread is called the current thread. The precise semantics of threads and the use of threads differs depending on operating systems. In general, the threads of a single program are like multiple processes, except that they share one address space (that is, they can all examine and modify the same variables). Additionally, each thread has its own registers and execution stack and, perhaps, private memory.


For more general information about threads, see Debugging with GDB in GNUPro Debugging Tools (see http://www.redhat.com/docs/manuals/gnupro/)
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |