Software development tools (Chapter 10: Debugger)

First, install GDB

The first step, open the download page, select the Files tab at the top on the download screen.

The second step, under the File tab contains the download list, such as GCC, GDB and other software versions to find the gdb-7.0-mingw32-bin.tar.gz in the list, select the bin file instead pay attention to src files to download.

The third step is to download the tool if the user's machine is installed, it will automatically download dialog box pops up, otherwise Windows will start the download.

The fourth step, open gdb-7.0-mingw32-bin.tar.gz archive, go to the bin folder to find gdb.exe.

The fifth step, extract gdb.exe file to the bin directory under the MinGW installation folder to complete the installation.

Second, the debugging C program

Eclipse CDT debugger allows the user to set breakpoints, pause, step through the code or the like to control the operation of the program process.

Click on the menu bar of the window (Window) menu → Preferences → Run / Debug (Run / Debug), you can set the related attributes can debug view of another set point is under the control of run / debug (Run / Debug) menu tree Taiwan (Console) option.

2, set line breakpoints (focus, memory, application)

Breakpoints can automatically suspended when the program runs to the breakpoint location and displays the current status of the program.

The user may add editors or breakpoints or delete breakpoints view, but the view will break clearly show the status of each breakpoint, the breakpoint will be displayed in an active state blue circle, a non-active state breakpoint is based on transparent white circles show.

Add line breakpoint in the Explorer, open the file needed to debug, move the cursor to the left edge of the area marked on the editor, right-click and choose Toggle Breakpoint to set a line break from the pop-up menu point.

After setting this line on the Eclipse marked areas display a blue circle icon. In the Show View window, open the Debug (Debug) folder, select a breakpoint (Breakpoint) and click the OK button to activate the breakpoint view. Or to move the cursor to the left edge of the marker region editor, double-click to add a breakpoint at the cursor line.

Removing a Line Breakpoint

1) The line break flag area on the left edge of the cursor in the editor, double-click to be deleted to delete the line breakpoint.

2) move the cursor to the mark region on the left edge of the editor, right-click the breakpoint with a row to be deleted, the pop-up menu, select the row to delete Toggle Breakpoint breakpoint.

3) activation breakpoints view, select the line breakpoint you want to delete (multiple choice), click Delete in the toolbar to select a breakpoint (Remove Selected Breakpoints) to delete the line breakpoint.

Activate and disable line breakpoints

1) move the cursor to the mark region on the left edge of the editor, right line breakpoint need to disable the pop-up menu, select the row to disable Disable Breakpoint breakpoint.

2) activation Breakpoints view, select lines need to disable break, the break line in the left box hook removed, to disable the line break. After disabling the breakpoint line is displayed in a white circle in Eclipse.

********************* ********************* method breakpoint

Add / Remove Breakpoint Method

Click on the menu bar of the window (Window) menu, select Other (Other) option at display view (Show View) sub-menu, Show View pop-up window.

Open the General (General) folder, select Outline (Outline) and click the OK button to open the outline view. Right-click the add method, the pop-up menu, select Toggle Breakpoint to add breakpoints method.

Delete method to delete a line breakpoint with a breakpoint similar, equally there are three ways, namely, double-click the right mouse button pop-up menu, delete the breakpoint view.

To activate / deactivate breakpoint method

Move the cursor to the left edge of the marker region editor, right-click to be activated is a method breakpoint, the pop-up menu, select the breakpoint Enable Breakpoint activation method to activate the breakpoint.

Activate breakpoints view, select the required activation method breakpoint, right-click the breakpoint method pop-up menu, select Enable to activate the method breakpoint.

*********************** set event breakpoints (focus, memory, application) **************** *******

The so-called event break is when certain events occur in the course of running the program is halted.

Activate Breakpoints view , click the View menu (View Menu) view toolbar above, in the pop-up menu, select Add event break (Add Event Breakpoint).

Set a breakpoint action (focus, memory, application)

Breakpoints open view, right-click to set a breakpoint breakpoint operation, the pop-up menu, select Properties (Properties).

In the pop-up window in the left attribute selection action (Actions), to customize the operation of the breakpoint in the window.

Debugger (focus, memory, application)

Run→Debug Configurations

Debugging perspective default, including debug Debug perspective view, variable view, breakpoints views, editors, console view and the outline view.

Debug view: Displays the current debugging thread and state that it was

Variable View: display values ​​of variables change throughout the commissioning process procedures to help programmers troubleshooting and correction of the primary means.

 

Guess you like

Origin www.cnblogs.com/jalja/p/11665778.html