Eclipse Concepts

From Texas Instruments Wiki
Jump to: navigation, search

Overview

Starting with Code Composer Studio v4, CCS is based off the Eclipse open source software framework. Hence understanding some of the basic concepts of Eclipse will lead to a better understanding of CCS in general. Some of the more commonly referenced concepts are described below.

Although this article refers to CCSv4 the same concepts apply to later versions as well. The names of some views and menu items may be different in than in CCSv4 but the concepts described here still apply.

Workbench

The Workbench refers to the main CCS IDE GUI and the equivalent of what was referred to as the 'Control Window' in CCSv3. The Workbench contains all the various views and resources used for development and debug. Multiple CCS Workbench windows can be opened ('Window->New Window'). While each Workbench window can differ visually (arrangement of views, toolbars and such), all windows refer to the same workspace and the same running instance of CCS - if a project is opened from one Workbench, that same project will be open in all the Workbench windows. This differs from CCSv3, where only one Control Window can be opened for each debuggable CPU and information is not shared between each Control Window.

Fig. 1: CCSv4 Workbench

Workspace

The workspace is the main working folder for CCS and where it stores project information to manage all the projects that you define to it. This is the case even if the projects themselves do not physically reside inside the workspace folder. CCS Workspaces are not to be confused with CCSv3 workspace files (*.wks), which have more in common with CCS Perspectives than they do with CCS workspaces. The default location of any new projects created in CCS will be within the workspace folder. Once a project has been defined to the workspace, it will be visible in the 'C/C++ Projects' view and can be opened and closed and such. To define an existing CCSv4 (and greater) project to the workspace, it will need to be imported into CCS.

CCS will prompt the user for the workspace folder location when launching CCS. The user can enable the option to use the selected folder as the default folder to avoid being prompted in the future:

Fig. 2: Specifying the Workspace Folder Location

The workspace folder is also used by CCS to store other various information such as user preferences, custom perspectives, cached data for plug-ins, etc. The workspace can get corrupted over time and occasionally may need to be cleaned out.

Multiple workspaces may be maintained (for example, one for each user), however only one can be active within each CCSv instance. The 'File->Switch Workspace...' option can be used to switch between the workspaces. Each workspace would have its own stored user preferences and projects associated with it.

Perspective

A perspective defines the initial set and layout of views in the Workbench window. This is similar in concept to CCSv3 'workspaces' (*.wks) except that multiple perspectives are available from the Workbench window, though only one can remain active at a time. Each perspective provides a set of functionality aimed at accomplishing a specific type of task. For example, the default 'C/C++' perspective displays views most commonly used during code development, such as the 'C/C++ Projects' view, 'Outline' view and the Editor. When a debug session is started, CCS will automatically switch to the 'Debug' perspective, which (by default) displays the 'Debug' view, 'Watch' view and 'Local' view. Also in the 'Debug' perspective, menus and toolbars associated with debugging (such as target connect, load program, reset target, etc) are now available. Users can also manually switch between perspectives. Any changes made to a perspective will be preserved (but can be reset to the default arrangement via 'Window->Reset Perspective'). New perspectives can be created simply by saving the current perspective as a new name ('Window->Save Perspective As...').

The screenshot below shows both the default 'C/C++' and 'Debug' perspectives. Note the red circle indicating which perspective is active in the upper right corner of the Workbench window. Perspectives can easily switched between perspectives by clicking on the perspective icons in the upper right corners. Each time a new perspective is opened, the icon for it will be added to the existing icons:

Fig. 3: Default C/C++ (left) and Debug (right) Perspectives

Note that in CCSv5 and greater, 'C/C++' and 'Debug' perspectives have been replaced by the 'CCS Edit' and 'CCS Debug' perspectives.

Views

Views are windows within the main Workbench window that provide visual representation of some specific information. The Workbench window mainly consists of the editor and a collection of views. Examples of some views are 'C/C++ Projects', 'Debug', 'Outline', 'Memory', 'Disassembly', etc. CCSv3 used the term 'Windows' for such displays (i.e. 'Memory Window', Disassembly Window', 'Watch Window', etc).

Fig. 4: CCSv4 Disassembly View

Most of the views in CCS are available from the main 'View' menu:

Fig. 5: View Menu

Resources

Resources is a collective term for the projects, folders, and files that exist in the Workbench.

Projects

Projects typically contain folders and files. Like the workspace, projects map to directories in the file system. The default location, when creating a new project, is in a subfolder (of the project name) within the workspace folder. However a directory outside the workspace can also be chosen. Once the project is created, a reference to it will be made in the workspace and the project is now available for use within the Workbench and visible from the 'C/C++ Projects' view. Projects are either open or closed. When a project is closed, it is still defined to the workspace, but it cannot be modified by the Workbench. The resources of a closed project will not appear in the Workbench, but the resources still reside on the local file system. Closed projects require less memory and are not scanned during routine activity. Hence closing unnecessary projects can improve performance of CCS. Note that closed projects will still be visible in the 'C/C++ Project' view (with a 'closed' folder icon). This differs from CCSv3, where closed projects do not appear at all in the CCSv3 project view window.

Any projects that have not been defined to the workspace must be imported into CCS. Both CCS/CCE projects and legacy CCSv3 projects can be imported into CCS.

The 'C/C++ Projects' view shows all projects defined in the active workspace. Note that the view is mostly a representation of the filesystem of the project folder. Hence when creating a subfolder and moving files to that subfolder from within the C/C++ Projects' view, the actual filesystem is being altered and vice versa (changes made to the filesystem will be reflected in the C/C++ Projects' view). Note that not all files that appear in the view will exist in the filesystem and vice versa. Linked files will appear in the view but because they are references and not actual copies, the references do not appear in the actual filesystem. The 'Binaries' and 'Includes' folders that appear in the view also are just references. On the other hand, there are some generated files/folders (all of which start with a period [ex: '.settings']) used by CCS for project management that will not appear in the view.

The screenshot below shows the contents of the 'test' project in the 'C/C++ Projects' view and how it maps to the physical 'test' project folder in the workspace in Windows Explorer (showing the contents of the 'Debug' subfolder). Note how the '.launches' and '.settings' folders shown in Windows Explorer are hidden in the 'C/C++ Projects' view and how the 'Binaries' and 'Includes' folders in the view do not exist in Windows Explorer. Otherwise the rest of the folders and files are structured the same in the view and explorer:

Fig. 3: C/C++ Projects View (left) and Windows Explorer (right)

Note that for CCSv5 and greater, the 'C/C++ Projects' view has been replaced by the 'Project Explorer' view.

Files

Files can either be added or linked to a project. When a file is added to a project, the file is copied to the root location of the project directory. This differs from the concept of "adding" a file to a CCSv3 project, where it would not make a local copy, but simply make a reference to where the file is located (you were adding a reference to the file in your project). To achieve the same functionality with CCS projects, there is also the option to 'link' a file to a project. This will simply have the project create a reference to the file instead of copying the file into the project directory.