CODEBLOCKS IDE

CodeBlocks IDE Overview

The IDE (Integrated Development Environment) in JumpStart C++ is based on the open source CodeBlocks IDE. It is a Windows application program and is the user interface of the toolset.

 

CodeBlocks project has its own website and help file: http://codeblocks.org, and in particular: http://codeblocks.org/docs/main_codeblocks_en.html. This chapter goes through some of the common features useful to ImageCraft’s users. CodeBlocks is very powerful and flexible.

Features of the CodeBlocks IDE

The CodeBlocks IDE has the following features:

     Grouping of source files into projects; where each project has its own project settings.

     Project settings specify the target chip and compiler settings and options.

     Optionally, grouping multiple related projects into a workspace.

     Built-in editors with syntax highlighting, code folding and other advanced editing features.

     Built-in symbol browser; allowing the users to locate declarations, definitions, and other aspects of a symbol.

     Integrated visual debugger and flash program downloader.

     Built-in project build manager automatically determines file dependencies.

     Invoke the C/C++ compiler to “build” the project.

“Views” and Perspectives

The CodeBlocks window contains multiple subwindows, which you can enable or disable individually. You can save a particular set of subwindows’ positions and sizes as a “perspective”. Two predefined perspectives are Default (3 subwindows, as shown below), and Minimal, with just the editor window visible.

 

View->Perspectives… allows you to change perspective view.

 

image

 

 

In the Default perspective, the Management Panel is on the left, the editor window is at upper right, and the Log Windows are at bottom right. All of the panels are multi-tabbed. You can change the default perspective by invoking View->Perspectives->Save Current and then select “Default” as the name.

Visual Components of the IDE

The Title Bar contains the name of the active file being edited, the name of the project, and the compiler license status.

 

The Management Panel contains:

     The Projects tab, where the workspace and projects and their files are shown in a tree-like display, and

     The Symbols tab, where you can browse the symbols of the workspace using different filters.

 

A workspace has one or more projects. At least one project is always active, which is indicated by its name being in bold in the project window.

 

Each project may have one or more targets. The active target is displayed at the top in a dropdown box, as shown above. The workspace and its projects are described in detail later.

 

The Editor is for editing files. Each opened file is a tab in this window. You also use the editor window to set breakpoints and perform source level stepping in the built-in JDB debugger. Editors are described in detail later. The file with the focus is called the active file.

 

The Log Window has the following tabs:

 

     Code::Blocks displays messages from the CodeBlocks program.

     Search results displays lines that match search criteria. When you double click on a result line, the editor opens the file if needed, and brings the focus to that line.

     Build log displays the all the messages from doing a project build. The detail level of the logging is controlled by the Settings->Compiler…->Other settings tab (may need to click on right arrow on the tab selection bar to see). See below.

     Build messages displays compiler messages. If you double click on any displayed warning or error message, the editor opens the file (if needed) and brings the focus to that line.

     Debugger displays messages from the debugger. Level of logging is controlled by Settings->Debugger…->(Full) Debug Log checkbox.

 

Selecting types of logging displayed in the Build Log window

image

 

The Miscellaneous Properties bar at the bottom shows various properties related to the active file. The rightmost box displays the ImageCraft variant of the CodeBlocks build, which is ARMCTX for JumpStart C++ for Cortex:

 

image

 

Toolbar Management

View->Toolbars… lets you add or remove toolbar icons for optional plugins such as Doxy Blocks (see below). You will need to save the view perspective or you will have to be redo the actions again when the IDE is restarted.

 

View->Toolbars... also lets you change the layout of the toolbar icons.

 

image


Debugging, Downloading, and Semihosting

JumpStart C++ for Cortex includes the JumpStart Debugger, an integrated visual debugger (to fully enable all the debugger features, a separate license must be purchased for it). The JumpStart debugger is described here.

 

You can also download a project output image directly from within the IDE through the supported debug pods. Options controlling the debugger and downloader behaviors are specified in the Build Options.

 

A nice bonus feature with the debugger is that with the supported debug pods, you can direct the output of printf calls in your program to an ADT (Advanced Debug Toolbar) windows using a feature called semihosting. This eliminates the need to set up a separate COM port or other output device for diagnostic output for debug purposes