Doug Abbott - Embedded Linux development using Eclipse

Здесь есть возможность читать онлайн «Doug Abbott - Embedded Linux development using Eclipse» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Год выпуска: 2009, ISBN: 2009, Издательство: Elsevier, Жанр: Программирование, ОС и Сети, Программы, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Embedded Linux development using Eclipse: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Embedded Linux development using Eclipse»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

• Details the Eclipse Integrated Development Environment (IDE) essential to streamlining your embedded development process
• Overview of the latest C/C++ Development toolkit
• Includes case studies of eclipse use including Monta Vista, LynuxWorks, and WindRiver

Embedded Linux development using Eclipse — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Embedded Linux development using Eclipse», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать
Memory View

There’s one more debug-oriented view that shows up by default in the bottom-tabbed window of the Debug perspective. The Memory view lets you monitor and modify process memory. Memory is organized as a list of memory monitors , where each monitor represents a section of memory specified by a base address. Each memory monitor can be displayed in one or more of four predefined formats known as memory renderings . The predefined renderings are hexadecimal (default), ASCII, signed integer, and unsigned integer.

Figure 4.11 shows a memory monitor of the area allocated for tempjust after the first fscanf()call in read_file(). The Memory view is split into two panes, one that lists the currently active monitors and another that displays the renderings for the selected monitor. A monitor may have multiple renderings enabled, and these will be tabbed in the renderings pane.

Figure 411 Memory view The first four bytes hold a pointer to another area - фото 63

Figure 4.11: Memory view.

The first four bytes hold a pointer to another area allocated for the name. This also happens to be visible. Remember that the x86 is a “little endian” machine. Consequently, when memory is displayed as shown here, most entries appear to be “backwards.”

Each of the panes has a small, fairly intuitive set of buttons for managing the pane. These allow you to either add or remove monitors or renderings, and in the case of monitors, remove all of them.

4.6.6 Finish Debugging

With this background on the principal debugging features of Eclipse, you should be able to find the two runtime errors that have been inserted in sort_utils.c. Good luck.

4.7 Linking Projects

Eclipse allows projects to refer to, and to depend on, other projects. Consider, for example, that you have a family of similar application projects that all make use of a common library. We can have each of the application projects refer to the library project so that any time a change is made in the library, the applications are rebuilt. The library project becomes a dependency of the applications.

To illustrate this idea, we’ll take the five functions in sort_utils.cand turn them into a static library that we’ll link with record_sort.c. Switch back to the C/C++ perspective, select File→New… C Projectand select Static Libraryas the project type. Call it “sort.” Click Finish. Right-click on the sort project in Project Explorer and select Import→General→File System. Browse to EclipseSamples/sort/. Click Select Alland Finish. Five C files and one header file are imported into the project. Build the project. The result is libsort.a.

Now go back to the record_sort project and select Propertiesfrom the Project Explorer context menu. Select Project Referencesand check sort, which may be the only entry (Figure 4.12). Delete sort_utils.cfrom the file list.

Figure 412 Project References Now expand the CC Generalentry in the - фото 64

Figure 4.12: Project References.

Now expand the C/C++ Generalentry in the left-hand pane and select Paths and symbols. Click the References tab and check sort. This will expand the sort entry and you’ll see that the Active build configuration is selected. Select the Library paths tab and you’ll see that /sort/Debug has been added (assuming that Debug is the active configuration for sort).

Expand the C/C++ Build entryand select Settings. Then select GCC C Linker→Generaland check No shared libraries. We’ll be using static libraries in this example. Now select Libraries (Figure 4.13). The Library search pathlists the path to the sort project.

Figure 413 Library selection Click the Addicon in the Librariessection and - фото 65

Figure 4.13: Library selection.

Click the Addicon in the Librariessection and enter “sort.” [3] I find it a little odd that Eclipse can’t automatically insert the sort library here, since it apparently figured out that sort is a library project. In the context menu for record_sort in the Project Explorer, clean the project. This will rebuild it using the sort library. To prove that record_sort is now dependent on sort, clean the sort project.

This causes it to be rebuilt with a later timestamp on the library than that of the record_sort executable. Now build record_sort. It will be relinked with the new library.

4.8 Refactoring

Refactoring is generally described as a process of restructuring code for the purpose of readability, performance improvements, reuse, or simply for the “regular evolutionary quest for elegance.” [4] http://wiki.eclipse.org/FAQ_How_do_I_support_refactoring_for_my_own_language?www.newnespress.com Most programmers engage in a process of refactoring without consciously realizing it. As a project progresses we often realize that the approach westarted with isn’t quite working and it’s time to do some prudent restructuring and reorganization.

Eclipse supports an automated approach to refactoring that makes sure that changes are propagated properly throughout a project. The nature of refactoring support is somewhat language-dependent. Eclipse offers extensive refactoring support for Java involving operations on classes, interfaces, and methods. For the moment, anyway, C/C++ refactoring is limited to renaming. While this may seem trivial, propagating a name change accurately throughout a large project can be burdensome if done by hand.

We’ll use the record_sort project to illustrate the refactoring support in CDT. Go back to the C/C++ perspective if you’re not already there and open record_sort.cif it isn’t already. In line 23 select read_file. Now from the main menu, select Refactor→Rename…. This brings up the dialog box in Figure 4.14. Let’s change the name read_fileto file_readby changing it in the Rename to:field. The default scope is related projects. This is what we want, because we do in fact have a related project that includes this symbol name. The rename dialog is also accessible from the editor’s context menu.

Figure 414 Renaming dialog With the Rename to field modified the - фото 66

Figure 4.14: Renaming dialog.

With the Rename to: field modified, the Previewbutton is now active. Click it to bring up the dialog in Figure 4.15. This shows all of the places in both projects where read_filecan be changed to file_readand offers the option to selectively change any or all of them. Click OKand read_filewill be magically changed to file_readthroughout both projects.

Figure 415 Rename change dialog Clearly this example is trivial but in a - фото 67

Figure 4.15: Rename change dialog.

Clearly, this example is trivial, but in a large project involving hundreds, perhaps thousands of files, the ability to automatically rename a symbol throughout the project can be quite powerful.

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Embedded Linux development using Eclipse»

Представляем Вашему вниманию похожие книги на «Embedded Linux development using Eclipse» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Embedded Linux development using Eclipse»

Обсуждение, отзывы о книге «Embedded Linux development using Eclipse» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x