Книга: Embedded Linux development using Eclipse

4.6.3 Breakpoints View

4.6.3 Breakpoints View

To debug the problems in record_sort, you’ll probably want to set one or more breakpoints in the program and watch what happens. Select the Breakpoints view, which is currently empty because we haven’t set any breakpoints.

Let’s set a breakpoint at line 34 in sort_utils.c. That’s the beginning of an if statement in read_file(). Right-click in the marker bar at line 34 and select Toggle Breakpoint. A green circle appears to indicate that an enabled breakpoint is set at this location. The check mark indicates that the breakpoint was successfully installed. By the way, there’s an editor preference to display line numbers in the editor window.

Select Window?Preferences?General?Editors?Text Editors. The line number display can also be toggled from the marker bar context menu.

A new entry appears in the Breakpoints view with the full path to the breakpoint. The check box shows that the breakpoint is enabled. Click on the check box to disable the breakpoint and note that the circle in the marker bar changes to white. Disabled breakpoints are ignored by the debugger. Click the check box again to re-enable it.

Click Resume in the Debug view tool bar and the program proceeds to the breakpoint. The Thread [0] entry in the Debug view indicates that the thread is suspended because it hit a breakpoint. Click Step Over to load temp with the first record. Select the Variables view and click the white arrow next to temp. Now you can see the current values of the fields in temp. Variables whose value has changed since the last time the thread was suspended are highlighted in yellow.

Оглавление книги


Генерация: 1.186. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз