Home
C/C++ Development Toolkit User Guide
Contents
1. Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Project Paths Projects amp Properties for HelloWorld Ioj Info C C Project Paths Builders pere e Projects Libraries Path Containers C C Indexer C C Make Project Oe rest Select All Required projects on the build path C C Project Paths Project References Deselect All Required projects on the build path Selecting a project will include any exported paths and symbols from the selected project Select All Click to select all projects listed in the Required projects on the build path window Deselect All Click to deselect all projects listed in the Required projects on the build path window Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Sta
2. Copyright IBM Corporation and others 2000 2004 C C Project Properties Managed Error Parser You can view a list of the filters that detect error patterns in the build output log on the Error Parsers page of a C C project s preferences window C Properties for HelloWorld ni Info Error Binary Parsers Builders C C Build Set the error parsers for this project C C File Types C C Indexer Error Parsers Binary Parser Error Parsers Error Binary Parsers Project References CDT GNU Make Error Parser Up CDT GNU C C Error Parser CDT GNU Linker Error Parser Down CDT GNU Assembler Error Parser CI CDT visual Error Parser Select All Unselect All Restore Defaults Apply Error Parsers Lists the various error parsers which can be enabled or disabled Up Moves the selected error parser higher in the list Down Moves the selected error parser lower in the list Select All Selects all error parsers Unselect All Clears all error parsers Related concepts Build overview Related tasks Filtering errors Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Err
3. Debugger Options Main Shared Libraries GDB debugger Browse GDB command file Browse Warning Some commands in this file may interfere with the startup operation of the debugger For example run Select a debugger from the Debugger list To be prompted to select a process from a list at run time select Attach to running process To let your program run until you interrupt it manually or until it hits a breakpoint clear the Stop at main on startup check box Specify debug options in the Debugger Options box Click Run or do the following as required o To specify the execution arguments that an application uses and the working directory for a run configuration see Specifying execution arguments o To set the environment variables and the values to use when an application runs see Setting environment variables o To specify the location of source files used when debugging a C or C application see Specifying the location of source files o To specify where the run configuration is stored how you access it and the perspective to open when running an application see Specifying the location of the run configuration Related concepts CDT Projects Project file views Debug overview Debug information Related tasks Creating or editing a run configuration Related reference Run and Debug dialog box Copyright IBM Corporation and othe
4. 7 You should now see the Eclipse org Software User Agreement you must accept the agreement to install the CDT update Do so by selecting accept the terms in the license agreement and then click Next Feature License Some of the Features have license agreements that you need to accept before proceeding with the installation ECLIPSE ORG SOFTWARE USER AGREEMENT 17th June 2002 eclipse C C Development Tools ECLIPSE ORG MAKES AVAILABLE SOFTWARE DOCUMENTATION INFOR OTHER MATERIALS FOR OPEN SOURCE PROJECTS COLLECTIVELY CON USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS C AGREEMENT AND OR THE TERMS AND CONDITIONS OF LICENSE AGREET NOTICES INDICATED OR REFERENCED BELOW BY USING THE CONTENT AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREE 8 Now select the location you would like the updates installed usually this is the directory where you installed Eclipse and click Finish Install Location Choose the location where the Features will be installed fv D Features to install Available sites 5 Jci Program Files eclipse Add Site Remove Site Eclipse Development Tooling SDI pt Eclipse C C Development Tools 2 0 0 Required space OKB Free space 20706772KB 9 You will now start downloading the CDT components You will have to verify that you want the features installed by clicking Install for each feature you selected Jar
5. Colors Content Assist Hovers Navigation Build Console h f m Code Templates Search scope For completion proposals Debug Search current file and included files GDB MI Search current project Source Code Locations Editor Insert single proposals automatically File Types Present proposals in alphabetical order Make Targets New Make Projects Content Assist parsing timeout ms 3000 Search Auto activation H Help Enable as trigger Install Update Enable gt as trigger Java Plug in Development Enable as trigger Runj Debug delay ms 500 Team Background For completion proposals Foreground for completion proposals Iz Restore Defaults Apply Import Export 4 Do the following o To change the scope from which Content Assist retrieves its proposals select either Search current file and included files or Search current project by selecting the appropriate the radio button o To insert an element when you open Content Assist and it is the only item in the list select the Insert single proposals automatically check box o To automatically insert a proposal if it is the only one found when Content Assist is invoked select the Enable auto activation checkbox To display proposals in alphabetical order rather than by relevance select the Present proposals in alphabetical order checkbox To change the a
6. Project References S Exclusion filter None Add Folder Add a source folder Edit Edit a source folder Remove Remove a source folder Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Project Paths Output amp Properties for HelloWorld Ioj C C Project Paths LS Source lt gt Output 1 Projects Librar
7. o To select a debugger to use when debugging an application see Selecting a debugger o To specify the location of source files used when debugging a C or C application see Specifying the location of source files o To specify where the run configuration is stored how you access it and the perspective to open when running an application see Specifying the location of the run configuration Related concepts CDT Projects Project file views Related tasks Creating or editing a run configuration Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Defining debug settings Select a debugger to use when debugging an application To select a debugger oO ON OO 1 In the C C Projects view select a project 2 Click Run Run or Run Debug 3 4 5 In the Configurations box expand C C Local Select a run or debug configuration Click the Debugger tab Create manage and run configurations Configurations Helloworld 26 C C Local 2 Helloworld Java Applet Main 09 Arguments Environment Debugger 8 Source Common 3 Java Application Ju Junit Debugger cygwin GDB Debugger Run program debugger Attach to running process JE Junit Plug in Test Run time Workbench Stop at main on startup V Automatically track the values of variables
8. Collapse All Ens command collapses the tree expansion state of all resources in the view Link with Editor This command toggles whether the Navigator view selection is linked to the active editor When this option is selected changing the active editor will automatically update the Navigator selection to the resource being edited Menu Click the black upside down triangle icon to open a menu of items specific to the Navigator view Select Working Set Opens the Select Working Set dialog to allow selecting a working set for the Navigator view Deselect Working Set Deselects the current working set Edit Active Working Set Opens the Edit Working Set dialog to allow changing the current working set Sort This command sorts the resources in the Navigator view according to the selected schema o By Name Resources are sorted alphabetically according to the full name of the resource e g A TXT then B DOC then C HTML etc o By Type Resources are sorted alphabetically by file type extension e g all DOC files then all HTML files then all TXT files etc Filters This command allows you to select filters to apply to the view so that you can show or hide various resources as needed File types selected in the list will not be shown in the Navigator Link with Editor See the toolbar item description above In addition to these menu items the Navigator view menu shows a list of recently used working sets t
9. Include the makefiles for each source subdirectory include patsubst subdir mk SUBDIRS all MainProject exe MainProject exe O0BJS qtt o 0 0BJS USER OBJS LIBS clean iPM OBJS MainProject exe PHONY all clean deps f Include automatically qenerated dependency list include patsubst amp subdir dep SUEDIRS This makefile is passed as an argument to make so it contains the real build target along with clean and all targets Finally the makefile generator will calculate dependencies for each of the source files in the build and generate these into a dependency fragment for each subdirectory The main makefile includes each of the fragments as well 4 2 Makefile Fragments Obviously the makefile we just looked at is incomplete There are no rules for building actual source files and no source files listed However the makefile generator places that information into makefile fragments for each subdirectory contributing source to the build The figure below shows what the fragment for the source1 subdirectory looks like f Each subdirectory must contribute its source files here C SRCS V addprefix ROOT sourcel CC SRCS addprefix ROOT sourcel CXX SRCS 4 addprefix ROO0T sourcel CAPC SRCS addprefix ROOT sourcel CPP SRCS V addprefix ROOT sourcel Classl cpp f Each subdirectory must supply
10. 7 Folder File Save CTS Save As Other Ctrl N Related tasks Converting CDT 1 x Projects Copyright IBM Corporation and others 2000 2004 Set Discovery Options For most standard make projects you will want to parse the output of the build to populate your paths and symbols tables To do so right click on your project and select Properties gt C C Make Project gt Discovery Options and select the Automate discovery of paths and symbols checkbox amp Properties for HelloWorld Ioj Info C C Make Project Builders C C File Types Set the scanner configuration discovery options For this project CiC Include Paths amp Symbols CIC Indexer ZI C C4 Make Project CHC Project Paths Automated discovery of paths and symbols Project References Automate discovery of paths and symbols Build output parser options v Enable build output parser Make build output parser cuu C C Scanner Info Parser Generate scanner info command options Make Builder Error Parsers Binary Parser Discovery Options v Enable generate scanner info command Use default gcc E P v plugin_state_location specs_file anu C C Compiler Specs Parser Generate scanner info command Command output parser Discovery problem reporting I Report path detection problems Restore Defaults Apply Related reference
11. 2 Build Model Grammar Elements The managed build system defines a grammar to describe tool chain information This information is used to store invariant data like the command line invocation for a specific compiler for example The build system also stores user settings between sessions like the level of debugging information that is needed for a particular build configuration The following section describes the format of the grammar and what the information is used for by the build model 2 1 Model The figure below shows a UML model of schema elements configuration 1 configuration toolReference 0 optionCategory Q optionCategory calegory optionReference 0 optionReference I Fe Options that are a EN enumeratedOption Value single choice from a 0 os enumeratedOption Value Options defined by lists N store their values here listOption Value SS listOption Value 0 list of choices store _ their values here Figure 2 Managed build model elements 2 2 Target In its current implementation the target in the build model is confusing because it encompasses the responsibilities of two distinct participants in a build The first is the host target where the build tools are located The information that this type of target needs to managed are things like the command to start the make utility to remove files
12. Add Bookmark Add Task Shitt Right trl 1 lt shift Left CkrH Shift I P Next Problem Cri Previous Prablem Chri Content Assisk Chril Space Open On Selection Convert Line Delimiters k Encoding k Name Function Keyboard Shortcut Undo Revert the last change in the editor Ctrl Z Redo Revert an undone change Ctrl Y Cut Copies the currently selected text or element to the clipboard and removes the element On elements the remove is not performed before the clipboard is on pasted Copy Copies the currently selected text or elements to the Ctrl C clipboard Paste Paste the current content as text to the editor or as a sibling or child element to the a currently selected Ctrl V element Delete Delete the current text or element selection Delete Select All Select all the editor content Find Find Replace Open the Find Replace dialog Editor only the Find Open the Find Replace dialog Editor only dialog Editor only Next Finds the next occurrence of the currently selected NN text Editor only Find Previous Finds the previous occurrence of the currently Cirle ShifteK selected text Editor only Starts the incremental find mode After invocation enter the search text as instructed in the status bar Ctrl J Editor only Incremental Find Next Starts the incremental find mode After invocation enter the search te
13. Create a new Make target x Target Name 9 Make Target Make Target Build command v Use default Build command make Build Setting on first build error Iv Run all project builders oe Target Name Name of the Make Target Make Target The reference to the make section in your makefile Use default Select this checkbox to use the default make command Clear the check box to specify a new make command Build command If you clear the Use default checkbox type a new make command in this field Stop on first build error Stops the build when an error occurs Run all project builders Runs additional project builders such as discovery Related concepts Build overview Makefile Related tasks Creating a makefile Creating a Make Target Defining build settings Copyright IBM Corporation and others 2000 2004 C C Find Replace Ctrl F or Edit gt Find Replace displays the Find Replace dialog Here you can specify text to search for and optionally text with which to replace it r amp Find Replace Find Replace with m Direction Forward C Backward Scope i all C Selected Lines Options Case Sensitive Wrap Search whole Word Incremental E Regular expressions Replace place Close You can specify e he direction forward or back from the current cursor location e The scope All for t
14. Customizing the C C editor Related reference C C editor preferences Search action Search dialog ie Copyright Red Hat 2003 2004 Copyright IBM Corporation and others 2000 2004 Debug views This section describes debug views Registers view Memory view Memory view preferences Shared libraries view Signals view Debug view Debug preferences amp Copyright IBM Corporation and others 2000 2004 Registers view The Registers view of the Debug perspective lists information about the registers in a selected stack frame Values that have changed are highlighted in the Registers view when your program stops The options described below are available when you right click a register value Change Register Value Specifies a register value Format Displays register values in Natural Decimal or Hexadecimal number systems Show Type Names Displays the type such as int beside each register value Auto Refresh Updates the registers list each time execution stops Refresh Updates the registers list Display as Array Displays a selected register as an array of a specified length and index This option is only applicable to pointers Cast To Type Casts a register value to a different type Restore to Original Type Restores a register value to its original type Related concepts Debug information Related tasks Working with registers Related reference Views Copyright IBM Corporation and
15. Export 1 C5 N Do of the following New Make Projects Specify the settings used as defaults by the New Standard Make Project creation wizard Make builder settings Make Builder Error Parsers Binary Parser Discovery Options inl x Build command Use default Build command make Build Setting Stop on first build error Workbench Build Behavior Workbench build type Make build target Build on resource save Auto Build all Note See Workbench automatic build preference Build Incremental Build all Rebuild Full Build clean all Clean dean Restore Defaults Apply cma o Click Window gt Preferences Expand C C click New Make Projects o Inthe C C Projects view right click a standard make project and select Properties Select C C Make Project from the list Click the Make Builder tab Do one of the following o To stop the build when an error is encountered select Stop on first build error Select one of the following build command settings o To use the default make command select the Use Default check box o To use a build utility other than the default make command Build Command box clear the Use Default check box In the Workbench Build Behavior box do the following o To build your project when resources are saved and change the default make build t
16. Makefile G Method private Method protected Method public Namespace Struct Typedef Union Function EZE M esce cess o LE NN EXCITE em e DAL ANN CELINE i peu DEL NE Ae ce unu _ Se eee ae woe __ LAC NN Related concepts Project file views Outline view Related tasks Displaying C C file components in the C C Projects view Related reference Views amp Copyright IBM Corporation and others 2000 2004 C C Menubar This section describes the menubar options available from the C C perspective File Menu actions Edit Menu actions Navigate Menu actions Search Menu actions Project Menu actions Run Menu actions Window Menu actions Copyright IBM Corporation and others 2000 2004 File Menu actions E C C main cpp Eclipse Platform File Edit Navigate Search Project Run Window Help rela m o a Jae Jo c Close Chrl F4 Close All Cbrl Shifk F4 Save Ctrl 5 2 Save 5j Save All Cria ShifE4 5 Revert Move Rename Fz Refresh F5 liri Switch Workspace Open External File Import Export Properties Alt Enter Exil Name Funtion Keyboard Shortcut New Create new project folder or file a new Create new project folder or file folder or file Alt ShifteN Close Close the current editor If the editor contains unsaved CELTE data a save request di
17. id2 level more lt enumeratedOpt ionValue gt zenurmeratedOptionValue name Optimize most O3 command OoG id level most gt enumeratedOptionValue option lt target gt 2 8 Option Reference An option reference always belongs to a tool reference and is used in two ways First the build model uses option references to hold onto information the user has changed through the UI and to store it between sessions The second is to override the default option settings in a configuration The reference identifies the option it overrides through the d attribute The defaultValue attribute is used to hold onto the user entry but it is used differently depending on the valueType of the option The attribute contains the strings t rue or false for Boolean options String options contain the data entered by the user For enumerated options the attribute contains the selected enumerated list value For list options this attribute is not used Instead listOptionValues are used 2 8 1 Schema he unique identifier of the option that this is a reference to For boolean and string options this field is used to hold the no alue entered by the user For enumerated options it is used to hold the selected enumerated option value For list options this attribute is not used 2 8 2 Example The example below shows how the build model saves overridden option information in the project file In
18. If asked if you would like to switch to the Plug in Development perspective answer Yes 5 3 Creating the Extension You have added the required plug ins to your workspace instance and you have a brand new project with an empty manifest file We are now ready to add our tool chain definition to the managed build system by extending the ManagedBuildInfo extension point 1 2 Double click on the org eclipse cdt example toolchain project in the Package Explorer to expand it Double click on the plugin xml file to edit its contents We have to add a dependency between our project and the org eclipse cdt managedbuilder core plug in where the extension point is defined Click on the Dependencies tab located along the bottom of the manifest editor Click the Add button located beside the Required Plug Ins list Select org eclipse cdt managedbuilder core from the list and then click the Finish button Select the Extensions tab located along the bottom of the manifest editor Click the Add button located beside the All Extensions list Make sure that Generic Wizards is selected in the left hand list and Schema based Extensions from the right and then click the Next button You should now be on the Extension Point Selection page Make sure that the Show only extension points from the required plug ins check box is selected Select org eclipse cdt managedbuilder core ManagedBuildInfo from the list of extension points Use org eclipse
19. In the Description field enter a description for your new code template In the Pattern field enter the code for your template Click Insert Variable to add a variable from the list to the code you have entered in the Pattern box 5 Click OK The new code template is now displayed in the list To edit code template 1 Click Window gt Preferences 2 Expand and click Code Templates 3 Click Edit The New Template dialog box opens Edit Template Ioj xj Mame do Context Ic Function Description da while statement ado i Cursor gt while condition of Pattern Insert Variable 4 Do the following o Inthe Name field change the template name to create a new template based on the current template o Select Structure Global or Function for either C or C from the Context drop down list to select where the template will appear o Inthe Description field change the description of the code template to reflect your changes o Inthe Pattern field edit the code o Click Insert Variable to add a variable from the list to the code you have edited in the Pattern box 5 Click OK Related concepts Content Assist Related tasks Using Content Assist Importing and exporting code templates Related reference Code Templates page Preferences window Code Templates page amp Copyright IBM Corporation and others 2000 2004 Importing and exporting c
20. Ant Build Order Specify the settings used as defaults by the New Standard Make Project creation wizard C C Set the scanner configuration discovery options For this project Build Console Code Templates Debug Make Builder Error Parsers Binary Parser Discovery Options Editor gt Automated discovery of paths and symbols File Types v Automate discovery of paths and symbols Make Targets New Make Projects Build output parser options Search Enable build output parser Help amp Install Update Make build output parser cuu C C Scanner Info Parser Java TER Plug in Development Generate scanner info command options Run Debug Enable generate scanner info command Team Use default Generate scanner info command acc E P v plugin_state_location specs_File Command output parser cuu C C Compiler Specs Parser r Discovery problem reporting Report path detection problems Restore Defaults Apply Import Export Automate discovery of paths and symbols Select this checkbox to scan the build output for paths and symbols Build output parser options This section allows you to select the make build output parser Generate scanner info command options Select to invoke secondary paths and symbols provider such as GNU specs Restore Defaults Returns any changes back to their
21. C C Indexer Standard Make Name Standard Make Referenced Projects Standard Make Make Builder Standard Make Error Parsers Standard Make Binary Parser Standard Make Discovery Options Standard Make C C Indexer Copyright IBM Corporation and others 2000 2004 New Project Wizard Managed Make Select a Target You can enter the build targets and build configurations from this page of the wizard amp New Project X Select a Target Select the platform and configurations vau wish to deploy on D Build Target Executable Cygwin Configurations v T Debug Release Show all Targets Back gt Cancel Function Build Target You can select a build target from the drop down list Configurations Specifies which build configurations will be supported for your project Show All Targets If selected all known targets will appear in the Configurations window by default the list is filtered so that only targets for the host OS are shown Related concepts CDT projects Related tasks CDT Managed Make Tutorial CDT Standard Make Tutorial Related reference New Project Wizard Managed Make Referenced Projects Managed Make Error Parsers Managed Make C C Indexer Standard Make Name Standard Make Referenced Projects Standard Make Make Builder Standard Make Error Parsers Standard Make Binary Parser Standard Mak
22. Error Parsers Standard Make Binary Parser Standard Make Discovery Options Standard Make C C Indexer Copyright IBM Corporation and others 2000 2004 New Project Wizard Standard Make Referenced Projects Select project references from your workspace E New Project X C Make Project Create a Mew C Project using make to build it D Referenced C C Projects 1 Projects Make Builder Error Parsers Binary Parser Discovery Options Indexer Referenced C C Projects gt Finish Cancel Function Select Project References If you have any other projects in your workspace you can select them as references for this new C or C project Related concepts CDT projects Related tasks CDT Managed Make Tutorial CDT Standard Make Tutorial Related reference New Project Wizard Managed Make Select a Target Managed Make Referenced Projects Managed Make Error Parsers Managed Make C C Indexer Standard Make Name Standard Make Make Builder Standard Make Error Parsers Standard Make Binary Parser Standard Make Discovery Options Standard Make C C Indexer Copyright IBM Corporation and others 2000 2004 New Project Wizard Standard Make Make Builder You can enter build configuration settings for your project from this page of the wizard x C Make Project Create a New C Project us
23. Icon a MinimizeConsole MEME 3 3 Minimizes the Console view E Maximize Console Maximizes the Console view Back This command displays the hierarchy that was displayed immediately prior to the current display For example if you Go Into a resource then the Back command in the resulting display returns the view to the same hierarchy from which you activated the Go nto command The hover help for this button tells you where it will take you This command is similar to the Back button in a web browser Forward This command displays the hierarchy that was displayed immediately after the current display For example if you ve just selected the Back command then selecting the Forward command in the resulting display returns the view to the same hierarchy from which you activated the Back command The hover help for this button tells you where it will take you This command is similar to the Forward button in a web browser This command displays the hierarchy of the parent of the current highest level resource The hover help for this button tells you where it will take you Collapse All Tis command collapses the tree expansion state of all resources in the view Link with Editor This command toggles whether the Navigator view selection is linked to the active editor When this option is selected changing the active editor will automatically update the Navigator selection to the resource being edited Menu Click the b
24. Make Targets New Make Projects Restore Defaults Apply Search Import Export 3 Select the Show file members in Project View check box 4 Click OK 5 In the C C Projects view double click a file component The component is highlighted in the C C editor 21 155 Helloworld A Binaries Re hello exe x86le Includes iostream string main int hello exe x86le main o x86le makefile Shapes Test The C C Projects view can also be filtered to show certain types of file components For more information see Hiding files by type in the C C Projects view Related concepts CDT Projects Project file views Related tasks Hiding files by type in the C C Projects view Searching for C C elements Navigate to C C declarations Related reference C C editor code templates and search preferences Copyright IBM Corporation and others 2000 2004 Converting a C or C nature for a project You can assign a C nature to a C file or vice versa To assign a C or C nature to a project 1 Click File gt New gt Other Select a wizard gt Convert bo a CfC Project which uses a simple makefile Wizards be 4 Extension Point Schema on InterFace bo i Java Project be ud Plug in Project Convert to a C C Make Project Managed Make C Project fl Standard Make C Project E E be ene
25. P Last Launched Debug Last Launched This command allows you to quickly repeat the most recent launch in debug mode F11 Run History Presents a sub menu of the recent history of launch configurations launched in run mode Run As Presents a sub menu of registered run launch shortcuts Launch shortcuts provide support for workbench or active editor selection sensitive launching Run This command realizes the launch configuration dialog to manage run mode launch configurations Function Keyboard Shortcut This command allows you to quickly repeat the most Ctrl F1 1 recent launch in run mode Debug History Presents a sub menu of the recent history of launch configurations launched in debug mode Debug As Presents a sub menu of registered debug launch shortcuts Launch shortcuts provide support for workbench or active editor selection sensitive launching Debug This command realizes the launch configuration dialog to manage debug mode launch configurations External Tools Presents a sub menu of links to external run configuration dialogs to manage run mode launch configurations Copyright IBM Corporation and others 2000 2004 Window Menu actions a C C main cpp Eclipse Platform File Edit Wavigate Search Project Pun Window Help ES E d oS ES New Window e lot Open Perspective k Show View i Customize Perspective Save Perspective 4s Reset Perspective Close Persp
26. and to invoke build tools The second is the physical target that the build artifact is supposed to run on which may or may not be the same as the host target This distinction will be clarified in the next iteration of the build model Targets can be arranged into hierarchies to promote the efficient sharing of tools and configurations If you have defined a target that should not be selected by the user but is a root for other targets it may be declared abstract by setting the isAbstract attribute to t rue Abstract targets do not appear in the Ul You must provide a unique identifier for the target in the d attribute The build model uses this information to distinguish between the target definitions it finds Children of the abstract target will have the same tools and configurations the abstract target has For these children to function properly their parent attribute must contain the unique identifier of the parent target A concrete target must have at least one configuration defined for it A target must also define or inherit a set of tool definitions that work together to produce the build goal as an output You must also provide a meaningful name that will be displayed to the user in the Ul and new project wizards The target defines the command needed to invoke the make utility in the makeCommand attribute Any special flags that need to be passed to the make utility are defined in the makeFlags attribute The command to remove fil
27. g g o Test2 o c Test2 cpp g g o Main o c Main pp make Target all not remade because of errors The likely culprit here is that g is not on your Path The Error 255 is produced by make as a result of its command shell not being able to find a command for a particular rule Messages from the standard error stream the lines saying Error 255 and standard output stream all the other lines are merged in the Console view here Q5 What s with the k flag The k flag tells make to continue making other independent rules even when one rule fails This is helpful for build large projects You can remove the k flag by turning on Project Properties gt C C Make Project gt Make Builder gt Stop on first build error Q6 My Console view looks like mingw32 make clean all process begin CreateProcess null rm f Testl o Test2 o Main o test me exe failed make e 2 The system cannot find the file specified mingw32 make clean Error 2 rm f Testl o Test2 o Main o test me exe This means that mingw32 make was unable to find the utility rm Unfortunately MinGW does not come with rm To correct this replace the clean rule in your Makefile with clean del 5 REBUILDABLES echo Clean done The leading minus sign tells make to consider the clean rule to be successful even if the del command returns failure This may be acceptable since the del command will fail if the specified files to be de
28. oA eMeygwinlusrtinclude 909 ereygwinlusrtincludeyw32api Preprocessor Symbols ow fF __unix 1 d unix 1 4 _CYGWIN_ 1 GNUC MINOR 3 Export A GNUG 3 tow RP unix 1 oo i GMUC PATCHLEVEL 1 GNUC 3 4 CYGWIN32 1 Add Add a new path container Edit Edit the currently selected path container Remove Remove the currently selected path container Export Export the currently selected path container to a text file Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Prop
29. to C If for example your requirements change and you must convert an existing C project to you can do this without recreating the project The CDT converts your project files and resolves any source control issues A few notes about projects e When you create a file within a project a record local history of every change is created For more information about local history see Workbench User Guide gt Reference gt User interface information gt Development environment gt Local history e Spaces in projects and filenames can cause problems with some tools such as the make utility or the compiler e careful when you use only case to distinguish files and projects UNIX based operating system file names are case sensitive but Windows filenames are not Therefore Hello c and hello c are separate files in UNIX but overwrite each other in Windows For more information about projects see Workbench User Guide Concepts Workbench Resources Related concepts Project file views How to bring C C source into Eclipse Related tasks Working with C C project files Converting a C or C nature for a project Related reference Project properties Views Copyright IBM Corporation and others 2000 2004 Perspectives available to C C developers A perspective is a layout of views development tools in the Workbench window Each type of perspective is a combination of views menus and toolbars th
30. void square You can view the signature of each item on the list in a pop up by pointing to it You can then select an item in the list to insert it directly into your code Code templates You can create and save code templates for frequently used sections of code which will be inserted according to scope The Content Assist feature also provides quick access to code templates When you enter a letter combination in the C C editor and type CTRL4 SPACE or right click and click Content Assist a list of code elements and code templates that start with the letter combination that you typed is displayed You can then select a code template from the list and it is inserted directly into your code square exi exi print d denorm indeterminate do 1 denorm present while condition DOMAIN default C do double e dynamic cast do while statement For example the code template do while statement contains the following code amp Edit Template E iol x Name do Context Ic Function Description do while statement do cursor while condition v gt Pattern Insert Variable When you select the do code template from the list you insert the following code do while condition If the completion engine finds only one proposal in your templates that proposal is inserted at the current cursor position For example if you cr
31. x ge E mx Ales c go aa 21 425 Shapes Shapes l amp quare h hj C ENTE Shapes square h 43 When you have completed a search and have results in the Search view you can put the focus on that view and get more options on the Search menu A C C search can also be conducted via the context menu of selected resources and elements in the following views C C Projects Make Targets Navigator Outline view Search result view The search context menu is also available in the C C editor The search is only performed if the currently selected text can be resolved to a C C element The type of the selected C C element defines which search context menus are available The C C editor does not constrain the list of available C C searches based on the selection Search view Toolbar Icon Command Description 4 Next Navigates to the next search result 4 Previous Navigates to the previous search result x Femen the Selected Matches pamaos user selected matches from the search console Be All Matches the search console Terminates the current search Shows the list of previously run searches which can be reselected Lists two selectable view layouts for search results Flat and Heirarchical E Console the Console view E Maximize Console the Console view Related concepts Coding aids C C search Related tasks Searching for C C elements
32. Assist This section provides information on code entry aids Using Content Assist Creating and editing code templates Importing and exporting code templates Copyright IBM Corporation and athers 2000 7004 Using Content Assist Use Content Assist to insert C C elements of your project and code templates into your code You can insert a code template into your source code rather than retyping commonly used snippets of code To insert a code template or element 1 In the C C editor type at least the first letter of a code template or element then Ctrl Space A list displays the code templates followed by the elements that start with the letter combination you typed main cpp X O area double getColor string getSize double print void set void setColor string void setSize double void square 2 Do one of the following o Continue typing The list shortens When there is only one item in the list it is automatically inserted o Double click an item in the list to insert it into your code o Press Esc to close the Content Assist Window To set Content Assist preferences 1 Click Window Preferences 2 Expand and click Editor 3 Click the Content Assist tab Workbench Editor Ant Build Order C C Editor Preferences J C C General
33. C New Project Wizard Managed Make Project This section describes properties for creating a Managed make project in the C C New Project Wizard Name Select a Target Referenced Projects Error Parsers C C Indexer Copyright IBM Corporation and others 2000 7004 New Project Wizard Managed Make Name Select a name for the project You can also enter a new path for your project by deselecting the Use Default Location checkbox and entering the new path in the Location text box New Project x Managed Make C Project Create a new Managed Make C Project D Project name Project contents v Use default Directory c Program Files eclipselworkspace Browse lt Back Next Cancel Name Function Specifies the name of the project Use Default Location Default Location When selected the new project will be created in the default workspace location selected the new project will be created in the default When selected the new project will be created in the default workspace location location Ze Detant Location Use Default Location is not selected enter the location where the project is to Location be created Related concepts CDT projects Related tasks CDT Managed Make Tutorial CDT Standard Make Tutorial Related reference New Project Wizard Managed Make Select a Target Managed Make Referenced Projects Managed Make Error Parsers Managed Make
34. Converting CDT 1 x Projects C C Project Properties Standard Discovery Options Copyright IBM Corporation and others 2000 2004 Writing code This sections explains how to work with the C C editor Customizing the C C editor Commenting out code Working with Content Assist Using Content Assist Creating and editing code templates Importing and exporting code templates Shifting lines of code to the right or left Searching for C C elements Selection Searching for C C elements Navigating to C C declarations Refactoring amp Copyright IBM Corporation and others 2000 2004 Customizing the C C editor You can change many of the C C editor preferences To customize the C C editor preferences 1 Click Window gt Preferences 2 Expand and click Editor 3 To set general preferences for the editor click the General tab Igi x 9 Workbench Editor Ant Build Order C C Editor Preferences E C C c General c Colors c Content Assist c Hovers c Navigation Build Console Code Templates Displayed tab width 4 Debug Print margin column GDB MI Source Code Locations Show overview ruler Editor Show line numbers File Types Highlight matching brackets Make Targets New Make Projects Highlight current line Search Show print margin Help Insert space f
35. Copyright IBM Corporation and others 2000 2004 C C New Project Wizard Standard Make Project This section describes properties for creating a Standard make project in the C C New Project Wizard Name Referenced Projects Make Builder Error Parsers Binary Parser Discovery Options C C Indexer Copyright IBM Corporation and others 2000 2004 New Project Wizard Standard Make Name Select a name for the project You can also enter a new path for your project by deselecting the Use Default Location checkbox and entering the new path in the Location text box C New Project X C Make Project Create a New C Project using make to build it gt Mame HelloWorld v Use Default Location Location CiProgram Files eclipse workspace Hello World BFOWSE Back gt Cancel Name Function Name Specifies the name of the project Use Default Location When selected the new project will be created the default workspace location If Use Default Location is not selected enter the location where the project is to Location be created Related concepts CDT projects Related tasks CDT Managed Make Tutorial CDT Standard Make Tutorial Related reference New Project Wizard Managed Make Select a Target Managed Make Referenced Projects Managed Make Error Parsers Managed Make C C Indexer Standard Make Referenced Projects Standard Make Make Builder Standard Make
36. Debug Inthe Configurations box expand C C Local Select a run or debug configuration ROD xj Create manage and run configurations w Configurations Name Helloworld 36 C C Local 6 Helloworld Java Applet Main eo Arguments 9 Environment 3s Debugger Source Common B Java Application Ju JUnit Project Ju JUnit Plug in Test x 8 Run time Workbench HelloWor Browse C C Application hello exe Search Browse New Delete Apply Revert o 5 Select a configuration from the Configurations list 6 Click Run or Debug Related concepts CDT Projects Project file views Related tasks Creating or editing a run configuration Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Creating a run or debug configuration You can create customized run configuration which you can save for reuse To create a run configuration In the C C Projects view select a project Click Run gt Run or Run gt Debug Inthe Configurations box expand C C Local Click New The name of the new project is displayed in the Configurations box The default name is the name of the project Create manage and run configurations Configurations Name Helloworld 51 26 C C Local 6 Helloworld SECTOR E Java Applet Main eo Arguments Environment S Debugger S
37. Main Arguments Ge Environment je Debugger Ki Source Common Display in Favorites menu Debug 5 To save launch to a project in your workspace and to be able to commit it to CVS click Shared 6 In the Folder Selection window select a project and click OK amp Folder Selection x Select a location for the launch configuration ie 89 425 Shapes 85 Test 7 To specify which perspective opens when you run select a perspective from the Run mode list 8 To specify which perspective opens when you run select a perspective from the Debug mode list 9 Click Run or do the following as required o To set the environment variables and values to use when an application runs see Setting environment variables o To select a debugger to use when debugging an application see Defining debug settings o To specify the location of source files used when debugging a C or C application see Specifying the location of source files o To specify where the run configuration is stored how you access it and the perspective to open when running an application see Selecting a run debug configuration Related concepts CDT Projects Project file views Related tasks Creating or editing a run configuration Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Debugging This section explains how to debug yo
38. Make Pied ne 9 Standard Make C Project H E ra zn Tawa Back Finish Cancel Click or C Click Convert to C C Make Project Click Next In the Candidates for conversion list select the projects to convert In the Convert to C or C box click C Project or C Project Click Finish Related concepts CDT Projects Project file views Related tasks Writing code Related reference Project properties amp Copyright IBM Corporation and others 2000 2004 Creating a C C file Files are edited in the C C editor that is by default located in the editor area to the right of the C C Projects view The marker bar on the left margin of the C C editor displays icons for errors warnings bookmarks breakpoints and tasks For more information on the marker bar see Workbench User Guide gt Reference gt User interface information gt Views and editors gt Editor area To create a C file 1 In the C Projects view right click a project and select New gt File F C C Eclipse Platform File Edit Navigate Search Project Run Window Help 5 Q Navigator Projects Em E Project 50 Into Class Open in New Window File Build Make Target Folder Create Make Target Build Project Rebuild Project 7 Other 2 In the list of projects verify that the corre
39. Path Add External Include Path and enter your path 5 Select the container and click Edit to change the order in which your new path or symbol is used Contributed Include Path Selection q Edit container Manage discovered scanner configuration 1 0 Discovered Paths ES Includes eucygwinfusr includejc4 3 3 1 ZB cifcygwinfusrfinclude c 3 3 1 i686 pc cygwin g c fcygwinfusrfinclude c 3 3 1 backward E ciicygwin lib gcc libsi686 pc cyqwin 3 3 1 include ciicygwinjusrfinclude Lg icyquinfusriinclude wG2api Be Preprocessor Symbols GNU M _MINOR_ 3 _ GNUC_PATCHLEVEL_ 1 _ CYGWIN32__ 6 Select the new object and click Up or Down to move it higher or lower in the order or you can disable it by clicking Disable 7 Click Finish to close the Edit Container window 8 Click OK to close the Preferences window Related concepts CDT Projects Project file views Related tasks Working with C C project files Copyright IBM Corporation and others 2000 2004 Selecting a deployment platform For managed make projects you need to select the platform on which you plan to deploy your program You also need to select a release or debug configuration for your project To select a deployment platform T 2 3 4 In the C C Projects view right click a project and select Properties Select C C Build from the list To create a configuration with optimization flags ena
40. Project Rebuild Project Copy A Faste Delete Move Rename Import Export ED Refresh Close Project Team F Compare Wikh d Restore From Local History Hello vwo Related concepts CDT projects Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References amp Copyright IBM Corporation and others 2000 2004 C C Project Properties Managed Make Project This section describes properties
41. Run gt Terminate Run gt Disconnect Run gt Remove All Terminated Launches Run gt Restart Related concepts C C Development perspective Related tasks Debugging Related reference Debug launch controls Debug view Copyright IBM Corporation and others 2000 2004 Stepping into assembler functions Disassembly mode lets you can examine your program as it steps into functions that you do not have source code for such as printf When the instruction pointer enters a function for which it does not have the source the function is displayed in the Assembly editor When disassembly mode is disabled the debugger steps over functions for which you do not have the source To step into assembler functions during debugging e Inthe Debug view right click and select Disassembly Mode As you step Into assembler functions the execution trace is displayed in the Assembly Editor Related concepts C C Development perspective Related tasks Debugging Related reference Debug views Copyright IBM Corporation and others 2000 2004 Working with variables During a debug session you can display variable types and change or disable variable values To display variable type names e In Variables view click the Show Type Names toggle button To change a variable value while debugging During a debug you can change the value of a variable to test how your program handles a particular value or to speed thr
42. ST Unker de Paths H3 General H3 Command Line op lonCat ecory owner example tool name Generai id example comp lt optionCategory gt Verbose Figure 5 Tools and option category display As mentioned in the discussion of the build settings model options know what type of data they manage Different option types require different Ul widgets to properly represent that data to the user The figure below shows what UI elements are created for each type of option The Compiler Flags option contains a string option In this example the option is intended to be the place the user enters all those extra flags that are not defined anywhere else in the property page Options containing strings display their contents in a simple entry widget The Optimization Level option is an enumerated option These types of options force the user to select a single value from a list of possible choices Note that the name of the option is applied to the label in the Ul whereas the name of each individual enumeratedOption Value element is used to populate the list The Include Paths option is a special case of a stringList option The contents of this option are left undefined in this example so the user sees an empty list However all list options are displayed in a list control with an associated button bar for adding removing and reordering list elements Note that the optionType attribute is set to includePath This notifies the build
43. Specify the settings used as defaults by the New Standard Make Project creation wizard CiCr Set required binary parser For this project Build Console Code Templates Debug Make Builder Error Parsers Binary Parser Discovery Options GDB MI Binary Parser Source Code Locations Up arser nea GNU Elf Parser l iT PE Windows Parser L pow Make Targets Cygwin PE Parser New Make Projects Search Help Binary Parser Options Install Update addr2line Command Java Plug in Development addr2line Browse RunjDebug c filt Command Team c filt Browse cygpath Command Browse e Restore Defaults Apply Import Export 3 In the Binary Parser list click o Elf Parser if you are a Solaris UNIX or Linux user o PE Windows Parser if you are a Windows user o Cygwin PE Parser if you are using Cygwin 4 Click OK Related concepts CDT Projects Project file views Related tasks Working with C C project files Related reference Binary Parser C C Properties window Copyright IBM Corporation and others 2000 2004 Adding Include paths and symbols For Standard Make projects you can define include paths and preprocessor symbols for the parser This enables the parser to understand the contents of the C C source code so that you may more effectively use the search and code completion f
44. Types page Preferences window You can define which file extensions are linked to specific languages Se IHE Workbench File Types Ant i Build Order C C File Types El C C E aie asm Assembly Source File Assembly ic C Source File C Remove El Debug C Source File C GDB MI cc C Source File C Source Code Locations cpp C Source File C Editor xx C Source File C h C Header File C H C Header File C Maka Targets hh C Header File C New Make Projects hpp C Header File C Search hxx C Header File C Help lt Assembly Source File Assembly Install Update 5 Assembly Source File Assembly H Java algorithm C Header File C E Plug in Development bitset C Header File C Run Debug deque C Header File C Team exception C Header File C fstream C Header File C functional C Header File C iomanip C Header File C ios C Header File C iosFwd C Header File C iostream Header File C istream C Header File C Restore Defaults Apply Import Export New Add a new File Type definition Remove Remove the currently selected File Type definition Related concepts Coding aids Related tasks Customizing the C C editor Related reference C C editor preferences Copyright IBM Corporation and others 2000 2004 Make Targets page Preferences window You can force the buil
45. You can customize the color of error text messages in the build console Related concepts Build overview Related tasks Defining Build Settings Building Related reference Views Copyright IBM Corporation and others 2000 2004 Code Templates preferences You can manipulate any of the common code templates that are predefined within the CDT To modify delete export import or create your own templates click Window gt Preferences gt C C gt Code Templates xi Workbench Templates Ant Build Order Create edit or remove templates CIC Mew Build Console Re Sa cCGlba author name Code Templates catch C Fu catch block E Debug class C Glo class declaration Remove sad Code Locations comment C Global default multiline comment Editor do C Function do while statement Import File Types else Function else block Make Targets elseif C Function else if block Export New Make Projects ES for C Function For loop Search for C Function for loop with temporary variable Export All Help Ba if C Function if statement Install Update ifelse Function else statement Enable All Java main C Global main method Disable Plug in Development Run Debug Team E Restore Defaults Apply Import Export New Creates a new code template Edit Edits t
46. a description of the signal Related concepts Debug information Related tasks Debugging Related reference Views Copyright IBM Corporation and others 2000 7004 Debug view The Debug view shows the target information in a tree hierarchy shown below with a sample of the possible icons Sessionitem Description Icons Launch instance Launch configuration and launch type dR Debugger instance Debugger name and state Thread instance Threadnumberandstate My Stack frame instance Stack frame number function file name and file line number Eg The number beside the thread label is a reference counter not a thread identification number TID The CDT displays stack frames as child elements It displays the reason for the suspension beside the target such as end of stepping range breakpoint hit and signal received When a program exits the exit code is displayed In addition to controlling the individual stepping of your programs you can also control the debug session You can perform actions such as terminating the session and stopping the program by using the debug launch controls available from Debug view Terminate Ends the selected process Detaches the debugger from the selected process useful for Disconnect debugging attached processes is Clears all the killed processes in Debug view Terminated Term male Ends t
47. both typically Artificial Targets because they don t typically correspond to real files named all or clean The rule for all is used to incrementally build your system It does this by expressing a dependency on the results of that system which in turn have their own rules and dependencies all S LINK TARGET echo All done There is no required order to the list of rules as they appear in the Makefile Make will build its own dependency tree and only execute each rule only once its dependencies rules have been executed successfully Here is a Rule that uses some built in Make Macros in its command 80 expands to the rule s target in this case test me exe expands to the rule s dependencies in this case the three files main o testl o and test2 o S LINK TARGET S OBJS gtt sq co IS e Here is a Pattern Rule often used for compile line It says how to create a file with a o suffix given a file with a cpp suffix The rule s command uses some built in Make Macros for the pattern matched target Slt for the pattern matched dependency amp 6 g o c lt These are Dependency Rules which are rules without any command Dependency Rules indicate that if any file to the right of the colon changes the target to the left of the colon should be considered out of date The commands for making an out of date target
48. cdt example toolchain as the Point ID for the extension and Example Tool Chain for the Point Name Click the Finish button 5 4 Adding a Target Now we will add a new target configuration and an example tool to the extension Right click org eclipse cdt managedbuilder core ManagedBuildInfo to access the context menu Select New target to add a target definition A new target named org eclipse cdt example toolchain target n should appear below the extension point Right click on the new target to access the context menu and select Properties to open the properties editor for the new entry Let s give the new target a better name Locate the name property in the Properties browser and click on the row to edit the value of the property For now let s use the name Example Executable for our target Set the value of the binary parser property based on the platform you will be using to create your example projects on For example if you are running this tutorial on Linux or Solaris enter the value org eclipse cdt core ELF lf you are running the tutorial on Windows enter the value org eclipse cdt core PE Now set the clean command for the target For the purposes of this example click on the cleanCommand property to edit it and enter rm f Do the same for the make command Locate the makeCommand property click on it to edit the value and enter make We want the new target to appear when we run the new project
49. command The hover help for this button tells you where it will take you This command is similar to the Forward button in a web browser 0 Link with Editor This command toggles whether the Navigator view selection is linked to the active editor When this option is selected changing the active editor will automatically update the Navigator selection to the resource being edited Jr Click the black upside down triangle icon to open a menu of items specific to the Navigator view Select Working Set Opens the Select Working Set dialog to allow selecting a working set for the Navigator view Deselect Working Set Deselects the current working set Edit Active Working Set Opens the Edit Working Set dialog to allow changing the current working set Sort This command sorts the resources in the Navigator view according to the selected schema o By Name Resources are sorted alphabetically according to the full name of the resource e g A TXT then B DOC then C HTML etc o By Type Resources are sorted alphabetically by file type extension e g all DOC files then all HTML files then all TXT files etc Filters This command allows you to select filters to apply to the view so that you can show or hide various resources as needed File types selected in the list will not be shown in the Navigator Link with Editor See the toolbar item description above For informatio
50. default Updates the view automatically Show ASCII by default Displays values in ASCII Related concepts Debug information Related tasks Working with memory Related reference Views Copyright IBM Corporation and others 2000 7004 Shared Libraries view The Shared Libraries view of the Debug perspective lets you view information about the shared libraries loaded in the current debug session Load Symbols Loads the symbols of the selected library This option does not affect the libraries with loaded symbols Load Symbols For All Loads the symbols of the libraries used in the current session Auto Refresh Updates the shared library information each time execution stops Refresh Updates the shared library information as required Show Full Paths Displays the full path of libraries Related concepts Debug information Related tasks Debugging Related reference Views Copyright IBM Corporation and athers 2000 7004 Signals view The Signals view of the Debug perspective lets you view the signals defined on the selected debug target and how the debugger handles each one Name Displays the name of the signal Pass Where yes is displayed the debugger lets your program see the signal Your program can handle the signal or else it may terminate if the signal is fatal and not handled Suspend Where yes is displayed the debugger suspends your program when this signal is handled Description Displays
51. erification E Feature verification Warning You are about to install an unsigned Feature 4 Warning This feature has not been digitally signed The provider of this Feature cannot be verified Feature name Eclipse C C Development Tooling SDK Feature Identifier org eclipse cdt sdk_2 0 0 200406190301 Provider Eclipse org File Identifier org eclipse cdt sdk 2 0 0 200406190301 10 You will now have to restart Eclipse select Yes to complete the update amp Install Update x You will need to restart the workbench For the changes to take effect Would you like to restart now L5 Related concepts CDT Overview C C Development perspective Copyright IBM Corporation and others 2000 2004 Concepts Provides background information for CDT components tasks and objectives CDT Overview CDT Projects Perspectives available to C C developers Views in the C C perspective Coding aids Comments Content Assist Templates Editing C C Files C C editor C Makefile Navigation aids Outline View Project File views Make Targets View Open declaration Open Type Class Browser Heirarchy View Build Building C C Projects Manage Build Extensibility Document Debug Breakpoints Debug overview Debug information Error Parsing Invoking Make C C search C C Indexer C C Indexer Problem Reporting C C Indexer Opening or Closing a project C C Indexer Progress Bar Searching Externa
52. exe isAbstract 2 false rakeCommand make binaryParser org eclipse cdt core PE osList win32 id 2 example target executable configuration gt tool gt lt target gt lt fextension gt 2 3 Tool A tool represents some sort of executable component that can take a set of inputs and produce a set of outputs A tool must have a unique id for the build model and a name that is displayed to a user through the UI Certain tools logically belong to certain kinds of projects For example the Gnu compiler is invoked differently for C and C source files You can specify a filter for a tool based on the nature of a project using the natureFilter attribute When a new C project is created a cnature is added to it New C projects have both a cnature and ccnature The build model interprets the filter as follows If you specify a cnature filter then the tool will only be displayed if the project has a cnature and does not have a ccnature If you specify a ccnature filter then the tool will be displayed if the project has a ccnature The default if no filter is specified is to display the tool for all projects Tools can be added to the plug in manifest as part of a target or as a stand alone specification Tools defined as part of a target will be available for projects that are created to build for the target or any child of the target in which the tool is defined If you want targets o use a tool that is not specified as belonging
53. like this ad Cua Tad 4 1 fq Proact Reiemnces COM uniti Platform Example Ex2curable zj Togu Tesi Contiguration M manage Confiiguivion satrings T Compier path crneceererm pem Pn EPR PHU fer NUNUENbewwNENNNNNNNNNUUM LII QU Mags lt i ereseetist eitetttit itid drxxtsxiest ssteeiesten d Figure 9 Property page with tool and category 5 9 Taking the Next Step The purpose of the tutorial you just followed was to become familiar with the steps involved in creating a simple tool chain and to get a feeling for how the choices you make in the specification of options affect the Ul In this section we will discuss some additional points that you need to consider before specifying your own tool chain 5 9 1 Adding More Tools Unless you just happen to have a compiler on your system that is invoked with ccc the example tool we created is not going to build anything Further the tool we defined transforms source files into object files Another tool like a linker would be needed to transform those object files into a final build goal For most targets defining a compiler and something else is usually sufficient but you may have to define additional tools if your tool chain requires intermediate build steps to function properly 5 9 2 Defined Symbols and Header File Search Paths There are elements of the CDT core that require build information t
54. of problems is to generate a makefile for each subdirectory then call make recursively culminating in the final build step which in theory brings all of the build results together The problem with managing this type of approach lies in understanding the dependencies and handling them properly when the makefiles are generated In order for this to happen all the dependencies have to be properly specified and complete As long as there are no dependencies between resources in different subdirectories the makefiles in a recursive approach will contain a properly partitioned set of dependencies However in a more realistic project organization the fragmentary makefiles will have incomplete representations of the dependencies In order to correct for this we would have to do some of the work that make gives us for free The approach the makefile generator takes is to use a single makefile to build the entire project To keep the makefile manageable and readable the makefile generator creates makefile and dependency file fragments for each subdirectory of the project that contributes source code and uses the include capability of make to bring them all together The figure below shows the makefile makefile fragments and dependency fragments that are generated for the project i gt headers amp 5 65 Release md gt sourcel Class x86le subdir dep m source21 5 0 Class21 0 x86le S subdir dep EA su
55. on the target and configuration settings from all specified tool chains to populate the list of choices it presents to the user The figure below shows how the list of targets is populated with any target whose isTest and isAbstract attribute are set to false The value of the target s name attribute is used to populate the drop down list box selection widget Similarly the configuration check list is populated with all the defined configurations associated with the selected target Note that the target selection widget is labelled Platform in the Ul This will change in the next iteration of the build system as we further refine the concept of host target and build target lt target New Project Managed Make Project Create new Managed Make project oss 4 m ide cygwin exec confiquration configurati names Debug id cyawin exec debua lt con f 1 irat L XS Figure 3 New project wizard 3 2 Build Property Page The contents of the build property page for a project are created by examining the tools option categories and options defined for the current configuration and target In this section we will look at how the user interface interprets the information in the build model to display options to the user The configuration information pane of the build property page consists of two boxes The first is populated with a list of all targets that apply to the project The second contains a list of confi
56. option should be displayed as part of that category then the unique identifier of the option category must be specified in the category attribute 2 7 1 Option Types Some options contain commands to turn a feature off or on such as setting a flag to see descriptive messages from a tool Others contain lists of values such as a set of directories to search for files Still others are a single selection from a pre determined range of choices like the level of debugging information to produce or the type of architecture to build for The valueType attribute is used to indicate to the build model what kind of option it is Specifying the type of value an option contains is an important design decision since it controls how the build model treats the contents of the option s attributes and just as importantly how the option is displayed to the user The basic types are string boolean stringList and enumerated There are also four specialized cases of list options includePath definedSymbols libs and userOb js to manage the list of paths to search for header files the defined preprocessor symbols external libraries to link against and object module to link in respectively 2 7 1 1 String Options An option of type string contains a set of values the user has typed in the Ul When the UI is created it will display the option using a simple entry widget This option type is useful for options that cannot be easily specified using lis
57. or Standard Make C project e To create a project for which the CDT supplies a basic makefile select either Managed Make C project or Managed Make C project Setting build preferences You can set build preferences in Eclipse Build order If certain projects must be built before others you can set the build order If your project refers to another project the CDT must build the other project first To set the build order from the menu bar select Window Preferences Build Order When you set the build order the CDT does not rebuild projects that depend on a project you must rebuild all projects to ensure all changes are propagated Automatic save You can set the CDT to perform an automatic save of all modified resources when you perform a manual build from the menu bar select Windows Preferences Workbench By default this feature is enabled Controlling the building of your project The C C compiler that a project uses is controlled by the project s Properties setting To view a project s properties right click on the project and select Properties In the dialog that appears the C C Standard Make Project page enables you to control a variety of settings including Build Setting Controls whether the compiler will Stop On Erroror Keep Going On Error Choosing Keep Going On Error will force the compiler to attempt to build all referenced projects even if the current project has errors Build Command Controls whi
58. preferences The C C editor does not contain a toolbar itself but relies on the use of the main toolbar edit menu search menu and key binding actions amp Copyright IBM Corporation and others 2000 2004 Console view This view shows the output of the execution of your program and enables you to enter input for the program console X Properties Problems 1 r2 E 7FH Shapes Local C Program Files eclipseworkspace Shapes Debug shapes exe 6 13 04 7 22 Enter the length or rhe square 2 Enter Lhe calor Gr Suare creen size Area Color The console shows three different kinds of text each in a different color e Standard output e Standard error e Standard input You can choose the different colors for these kinds of text on the preferences pages Window gt Preferences gt Debug gt Console Console View Context Menu When you right click in the Console view or when you press Shift F10 when the focus is on the Console view you see the following options Edit options Cut Copy Paste Select All These options perform the standard edit operations Which options are available depends on where the focus is in the Console view For example you cannot paste text into the program output but you can paste text to the bottom of the file Find Replace Opens a Find Replace dialog that operates only on the text in the Console view Go to Line Opens a dial
59. the Plug in Development perspective Right click on the Compiler entry in the extension description to bring up the context menu Select New gt optionCategory to add the category Set the name of the category to General You must specify the id of the tool the category belongs to in the owner property The simplest way to do this is to copy the id from the compiler and paste it into the owner property of the category Click on the Compiler entry to open its properties Right click on the id property as though you were going to edit it Instead of typing hit ctrl c Switch back to the option category right click the owner property and hit ctrl v Set the unique id of the category to anything you want for example example toolchain cat comp Right click on the tool not the category to bring up its context menu and select New gt option to add our first option Name the option Include paths and set the valueType property to includePath from the list of choices Please refer to section 2 7 for a description of value types and options In the command property enter In the category property put the unique id of the category that you entered in step Add another option to the compiler Set its name to Other flags Set its valueType to string its category to be the id you created in step 3 and its defaultValue to c At this point you can test how your options appear in the UI by debugging your run time workbench You should see something
60. they contain option references tool references hold onto user settings between sessions They can also be added to a default configuration specification if the default settings for the tool should be overridden For example a Debug configuration may have optimization disabled by default whereas a Release configuration may default to the highest possible level 2 6 1 Schema he unique identifier of the tool this is reference for mg 2 6 2 Example The example below shows how the user has overridden the compiler flags option in the compiler tool in the Default configuration configuration name Default gt toolReference id executable compiler lt optionReference id category flags comp flags gt lt optionReference gt lt toolReference gt ES configuration 2 7 Option Options in the build model are used to organize and maintain the command arguments that are sent to tools during the build Users interact with the build model through the UI to set the value of options Options hold different kinds of values so there are some subtle yet important rules for how options are to be defined These rules are summarized in Table 1 Each option must have a unique d for the build model to properly manage it A descriptive name that will appear in the Ul must be specified Options can be organized into categories to keep the UI more manageable If an option category has been defined for the tool and the
61. this case the tool reference is a linker and the option references are for linker flags and library paths toolReference id linker lt optionReference defaultValue shared fPIC id linker flags gt optionReference id linker paths listOptionValue value home workspace ProjectB optionReference lt toolReference gt 2 9 List Option Value Some options are best described using a list of values This build model element is used to define an individual element of a list option Typically these options are populated by the user not by the person describing the option However if you define one or more values in your extension point they will be displayed in the UI when the user edits the build settings for the project If the user modifies those settings the overridden values will be stored by the build model and displayed in the UI There is an exception to this however Certain core functions in the CDT rely on the built in parser to function correctly In order to return accurate values the CDT parser must mimic as closely as possible the preprocessor that ships with the tool chain used by the target Unfortunately these tools often have a number of built in symbols and include paths that the user is never required to set and may be unaware even exist In those cases the implementer of the tool chain must set those values in the tool definition and flag them by setting the value of the builtin attribute to true
62. to it you must create a reference to the tool in the target specification Please refer to section 2 6 for a description of how to use tool references in your plug in manifest Tools can define a set of input file extensions in the sources attribute This indicates that a tool will build for those and only those file types Similarly a tool might specify a set of file extensions that they will produce in the outputs attributes Each tool specifies a command that will be placed in the makefile during the makefile generation stage of building Two optional flags control how the command is generated If the tool requires a special output flag such as o for a compiler or linker the implementer must specify that in the outputFlag attribute If the output of the tool usually has a special prefix like the prefix 11 for libraries on POSIX systems the implementer must specify this in the outputPrefix attribute One of the clients of the information in the build model is the makefile generator It must track the dependencies between elements in the workspace and to do that it needs to know if a file is a header or a source file Currently the build model uses the list of file extensions specified in the headerExtensions attribute to identify a file as containing an interface 2 3 1 Schema Attribute Description Required A comma separated list of file extensions that the tool will produce output for he extension that the tool will prod
63. up to date may be found elsewhere in this case by the Pattern Rule above Dependency Rules are often used to capture header file dependencies Main o Main h Testl h Test2 h Testl o Testl h Test2 h Test2 0 Test2 h Alternatively to manually capturing dependencies several automated dependency generators exist Here is one possibility commented is dep cpp g M S FLAGS lt gt S include OBJS 0 dep Frequently Asked Questions Your Console view can be very useful for debugging a build Q1 My Console view says Error launching builder What does that mean Error launching builder make k clean all Exec error Launching failed Most probably the build command by default make is not on your path You can put it on your path and restart Eclipse You can also change the build command to something that is on your path If you are using MinGW tools to compile you should replace the build command with mingw32 make Q2 My Console view says rule to make target X make k clean all make No rule to make target clean make No rule to make target all By default the make program looks for a file most commonly called Makefile or makefile If it cannot find such a file in the working directory or if that file is empty or the file does not contain rules for the command line goals clean and all in this case it will normally fail with an
64. various views o working sets a working set for references to particular elements declarations of particular elements definitions of particular elements references of particular elements For information on working sets see Workbench User Guide gt Concepts gt Workbench gt Working sets What you can search for The table below lists the element types that you can search for and special considerations to note when searching for a given element type You can search for some or all of the element types matching a search string that you specify If you choose to search for matching elements all types macros and typdefs are included in the search Searches for classes and structs You can further qualify the search by Class Struct specifying class or struct in front of the name that you are searching for Specifying class or struct also allows you to search for anonymous classes and structures Searches for global functions or functions in a namespace functions that are not members of a class struct or union Function You can specify parameters to further qualify your search When specifying a parameter list everything between the parentheses should be valid C C syntax Do not specify the return type of the function Searches for variables that not members of Variable class struct or union Searches for unions Union Anonymous unions can be searched for by specifying union as the se
65. whether or not it was changed To change the number system displayed You can change the number system used to display register values 1 In the Registers view right click a register and select Format 2 Type a new value 3 Do one of the following o Click Natural o Click Decimal o Click Hexadecimal To modify Registers view preferences 1 Click Window Preferences 2 Expand Debug and click Registers View 3 Make the required changes and click OK Related concepts C C Development perspective Related tasks Debugging Related reference Debug views Copyright IBM Corporation and others 2000 2004 Working with memory You can inspect and change process memory The Memory view supports the same addressing as the C language You can address memory using expressions such as e 0x0847d3c e 5 1024 e ptr You can configure your output to display hexadecimal or decimal You can also set the number of display columns and the memory unit size You can configure each memory tab independently You can customize the Memory view to colors and fonts displayed You can also customize some of its behavior The customizations affect the entire Memory view To change process memory Warning Changing process memory can cause a program to crash 1 In the Debug view select a process Selecting a thread automatically selects the associated process 2 In the Memory view click a memory tab 3 Do one of the
66. you to select the output parser Generate scanner info command options This section allows you to select the scanner info settings Related concepts CDT projects Related tasks CDT Managed Make Tutorial CDT Standard Make Tutorial Related reference New Project Wizard Managed Make Select a Target Managed Make Referenced Projects Managed Make Error Parsers Managed Make C C Indexer Standard Make Name Standard Make Referenced Projects Standard Make Make Builder Standard Make Error Parsers Standard Make Binary Parser Standard Make C C Indexer amp Copyright IBM Corporation and others 2000 2004 New Project Wizard Standard Make C C Indexer You can select which C C Indexers to use for your project from this page of the wizard The indexer is necessary for search and related features like content assist New Project X C Make Project Create a New C Project using make to build it e CfC Indexer setting For this project The CfC indexer is required For search and other rele 1 Projects Make Builder Error Parsers Binary Parser Discovery Options Indexer CIC Indexer Enable C C Indexing CIC Index problem reporting Report preprocessor problems Report semantic problems Report syntactic problems lt Back gt Cancel Function Name Enable C Indexing When selected C Indexing is
67. Assist feature to activate You can disable the predefined triggers with these checkboxes Auto activation delay Specifies the number of milliseconds before Content Assist is activated in Autoactivation mode Background for completion proposals Specifies the background color of the Content Assist dialog box Foreground for completion proposals Specifies the foreground color of the Content Assist dialog box Related concepts Coding aids Related tasks Customizing the C C editor Working with Content Assist Related reference C C editor preferences Copyright IBM Corporation and others 2000 2004 Hover preferences You can customize the appearance of the C C editor hover behavior on the Hovers page of the Preferences window ioj xl Workbench Ant Build Order C C Editor Preferences Er C C c General c Colors Content Assist C Hovers c Navigation Build Console v Enable editor problem annotation Code Templates Debug Editor Text Hover key modifier preferences File Types Make Targets Combined Hover New Make Projects DebugTextHover Search Source Help Documentation Install Update Annotation Description E Java Plug in Development Run Debug Team Pressed key modifier while hovering Ctrl Description Shows the source of the selected element Restore Defaults Apply Import Export En
68. Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Indexer You can select which C C Indexers to use for your project The indexer is necessary for search and related features like content assist amp Properties for HelloWorld nl x Info C C Indexer Builders C C File Types m C C Indexer C C Include Paths amp Symbols Enable C C Indexing C C Indexer Index problem reporting C C Make Project m E b C C Project Paths eport preprocessor problems Project References Report semantic problems Report syntactic problems Restore Defaults Apply Enable C C Indexing When selected C Indexing is enabled for this project Enable C Index problem reporting When selected any index related errors detected will be reported Restore Defaults Returns any changes back to their default setting Apply Applies any changes Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard
69. Built in list option values are never shown to the user and are only passed to clients of the build model that specifically request them 2 9 1 Schema Attribute Description builtln An optional Boolean field that tells the build model to treat he value defined as read only he contents of the list item The build model will apply the no lag defined in the option to each value in the list 2 9 2 Example The example below shows an option Defined Symbols which contains a pre populated list of built in values I386 and i386 respectively option name Defined Symbols valueType definedSymbols gt lt listOptionValue builtIn true value 1386 gt lt listOptionValue gt lt listOptionValue builtIns true value 1386 gt lt listOptionValue gt lt foption gt 2 10 Enumerated Option Value Some options are best described as a single selection from a list of choices For example users typically select the level of optimization they want the compiler to apply when creating a build artifact The enumerate option value is used to define the elements of the list of choices Each element of an enumerated option has a name that will be shown to the user in the UI It also has a command which should correspond to the command line option that gets passed to the tool by the builder if this element is selected A default element can be indicated by setting the value of isDefault to true If
70. C C Development Toolkit User Guide This guide provides instructions for using the C C Development Toolkit CDT in the workbench Getting Started Concepts Tasks Reference Before you begin What s new Copyright IBM Corporation and others 2000 7004 Before you begin You must install and configure the following utilities e Build such as make e Compile such as gcc For more information see http gcc gnu org e Debug such as gdb For more information see http sources redhat com gdb Tip Cygwin contains these utilities for a Windows environment For more information see http www cygwin com To test if cygwin was installed correctly open a command prompt and type g or make The following error message means that no make is installed or your path is not configured correctly g or make is not recognized as an internal or external command operable program or batch file To check your path open a command prompt and type PATH Make sure that the path to your build utility is defined example PATH c cygwin bin Related reference CDT Home Copyright IBM Corporation and athers 2000 7004 What s new in the CDT What s New in 2 0 Enhanced Performance Builds can now be performed in the background Searches can now be performed in the background Automatic Project Settings Discovery Automatically generate project defines and include paths settings from the C C gt New Make Projec
71. CC Assembler 8 General E T GCC C Linker General gj Restore Defaults Apply im Platform Select the platform from the list provided Configurations Select the build configuration from the list provided Manage You can change the make command make flags add and remove configurations and change the name of the build goal Configuration Settings Edit individual options Restore Defaults Returns any changes back to their default setting Apply Applies any changes Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Projec
72. DT GNU C C Error Parser Up CDT GNU Assembler Error Parser CDT GNU Linker Error Parser Down CDT GNU Make Error Parser CDT Visual C Error Parser Select All Unselect All Restore Defaults Apply Error Parsers Lists the various error parsers which can be enabled or disabled Up Moves the selected error parser higher in the list Down Moves the selected error parser lower in the list Select All Selects all error parsers Unselect All Clears all error parsers Related concepts Build overview Related tasks Filtering errors Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Pr
73. I GNU Parser lar XCOFF32 Parser Restore Defaults Apply ced Binary Parser Select a binary parser from the list Binary Parser Options If a binary parser has parser options you can define them in this section Restore Defaults Returns any changes back to their default setting Apply Applies any changes Related concepts Build overview Related tasks Selecting a binary parser Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM C
74. Line Add Expression 3 Select All Declarations or All References 4 Select Workspace or Working Set urn size lt 0 0 or urn color urn pow size t lt lt Square lt lt n tSize lt lt n tdrea All Declarations gt All References gt 5 The search results will appear in the Search View square 1 Declaration in Workspace lt X Ales amp G E 21 488 Shapes Shapes c square h Shapes square h X ER pps P 5 square Shapes square h For more information see e Workbench User Guide gt Concepts gt Views gt Search view e Workbench User Guide gt Tasks gt Navigating and finding resources Related concepts C C search CDT Projects Open Declarations Related tasks Searching for C C elements Navigate to C C declarations Related reference C C search page Search dialog box Copyright IBM Corporation and others 2000 2004 Enable Disable the C C Indexer The C C indexer is on by default You can enable disable indexing on any project from the C C perspective E Properties For HelloWorld Bl x C C Indexer CiC Indexer Enable C C Indexing Builders File Types di CIC Include Paths amp Symbols BEST CIC Make Project CIC Project Paths Project References Enable Index problem reporting Restore Defaults Apply ca The
75. Make Make Builder Standard Make Binary Parser Standard Make Discovery Options Standard Make C C Indexer amp Copyright IBM Corporation and others 2000 2004 New Project Wizard Standard Make Binary Parser You can select the Binary Parsers you require for the project Select the appropriate binary parser to ensure the accuracy of the C C Projects view and the ability to successfully run and debug your programs After you select the correct parser for your development environment and build your project you can view the symbols of the o file in the C C Projects view New Project X L4 T Make Project Create a New C Project using make to build it D Set required binary parser For this project L Projects Make Builder Error Parsers Binary Parser Discovery Options Indexer Binary Parser Up me Elf Parser PE Windows Parser Down Cygwin PE Parser Binary Parser Options lt Back gt Cancel Name Function Binary Parser Select a binary parser from the list Binary Parser Options f a binary parser has parser options you can define them in this section Related concepts CDT projects Related tasks CDT Managed Make Tutorial CDT Standard Make Tutorial Related reference New Project Wizard Managed Make Select a Target Managed Make Referenced Projects Managed Make Error Parsers Managed Make C C Indexe
76. Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Make Project This section describes C C Make Project Properties for a Standard make project Make Builder Error Parser Binary Parser Discovery Options Copyright IBM Corporation and others 2000 7004 C C Project Properties Standard Make Builder You can define build settings on the Make Builder page of a C C project s preferences window amp Properties for HelloWorld P B Info C C Make Project Builders C C File Types Make builder settings C C Include Paths amp Symbols Make Builder Error Parsers Binary Parse
77. Managed Indexer C C Project Properties Standard Indexer amp Copyright IBM Corporation and others 2000 2004 C C Indexer Problem Reporting C C Index Problem reporting places a problem marker on the editor and adds an item to the error list for each preprocessor or semantic problem reported by the parser Note that the markers will only show up the next time the file is indexed t Properties for HelloWorld B x C C Indexer CIC4 Indexer v Enable C C Indexing Enable C C Index problem reporting Builders CIC File Types CIC Include Paths amp Symbols CIC Indexer C C Make Project C C Project Paths i Project References Restore Defaults Apply To enable C C Index Problem reporting 1 Right click on the project and select Properties gt C C Indexer 2 Select the Enable C C Index problem reporting checkbox 3 Click OK Related concepts C C search C C Indexer C C Indexer Problem Reporting C C Indexer Opening or Closing a project C C Indexer Progress Bar Related tasks Selection Searching for C C elements Enable Disable the C C Indexer Indexer Indexer Timeout Setting Source Folders Related reference Search C C Preferences window C C search page Search dialog box C C Project Properties Managed Indexer C C Project Properties Standard Indexer amp Copyrigh
78. New Window Open Perspective 4 Show View Lf Hide Editors E oldProject Lock the Toolbars 2 1 Customize Perspective gt Release Save Perspective As e main cpp MH iostream Reset Perspective ME string Close Perspective 6 main int Close All Perspectives Navigation FE Preferences From the Customize Perspecive Wizard select Convert to a C C Make Project and click OK Note Ensure New is selected in the Submenus list amp Customize Perspective Shortcuts Commands Select the shortcuts that you want to see added as cascade items to the Following submenus The selections made will only affect the current perspective C C Submenus Shortcuts New Shortcut Categories C C 0 cvs Java Plug in Devel Simple L1 EA Managed Make C Project 0 53 standard Make C Project Create a new C class Convert to a C C Project which uses a simple makefile Create a new C project and let Eclipse create and man Create a new C Project which uses a simple makefile The File gt New gt Convert to a C C Make Project option will now be available C C main cpp Eclipse Platform File Edit Navigate Search Run Project Window Help New E d Project Open External File Class Convert to a Make Project Open Workspace Close Ctrl F4 Close All Ctrl shift F4
79. Perspective select the plugin xml file for your plug in in the package explorer Open the File Export wizard On the Select page chose File system from the export destination list Click the Next gt button Make sure that org eclipse cdt example toolchain is selected in the left hand list and that only plugin xml is selected in the right To select an export destination click the Browse button beside the entry widget labelled To directory Browse to the plugins subdirectory of your Eclipse installation Click the Finish button Restart Eclipse switch to the C C Development Perspective and run the new project wizard to create a new project based on your tool chain specification Debug This section describes CDT debug concepts Breakpoints Debug overview Debug information Error Parsing Invoking Make amp Copyright IBM Corporation and others 2000 2004 Breakpoints A breakpoint suspends the execution of a thread at the location where the breakpoint is set To set a breakpoint right click in the frame on the left side of an editor beside the line where you want the breakpoint then choose Add Breakpoint Once set a breakpoint can be enabled and disabled by right clicking on its icon or by right clicking on its description in the Breakpoints view e When a breakpoint is enabled it causes a thread to suspend whenever it is hit Enabled breakpoints are indicated with a blue circle Enabled breakpoints th
80. Projects view Searching for C C elements Related reference Outline view Copyright IBM Corporation and others 2000 2004 Project file views Projects files and elements are displayed in the C C Projects view and in the Navigator view C C Projects view Displays in a tree structure only elements relevant to C and C projects In this view you can do the following Browse the elements of C C source files Build Targets Create new projects classes files or folders Import or Export files and projects Manage existing files cut paste delete move or rename Open files in the editor view Open projects in a new window Refactor Restore deleted files from local history Search Files that you select in the C C Projects view affect the information that is displayed in other views Et Hellowarld Bex Binaries Ei hello exe x amp 6le 8 80 Includes E 8 iostream string maint int hella exe x86le main o x86le makefile Shapes Test Navigator view The Navigator view provides a hierarchical view of all the resources in the workbench not just your C C resources From this view you can open files for editing or select resources for operations such as exporting Right click any resource in the Navigator view to open a pop up menu from which you can perform operations such as copy move create new resources compare resources or perform team op
81. Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Error Parser You can view a list of the filters that detect error patterns in the build output log on the Error Parsers page of a C C project s preferences window amp Properties for HelloWorld iol x Info C C Make Project Builders C C File Types Set the error parsers for this project CiC Include Paths amp Symbc C C Indexer C C Make Project Make Builder Error Parsers Binary Parser Discovery Options C C Project Paths Error Parsers Project References C
82. Repository Exploring Related concepts Views in the C C perspective Debug Concepts Related tasks Adding breakpoints Related reference Console view ie Copyright Red Hat 2003 2004 amp Copyright IBM Corporation and others 2000 2004 Views in the C C perspective The C C views are panels that help you perform the tasks involved in creating C C programs The C C perspective displays these panels in a single Eclipse window Changing Views e You can add views to a perspective From the menu bar choose Window gt Show View gt Other and select a new view from the Show View dialog e To reset the current perspective to its original layout from the menu bar choose Window Reset Perspective The following views are commonly used in the C C perspective C C Projects Displays in a tree structure only elements relevant to C and C projects Console Displays your program s output as well as the output from your build tools Editor The C C editor view provides specialized features for editing C C related files Make Targets Enables you to select the make targets you want to build in your workspace Navigator Shows all of the file system s files under your workspace directory Outline Displays the structure of the file currently open in an editor Problems View If you encounter any errors during a build they will be displayed in the Problems view Properties Shows the attributes of the item currently sele
83. Struct Typedef Union Variable Function Macro Definition You can also sort the list alphabetically When you select an element in the Outline view the C C editor highlights both the selected item and the marker bar left margin For example to move to the start of main in the C C editor click main in the Outline view For more information about the marker bar see Workbench User Guide Reference User interface information Views and editors Editor area Filtering the Outline View You can filter the Outline view by choosing to display or hide the following items e Fields e Static members e Non public members You can select an element in the Outline view and perform the following actions Open the C C Search window box The Search string box is populated and the element type is selected Complete a text based search of a workspace or a specified working set for the selected element Open a selected h file in the editor Rename Refactor Icons Hide Fields W Hide Static Members e Hide Non Public Members 18 For more information about the Eclipse workbench see Workbench User Guide gt Tasks gt Upgrading Eclipse For more information about Working sets see Workbench User Guide gt Concepts gt Working sets Related concepts Comments Content Assist and code completion C C search Open Declarations Related tasks Displaying C C file components in the C C
84. To refactor an object select the object right click and select Refactor gt Rename Class public shapezd private Unde double Revert File string c public Cut Ckrl4 X Const Copy Ctrl C square Paste Ctrl virtual shift Right Meth Shift Left t zaii Comment double Ctrl ize oad ncommen r TET void Content Assist Ckr Space ia string Add Include Cerah olor double Show in CiC Projects powlsize 2 7 roid Otic M Refactor Rename FF Open Declaration F3 nit rea nytColor Search For n n Run Ta Line id Be Resume At Line he Hendit E Add Expression Save The refactoring engine will rename all instances of the object in all referenced files You can Undo refactoring by right clicking a second time and selecting Refactor gt Undo File neue Refactor Tien LITE ESTE C LITE Related concepts Open Declarations CDT Projects C C search Related tasks Searching for C C elements Related reference C C search page Search dialog box Copyright IBM Corporation and others 2000 2004 turn e lor turn turn X size l a cu u Bers color paw size 2 int rea awbrbcolase m n nus ize uS areal lt lt color Building projects This sections explains how to build your project and manage compile errors Renam
85. a separated list containing c C Note that there should not be any spaces between the values Let us assume that the output of the compiler is an object module that has the extension o Set the value of the outputs property of the tool to o Let us assume that the tool should appear for both C and C projects although this is not always the case Locate the natureFilter property and select both from the list of choices The build model needs to know if there are any special file extensions that indicate a file is a header file Set the headersExtension property to be a comma separated list containing h H Tools often have a flag to specify the output of a tool For the purposes of this example set the outputFlag property to o Finally we want to specify the command that is needed to invoke the tool For this example we are not interested in actually calling a real tool so just enter ccc as the value for the command property 5 7 Testing the Target We have now defined enough information to create a project for our new example target so let s go test it out 1 Make sure our example project is selected in the Package Explorer Select Run gt Debug As gt Run time Workbench to start a new run time workbench instance that includes the new tool information you have created You may be prompted to save the resource you were editing If prompted answer Yes In the new workspace open the C C Development Perspective Run the new p
86. able editor problem annotation When selected problems found will be highlighted in the editor Text Hover key modifier preferences You can select hot keys to enable alternate hover behavior such as a mouse over while pressing the lt Ctrl gt key will link to the element s source declaration Related concepts Coding aids Related tasks Customizing the C C editor Related reference C C editor preferences Copyright IBM Corporation and others 2000 2004 Navigation preferences Enable the editor hyperlink navigation and then you can use Ctrl click to jump to the declaration of an item on the C C editor igixi El Workbench Editor H Ant Build Order C C Editor Preferences E C C General Colors Content Assist Hovers Navigation Build Console Code Templates El Debug GDB MI Source Code Locations Editor File Types Make Targets New Make Projects Search Help Install Update Java Plug in Development RunjDebug Team Enable Hyperlink Navigation PEE Fe RI PRI E Restore Defaults Apply Import Export Enable Hyperlink Navigation Select this checkbox to support hyperlink style navigation for Open Declaration Related concepts Coding aids Related tasks Customizing the C C editor Related reference C C editor preferences Copyright IBM Corporation and others 2000 2004 C C File
87. alog is shown Close All Close all editors If editors contains unsaved data a save Ctrl Shift F4 request dialog will be shown Save Save the content of the current editor Disabled if the editor Ctrl S does not contain unsaved changes Save As Save the content of the current editor under a new name Save All Save the content of the current editor Disabled if no editor Ctrl Shift S contains unsaved changes Revert Revert the content of the current editor back to the content of the saved file Disabled if the editor does not contain unsaved changes Move Move resource Rename Renames a resource F2 Refresh Refreshes the content of the selected element with the F5 local file system When launched from no specific selection this command refreshes all projects Print Prints the content of the current editor Enabled when an Ctrl P editor has the focus Switch Einen wonspies Relaunches Eclipse wihanewworkspace oc _ with a new workspace amp Copyright IBM Corporation and others 2000 2004 Edit Menu actions Fr C C C main cpp Eclipse Platform File Edit Navigate Search Project Run Window Help 25 lt undo Ctrl Z 13 0 Redo of Cut jc Copy Ckri c Paste Ctrl Delete Delete Select All Ctrl 4 Find R eplace Ctrl F Find Mest ctrl E Find Previous Ctrl ShiFE K Incremental Find West ctrl J Incremental Find Previous Ctrl Shift J
88. an view a list of the filters that detect error patterns in the build output log on the Error Parsers page of the Preferences window loxi New Make Projects Workbench Ant Build Order Specify the settings used as defaults by the New Standard Make Project creation wizard El C C Set the error parsers for this project Build Console Code Templates Debug Make Builder Error Parsers Binary Parser Discovery Options GDB MI Error Parsers Source Code Locations CDT GNU C C Error Parser Up Editor CDT GNU Assembler Error Parser File Types CDT GNU Linker Error Parser Down Make Targets CDT G U Make Error Parser New Make Projects CDT Visual C Error Parser Select All Search E Help Unselect All Install Update Java H Plug in Development E Run Debug Team Restore Defaults Apply Import Export Error Parsers Lists the various error parsers which can be enabled or disabled Up Moves the selected error parser higher in the list Down Moves the selected error parser lower in the list Select All Selects all error parsers Unselect All Clears all error parsers Related concepts Build overview Related tasks Filtering errors Related reference Project properties Copyright IBM Corporation and others 2000 2004 Binary Parser page C C Preferences window You can view a list of binary parsers on the Binary Parser page of the C C Prefer
89. arch pattern Searches for methods that are members of a class struct or union Method Searching for methods also finds constructors and destructors See above note for functions struct or union Namespace Searches for namespaces How you can limit your search You can limit your search to one or all of the following e Declarations e References e Definitions for functions methods variables and fields You can control the scope of the search by specifying which of the following is to be searched e Workspace e Working Set e Selected Resources Wildcard characters You can use wildcard characters to further refine your search se this wildcard character To search for this Any string Tip Use the character to search for operators that begin with See syntax examples in the table below E JA single character E Nested elements Tip Do not use wild cards between the brackets of a function or method pattern For example the search string f is an invalid search that results in a search for any function f because the asterisk is interpreted as a pointer rather than a wild card Syntax examples The table below provides syntax examples and an explanation for each example to help you conduct an effective search M element Any two letter name hat begins with A and is two levels deep Searches for A not CES nested in anything Any function taking ino parameters Any fun
90. ard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Managed Build Customizes your build configuration compiler and compile options amp Properties for HelloWorld oj x Info C C Build Builders CiC Build Active configuration CIC File Types Platform Executable Gnu on Windows Indexer Error Binary Parsers Configuration Debug Manage Project References Configuration settings E T GCC C Compiler Command g B Preprocessor All options g3 wall c HH Directories Fmessage length 0 Optimization B Debugging HE warnings BH Miscellaneous E G
91. ard Make C C Indexer amp Copyright IBM Corporation and others 2000 2004 New Project Wizard Managed Make C C Indexer You can select which C C Indexers to use for your project from this page of the wizard The indexer is necessary for search and related features like content assist New Project X Additional Project Settings Defined the inter project dependencies if any e CIC Indexer setting For this project The CfC indexer is required For search and othe 12 Projects Error Parsers C C Indexer Indexer Enable C C Indexing ClC Index problem reporting Report preprocessor problems Report semantic problems Report syntactic problems gt Finish Cancel Name Function Enable C Indexing When selected C Indexing is enabled for this project Enable C Index problem reporting When selected any index related errors detected will be reported Related concepts CDT projects Related tasks CDT Managed Make Tutorial CDT Standard Make Tutorial Related reference New Project Wizard Managed Make Select a Target Managed Make Referenced Projects Managed Make Error Parsers Standard Make Name Standard Make Referenced Projects Standard Make Make Builder Standard Make Error Parsers Standard Make Binary Parser Standard Make Discovery Options Standard Make C C Indexer amp
92. arget select the Build on resource save Auto Build check box Enter a new build target in the Make build target box o To change the build default make build target select the Build Incremental Build check box Enter a new build target in the Make build target box o To change the rebuild default make build target select the Rebuild Full Build check box Enter a new build target in the Make build target box 6 Click the Finish Related concepts CDT Projects Project file views Related tasks Working with C C project files Related reference Make Builder page C C Properties window Copyright IBM Corporation and others 2000 2004 Filtering errors The Error Parsers page of the Properties window lists a set of filters that detect error patterns in the build output log If an error or warning is detected an icon appears on the file in the Tasks view If the file is not found the icon appears on the project You can define the properties on a per project basis in the New Project wizard in the C C Projects view or in the Navigator view You can also define project properties in the Preferences window for future standard make projects To select error parsers 1 Do one of the following o To set properties for future Standard Make projects click Window gt Preferences ExpandC C and click New Make Projects o In the C C Projects view right click a standard make project and select Propertie
93. arguments that an application uses and the working directory for a run configuration C C Project Arguments Specifies the arguments that are passed on the command line Use default working directory Clears the check box to specify a local directory or a different project in your workspace Local directory Specifies the path of or browse to a local directory Workspace Specifies the path of or browse to a workspace relative working directory Related concepts Debug overview Debug information Related tasks Running and debugging Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 7004 Environment page Run or Debug dialog box The Environment page of the Run dialog box and the Debug dialog box lets you set environment variables and values to use when an application runs Name Displays the name of environment variables Value Displays the value of environment variables New Creates a new environment variable Edit Modifies the name and value of an environment variable Remove Removes selected environment variables from the list Related concepts Debug overview Debug information Related tasks Running and debugging Related reference Run and Debug dialog box Copyright IBM Corporation and athers 2000 7004 Debugger page Run or Debug dialog box The Debugger page of the Run dialog box and the Debug dialog box lets you select a debugger to use when debugging an applicati
94. at are successfully installed are indicated with a checkmark overlay e When a breakpoint is disabled it will not cause threads to suspend Disabled breakpoints are indicated with a white circle Hinclude lt iostream gt Hinclude lt string gt using Namespace std int maint 1 string yourName cout lt lt Enter your name cin gt gt yourName for iint index 0 index x 5 index i ps cout lt lt Hello vyourMame lt lt endl cout lt lt endl return 0 Debugging breakpoints are displayed in the marker bar in the editor area and in the Breakpoints view Note Execution will also suspend if Stop at main on startup is enabled on the Launch Configuration dialog To access the Launch Configuration dialog from the menu bar choose Run Debug Related reference Run menu Breakpoints view amp Copyright Red Hat 2003 2004 amp Copyright IBM Corporation and others 2000 2004 Debug overview The debugger lets you see what s going on inside a program while it executes In order to debug your application you must use executables compiled for debugging These executables contain additional debug information that lets the debugger make direct associations between the source code and the binaries generated from that original source The CDT debugger uses GDB as the underlying debug engine It translates each user interface action into a sequence of GDB commands and processes the output fro
95. at enable you to perform a particular task For example the C C perspective has views that are organized to help you develop C C programs the Debug perspective has views that enable you to debug those programs Selecting Opening Views e add views to a perspective From the menu bar choose Window gt Show View gt Other and select a new view from the Show View dialog e To reset the current perspective to its original layout from the menu bar choose Window Reset Perspective The C C development tools contribute the following perspectives to the workbench C C perspective views This perspective is tuned for working with C C projects By default it consists of an editor area and the following views C C Projects the file navigator for C C resources Navigator the file navigator for all Eclipse resources Console Properties Tasks Make Targets Outline Search Debug perspective views This perspective is tuned for debugging your C C program By default it includes an editor area and the following views Debug Variables Breakpoints Expressions Registers Memory Display for use with JDT only Outline Console Tasks Other Perspectives In addition to the perspectives named above and the Resource perspective which you see when you first start Eclipse Eclipse also has perspectives that are tuned to other types of development Java Java Browsing Plug in Development CVS
96. ating your Plug in Project 5 3 Creating the Extension 5 4 Adding a Target 5 5 Adding a Configuration 5 6 Adding a Tool 5 7 Testing the Target 5 8 Adding Tool Options 5 9 Taking the Next Step 1 Introduction C and C developers are a diverse group The tools they use the processes they follow and the level of support they expect from their development environments vary widely The CDT provides a framework for integrating those tools into Eclipse and the managed build system is part of that framework Understanding how the managed build system works and what steps are required to extend it is the focus of this document 1 1 Who Needs This Information The information in this document describes the design of the managed build system and discusses how to add new build targets and tools to it through the ManagedBuildInfo extension point It is intended for someone who wants to understand how the managed build system works or is interested in adding their own tool chain specification to it The CDT comes configured to generate makefiles to build executables static libraries and shared libraries on Cygwin Linux and Solaris using Gnu tools If you are using the CDT on those platforms have access to Gnu tools and find the predefined targets sufficient for your needs then you do not need to modify anything Please feel free to skip sections 2 3 and 5 as they are primarily
97. bdir mk Class2 o x86le i o X MainProject exe x86le Shy makefile E subdir dep E subdi mk a sourcel 9 05 source2 i 0 main cpp Figure 8 Generated makefiles In the next sections we will examine the makefiles that are generated in more detail 4 1 Main Makefile There is one main makefile generated for a project Based on information for the target the proper clean command is defined as a macro Note that for efficiency the contents of macros are calculated only when they are defined or modified thus all assignment operators are generated as or with the exception of the list of objects The makefile defines the macros that hold the list of build sources but they are populated in the makefile fragments It also contains a list of subdirectories that contribute source files to the build The makefile generator will generate fragmentary makefiles for each of the directories so the main makefile must include each of these fragments ROOT RM rm rf f Each subdirectory must contribute its source files here C SRCS CC SRCS CXX SRCS CAPC SRCS CPP SRCS LIBS USER OBJS OBJS C SRCS RO0T 5 c 0 CC_SRCS ROOT cc 0 CXX SRCS ROOT 0 Y CAPC SRCS ROOT 0 CPP SRCS ROOT 0 f Every subdirectory with source files must be described here SUBDIPRS sourcez sourceZzl source sourcel
98. bled and debug symbols disabled in the Configurations list select Release To create a configuration with optimization flags disabled and debug symbols enabled in the Configurations list select Debug Related concepts CDT Projects Project file views Related tasks Working with C C project files Related reference Target platform C C Properties window Copyright IBM Corporation and others 2000 2004 Setting build order You can specify the order in which projects are built Referenced projects are built first When you set the build order the CDT does not rebuild projects that depend on a project You must rebuild all projects to ensure changes are propagated For more information on build order see Workbench User Guide gt Reference gt Preference gt Build Order To set the project build order 1 Click Window gt Preferences 2 Select Build Order from the list ar 515 Workbench Build Order Ant Build Order Use default build order CiC Project build order Help Install Update Java Plug in Development Run Debug Team Down w um Project Ie a E Remove Project Note 4 project removed from the list is still built but after those specified in the list Max iterations when building with cycles 10 Restore Defaults Apply Import Expor
99. box Since the default value for this option is defined as false the check box is left unselected when it is created Note that the UI actually builds itself on the fly based on the options descriptions in the plug in manifest The order of the options is the basis of the page layout If the layout is not satisfactory you must edit the plug in file itself You must then restart the workspace after editing the manifest for your changes to take effect in the UI 4 Makefile Generator The third key element of the managed build system is the makefile generator The makefile generator is one of the key clients of the information stored in the build settings model The best way to understand how the makefile generator works is to look at a real project The figure below shows the project that we will be using for the purposes of this discussion The source for the project is spread over the directories source1 source2 and source2 source21 Header files are located in 2 locations headers source2 source21 Es headers py G Class1 h du 8 16 Class2 h 2 o gt source 1 Classt cpp m source gt source21 5 d Class21 h gie Class21 cpp Class2 cpp c main cpp Figure 7 Example project source files While simple this example illustrates some of the problems projects using make typically face when source files are organized hierarchically One approach to these types
100. can also specify which paths to include during a Make and customize preprocessor symbols to ensure proper indexing and search capabilities Notes There are a number of build error parsers the things that turn compiler error messages into objects that we can put into the error lists If one parser cannot figure out what the message means then the system moves to the next one in the list Make target Make targets now support Stop on error build option and ability to change the default build command New Standard Make projects Old Standard Make projects will be automatically updated to support the new options If update is declined then selecting Update Old Make project from the context menu of the project will update the project to a new Standard Make project Debug Formatting of variables and expressions You can now select the number system natural decimal hexadecimal used to display variables and expressions Variable view detail pane In the Variable view a detail pane has been added to let you see the value of a selected variable This is practical when looking at a string char Casting of variables expressions and registers In the Variable view a variable can be cast to a different type or be restored to its original type Also a pointer can be cast to an array type Debug disable variable query The value of variables are queried at every step This can be time consuming on certain embedded targets Th
101. cations IV Use default Editor File Types Build command make Make Targets New Make Projects Build Setting Search Stop on first build error Hel Workbench Build Behavior Install Update i Java Workbench build type Make build target Plug in Development Build on resource save Auto Build all T ig Debug Note See Workbench automatic build preference Team Build Incremental Build all v Rebuild Full Build clean all Clean clean Restore Defaults Apply Import Export Use default Select this checkbox to use the default make command Clear the check box to specify a new make command Build command If you clear the Use default checkbox type a new make command in this field Stop on first build error Stops the build when an error occurs Workbench Build Behavior These settings are what the standard builder will call by default when told to build rebuild clean etc You can change these so that new projects will use different targets if the defaults are not appropriate Build on resource save Auto Build This defines what the standard builder will call when a file is saved it is not recommended to enable Auto Build for C C projects Related concepts Build overview Related tasks Defining build settings Related reference Project properties Copyright IBM Corporation and others 2000 2004 Error Parsers C C Preferences window You c
102. ce files Specifying the location of the run configuration Debugging Debugging a program Working with breakpoints and watchpoints Adding breakpoints Adding watchpoints Removing breakpoints and watchpoints Enabling and disabling breakpoints and watchpoints Controlling debug execution Stepping into assembler functions Working with variables Adding expressions Working with registers Working with memory amp Copyright IBM Corporation and others 2000 2004 Creating or editing a run debug configuration You can run an application by right clicking the file and clicking Open With gt System Editor or you can create a run configure a run environment with which to run your application This section explains how to create a run or debug configuration The Run and Debug dialog boxes each contain the following tabs Main Arguments Environment Debugger Source Common Selecting a run or debug configuration Creating a run or debug configuration Selecting an application to run or debug Specifying execution arguments Setting environment variables Defining debug settings Specifying the location of source files Specifying the location of the run configuration Copyright IBM Corporation and others 2000 7004 Selecting a run or debug configuration You can select an existing run configuration to use to run your program To select a run configuration Inthe C C Projects view select a project Click Run gt Run or Run gt
103. ch make is used Workbench Build Behavior Controls which makefile target will be built depending on the scope of the build Viewing build information Build related information is displayed as follows e The Console view displays the output of the make utility e The Tasks view displays a list of compiler errors and warnings related to your projects e Build actions display in the Make Targets view Related concepts CDT Projects Project file views Related tasks Building Copyright Red Hat 2003 2004 Copyright IBM Corporation and others 2000 2004 Managed Build System Extensibility Document This document describes the design of the managed build system and how to extend it S ae Author Sean Evoy Revision Date 10 21 2003 Version 0 1 0 Change History 0 1 0 Document Creation Table of Contents 1 Introduction 1 1 Who Needs This Information 1 2 Managed Build System Overview 1 3 The Standard Build System 2 Build Model Grammar Elements 2 1 Model 2 2 Target 2 3 Tool 2 4 Option Category 2 5 Configuration 2 6 Tool Reference 2 7 Option 2 8 Option Reference 2 9 List Option Value 2 10 Enumerated Option Value 3 UI Representation 3 1 New Project Wizard 3 2 Build Property Page 4 Makefile Generation 4 1 Main Makefile 4 2 Makefile Fragments 4 3 Dependency Makefile Fragments 4 4 Inter Project Dependencies 5 Tutorial An Example Tool Chain 5 1 Setting up your Environment 5 2 Cre
104. comment Window gt Preferences gt C gt Templates z7 To change the default comment click Window gt Preferences gt C gt Templates For more information see the Content Assist section Related concepts Content Assist and code completion Related tasks Customizing the C editor Commenting out code Related reference C C editor code templates and search preferences ie Copyright Red Hat 2003 2004 Copyright IBM Corporation and others 2000 2004 Content Assist Content Assist is a set of tools built into the CDT that can reduce the number of keystrokes you must type to create your code The Content Assist plug in consists of several components that forecast what a developer will type based on the current context scope and prefix Code completion Content assist provides code completion anywhere in the document For the current project a list is displayed of the elements that begin with the letter combination you entered and the relevance of each proposal is determined in the following order Fields Variables Methods Functions Classes Structs Unions Namespaces Enumerations You trigger the Code completion feature when you call Content Assist such as when you type 1 Space but it is auto activated when you type gt or main cpp X O area double getColor string getSize double print void set void setColor string void setSize double
105. concerned with adding new tool chains to the build model If you are working with tools other than Gnu or you wish to build for targets the CDT does not support out of the box then you have to decide whether you will provide your own makefile and use the standard builder or add a description of your target to the extension point and let the CDT generate the makefiles for your project If you choose to add your own tools to the managed build system it is assumed that you are familiar with XML and the Eclipse extension point mechanism Having made the standard disclaimer it should be said that the tutorial in section 5 presents a cookbook approach to adding a new tool specification so you can always jump right in and refer to the online help in the Platform Plug in Developer Guide if you get stuck 1 2 Managed Build System Overview The managed build system consists of several components that interact to build a project At the core of the managed build system is the build model It is the central clearing house for all the build related information that internal and external clients require There are three internal clients the user interface components a makefile generator that is responsible for generating a correct makefile for a project when it is built and the CDT parser The external clients are the end user who interacts with the build model through the user interface and tool chain integrators who supply tool definitions to the build mod
106. ct B is managed Standard make projects do not know what the output of their build step is since that information is encoded in the makefile If project A references a standard project it will not have an explicit dependency on the output of that project The second element of the inter project dependency is the rule to build the dependent project This is generated as part of the deps target to ensure that the output of B is up to date when A is built The rule to build the referenced project is simply a command to change to the appropriate build directory of the referenced project and call make again Note that MAKE will evaluate to the same invocation that was used to build the main project including the flags that were passed to it 5 Tutorial An Example Tool Chain New managed build system tool chains are specified by extending the ManagedBuildInfo extension point defined in the org eclipse cdt managedbuilder core plug in The easiest way to do this is to create a new plug in project and add your own definitions there 5 1 Setting up your Environment If you are starting with a clean environment you will need to import the plug ins org eclipse cdt core org eclipse cdt make ui and org eclipse cdt managedbuilder ui and any plug ins they require into your run time workbench instance by performing the steps below If you already have the required plug ins in your workbench instance proceed to the section Creating your plug in
107. ct project is selected 3 In the File name box type a name followed by the appropriate extension 4 Click Finish File File Create a new File resource The file will open in the C C editor 5 Enter your code in the editor view Hinclude lt iostream gt Hinclude lt string gt using namespace std int maini i string yourName cout lt lt Enter your name cin gt gt yourName cout lt lt Hello yourName lt lt endl return 0 6 CTRL S to save the file Related concepts CDT Projects Project file views Related tasks Displaying C C file components in the C C Projects view Hiding files by type in the C C Projects view Related reference Project properties Copyright IBM Corporation and others 2000 2004 Creating a makefile If you have created a Standard Make C C Project you need to provide a makefile When you build a project output from make is displayed in the Console view Makefile actions are displayed in the Make Targets view To create a makefile 1 In the C Projects view right click a project and select New gt File F amp C C Eclipse Platform File Edit Wavigate Search Project Run Window Help i lm 5 0 9 0 5 Navigator Projects gt u EE New d Project mo Into Class Open in Mew Window File Build Make Target Folder Create Make Target Build Proj
108. cted in a view or an editor Search Shows the results of searches for files or text Tasks Lists tasks that want to keep track of either as a schedule of things to do or a history of things that have been done Related concepts CDT Overview C C perspectives Related reference Views Copyright Red Hat 2003 2004 amp Copyright IBM Corporation and others 2000 2004 Coding aids This section provides information on code entry aids Comments Content Assist Templates amp Copyright IBM Corporation and others 2000 2004 Comments Comments are lines in a source file that have been marked to be ignored by the compiler Two styles of comments are supported by current C C compilers e text e text Comment You can quickly comment out one or more lines of code by inserting the leading characters at the beginning of the line To do so select the line or lines of code you want to comment out and press CTRL slash Uncomment To uncomment select the line or lines of code and press CTRL backslash Tip The characters on lines that are already commented out are not affected when you comment and uncomment code Multiline comment You can use the Content Assist feature to insert a multi line comment before a function Type com Ctr1 Space and the following code is entered at the cursor location author userid To change this generated comment edit the template variable
109. ction taking parameter that is a pointer to type A function f taking 1 parameter that is an ill search for a function f taking 2 parameters one is a onst char array the other is a reference to ype A f const char Finds only operator operator jFimdsall operator Searches for class anonymous classes Searches for struct anonymous structs Searches for union anonymous unions Search results Search results are displayed in the Search view You can sort your search by Name Parent Name and Path You can also repeat your last search Search Concepts Declarations According to the ANSI C Spec a declaration is a statement that introduces a name into a translation unit or re declares a name that has been previously introduced by a previous declaration All C C search elements can be searched for declarations Definitions Most declarations are also definitions in other words they also define the entity for they declare the name for However there are some elements that can have separate definitions from their declarations For C C search the following elements can be searched for definitions e Functions Methods the definition is where the code implementation resides e Variable 1 Extern the definition is where the variable is initialized 2 Non extern the definition of a variable is where it is declared e Field Static fields the definition of a static field is where it ge
110. ctive Activates the next open perspective in the list of most recently used perspectives e Previous Perspective Activates the previous open perspective in the list of most recently used perspectives This command allows you to indicate your preferences for using the Workbench There are a wide variety of preferences for configuring the appearance of the Workbench and its views and for customizing the behavior of all tools that are installed in the Workbench See the C C Page Preference Window section for more details on the CDT preferences Preferences amp Copyright IBM Corporation and others 2000 2004 C C Toolbar Eclipse Platform File Edit Wavigate Search Project Run Window Help IS HeEelIFSOR H F R lowe 50 A C C Toolbar icons Command Description a New Create a new project folder or file Save Save the content of the current editor Disabled if the editor does not contain unsaved changes pus the content of the current editor C Class Creates a C class within the current project ee Folder a folder within the current project ES orare File a file within the current project E Debug Launches the Debug dialog box b Pun Launches the Run dialog box Be External Tools Launches the External Tools dialog box m Open Type Brings up the Open Type selection dialog to open a type in the editor The Open Ty
111. cutable A refresh occurs when execution stops Expressions An expression is a snippet of code that can be evaluated to produce a result The context for an expression depends on the particular debug model Some expressions may need to be evaluated at a specific location in the program so that the variables can be referenced You can view information about expressions in the Expressions view Registers You can view information about the registers in a selected stack frame Values that have changed are highlighted in the Registers view when your program stops Memory You can inspect and change your process memory Shared libraries You can view information about the shared libraries loaded in the current debug session Signals You can view the signals defined on the selected debug target and how the debugger handles each one Related concepts Overview of the CDT Debug overview Related tasks Debugging Related reference Run and Debug dialog box Debug views Copyright IBM Corporation and others 2000 2004 C C search You can conduct a fully or partially qualified name search Further qualifying a search increases the accuracy and relevance of search results The sections below provide guidance on how to control the scope of your search through the use of search delimiters correct syntax and wildcards You can search for e language constructs within o projects in your workspace o selected resources from
112. d stringList No 2 7 4 Schema BO A unique identifier for the tool that will be used by the build yes Pme name for the tool to be used in the UI yes alueType ype of value the option contains yes ategory his is the id of the option category for this option The id an be the id of the tool which is also a category Optionally specifies the value for the option if the user has not edited it For options containing a Boolean value the string true is treated as 1 any other value as 0 ommand An optional value that specifies the actual command that no ill be passed to the tool on the command line 2 7 5 Example The example below shows the specification for the optimization level option for a compiler Note that it is an enumerated type so the only attributes defined for the option itself are its id for the build model a human readable name the id of the category it belongs to and the type of value the option holds target name Executable gt lt option name Optimization Level valueType enumerated category compiler cat optimization id optimization level zenumeratedOptionValue name None O0 command o0 id level none enumeratedOptionValue zenumeratedOptionValue name Optimize O1 command oO1 id level optimize gt lt fenumeratedOpt ionValue gt enurmeratedOptionValue name Optimize more O2 isDefaults true command oOg
113. d others 2000 2004 Build Console preferences You can customize the appearance of the Build Console view Anl x H workbench Build Console 9 Ant Build Order v Always clear console before building Open console when building v Bring console to top when building iF present Limit console ouput lines 500 Display tab width 4 i Source Code Locations ar Editor Console text color settings gt File Types Output text color i Make Targets z New Make Projects Information message text color i Search Help Error message text color Install Lipdate Java Plug in Development Run Debug Restore Defaults Apply Import Export Cancel Always clear console before building Select this checkbox to clear the console whenever you perform a build Open console when building Select this checkbox to open the console build when you perform a build Bring console to top when building if present Select this checkbox to bring the build console to the front when you perform a build Limit console output lines You specify the maximum number of lines that appear in the build console view Display tab width You can specify the number of spaces for a tab Output text color You can customize the color of text in the build console Information message text color You can customize the color of information text messages in the build console Error message text color
114. date Site button Update sites to visit Select update sites to visit while looking For new Features 8 0 9 Eclipse org update site REMOVE New Update Site 7 http fupdate eclipse org tools cdt updates builds 2 0 __ _ _ c 5 Select the update site you just created by clicking the appropriate checkbox and click Next Update sites to visit Select update sites to visit while looking For new Features YY CDT 2 0 REMOVE 6 A dialog box will appear showing the updates available from the update site select each of the following features ensuring you have precisely the same version for each one o Eclipse C C Development Tooling SDK o Eclipse C C Development Tools Then click Next amp Install E Search Results Select features to install from the search result list fw Select the Features to install version Provider 4 seen L1 e Eclipse C C Development Tools 2 0 0 200406150300 Eclipse org Deselect All L1 4p Eclipse Development Tools 2 0 0 200406160301 Eclipse org a Eclipse C C Development Tools 2 0 0 200406170301 Eclipse org More Info i Eclipse Development Tools 2 0 0 200406180301 Eclipse org Se Eclipse C C Development Tools 2 0 0 200406190301 Eclipse org zi Praperties Error beta 2 of 62 selected Filter features included in other features on the list lt Back Finish
115. default setting Apply Applies any changes Copyright IBM Corporation and others 2000 2004 Search C C Preferences window You can configure various options for the search configuration on the Search page of the C C Properties window iol x E Workbench E Ant External Search Links Ee Build Console v Enable external search markers Code Templates Enable Marker Link Type Br Debug Invisible Editor i File Types Make Targets Indexer Timeout New Make Projects Timeout ms 20000 Help Install Update Java Plug in Development Run Debug Team Restore Defaults Apply Import Export Cancel Enable external search markers Select this checkbox to enable searches in external files Enable Marker Link Type Select visible or invisible markers Indexer Timeout Enter the timeout delay in milliseconds in the field provided Related concepts Coding aids C C search Related tasks Searching for C C elements Customizing the C C editor Related reference C C search page Search window Search action Search view Project Properties This section describes C C Project Properties To select project properties right click a project and select Properties Projects is Navigator a US 50 Into Open in Mew Window Build Make Target Create Make Target Build
116. der to the existing project Show Inherited Paths Select this to show all paths including those that were inherited Add Preprocessor Symbol Add a new preprocessor symbol Add External Include Paths Add a new include path Add Include Path from Workspace Add an include path from another project in the workspace Add Contributed Add a contributed path or symbol Edit Edit the currently selected path or symbol Remove Remove the currently selected path or symbol Export Export the currently selected path or symbol to a text file Down Move the currently selected path or symbol down in the list Up Move the currently selected path or symbol up in the list Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed
117. ding of make targets in the background 0 x E Workbench Make Targets E Ant Build Order v Build Make target in the background ECCE Build Console Code Templates E Debug iy New Make Pede i Search Help Install Update Java Plug in Development Run Debug Team Restore Defaults Apply Import Export Cancel Build Make target in the background Select this checkbox to perform builds in the background Related concepts Build overview Related tasks Defining Build Settings Building Related reference Views Copyright IBM Corporation and others 2000 2004 New Make Projects properties In this section learn about the C C New Make Projects properties pages Make Builder preferences Error Parser preferences Binary Parser preferences Discovery Options preferences Copyright IBM Corporation and others 2000 7004 Make Builder page C C Preferences window You can define build settings on the Make Builder page of the C C Preferences window Workbench New Make Projects Ant Build Order Specify the settings used as defaults by the New Standard Make Project creation wizard at cce Make builder settings Build Console Code Templates Debug i Error Parsers Binary Parser Discovery Options GDB MI m Build command Source Code Lo
118. dit Shift Left Related concepts Code entry Related tasks Customizing the C C editor Related reference C C editor code templates and search preferences Copyright IBM Corporation and others 2000 2004 Navigating to C C declaration The Open Declaration feature lets you navigate to the declaration that matches a selected element in the C C editor It is recommended that you look for element declarations on successfully compiled programs To navigate to C C declaration 1 In the C C editor select an object 2 Right click the selected element select Open Declaration Square exl exi pr Lindo Ctrl z Revert File Cut Crit Copy Paste Chrl Shift Right Shift Left Comment Uncomment Chri Content Assisk Chri Space dd Include Gh Shitt h Show in Projects Refactor d Open Declaration Search For Run Line Be Resume At Line E Add Expression Saws For more information see e Workbench User Guide Tasks Navigating and finding resources Related concepts Open Declarations CDT Projects C C search Related tasks Searching for C C elements Related reference C C search page Search dialog box amp Copyright IBM Corporation and others 2000 2004 Refactoring Use the C C Projects Outline or the Editor view Refactor gt Rename context menu to refactor class amp type names methods function amp member names
119. does not touch on is the concept of abstract targets discussed in section 2 2 1 It would be quite time consuming not to mention error prone if you had to redefine common tools or properties each time you wanted to create a new target Instead the build model allows you to organize targets into hierarchies that promote the sharing of common property settings and tools between related targets When you create a parent target though you may not want that target to be selected by the user in the new project wizard In that case make the target abstract and it will no longer appear as an option for users Flagging a target as abstract is a Ul design decision you can declare a non abstract target as the parent of another target You just have to be sure that you want the user to be able to create a new project based on the parent as well as the child 5 9 6 Publishing your Plug in The subject of packaging Eclipse plug ins is well covered in the Platform Plug in Developer Guide It is strongly recommended that you review this information carefully if you plan on deploying products based on Eclipse However making your tool chain specification available to other users of Eclipse is not difficult You must supply the plugin manifest we created inside the Eclipse platform s plug in directory The plug in directory is named plugins and is typically located underneath the main directory where you installed the Eclipse platform 1 From the Plug in Development
120. e Propert Value derived editable last modified 5125 04 11 46 AM linked False location Ci Pragram Fileseclipse workspace HellowWorld main cpp name main cpp path Hello viorld main cpp size 211 Toolbar buttons allow you to toggle to display properties by category or to filter advanced properties Another toolbar button allows you to restore the selected property to its default value To see more detailed information about a resource than the Properties view gives you right click the resource name in the Navigator view and select Properties from the pop up menu Toolbar Icon Name Description Show Categories This command when selected lists the properties in sorted categories Show Advanced Properties This command when selected shows advanced properties By default advanced properties are filtered ES Restore Default This command returns any modified properties to their default Click the black upside down triangle icon to open a menu of items specific to the Properties view Menu Show Categories See the toolbar item description above Show Advanced Properties See the toolbar item description above c MinimizeConsole Minimizes the Console view Fl Maximize Console Maximizes the Console view amp Copyright IBM Corporation and others 2000 2004 Search view Any matches are reported in the Search view square 1 Declaration in JL 4
121. e Build Automatically This performs a Build All whenever any project file is saved such as your makefile Tip For C C projects this feature should be turned off if there is a checkmark beside Build Automatically it is on to turn it off select Build Automatically Tip If you get the error message Exec error Launching failed The error message means that the CDT cannot locate the build command usually make Either your path is not configured correctly or you do not have make installed on your system Tip The menubar item Project gt Build Working Set submenu for C C projects simply creates a link to the build all target as defined in your makefile and is no different from an Incremental Build Related concepts Build overview Related tasks Defining Build Settings Building Related reference Make Builder page C C Properties window Copyright IBM Corporation and others 2000 2004 Removing Build Automatically The Eclipse workbench is configured to build projects automatically However for C C development you should turn this feature off otherwise your entire project will be rebuilt whenever for example you save a change to your makefile or source files Click Project gt Build Automatically and ensure there is no checkmark beside the Build Automatically menu item a E main cpp Eclipse Platform File Edit Mavigate Search Project Run Window Help E3 H m C pen Project e e os Cl
122. e Discovery Options Standard Make C C Indexer amp Copyright IBM Corporation and others 2000 2004 New Project Wizard Managed Make Error Parsers You can select which error parsers to use and in which order they are used for your project C New Project Additional Project Settings Defined the inter project dependencies iF any D Set the error parsers for this project 1 Projects Error Parsers cic Indexer Error Parsers CDT GNU Make Error Parser E CDT GNU Cic Error Parser CDT GNU Linker Error Parser COT GNU Assembler Error Parser visual Error Parser Select All Unselect All gt Finish Cancel Name Function Error Parsers You can select which Error Parsers to enable from this window Up Moves the currently selected Error Parser higher in the ordered list Down Moves the currently selected Error Parser lower in the ordered list Select All Selects all Error Parsers Unselect Unselects all Error Parsers Related concepts CDT projects Related tasks CDT Managed Make Tutorial CDT Standard Make Tutorial Related reference New Project Wizard Managed Make Select a Target Managed Make Referenced Projects Managed Make C C Indexer Standard Make Name Standard Make Referenced Projects Standard Make Make Builder Standard Make Error Parsers Standard Make Binary Parser Standard Make Discovery Options Stand
123. e Locations Editor Insert single proposals automatically Present proposals in alphabetical order Make Targets New Make Projects Content Assist parsing timeout ms 3000 Search Auto activation Help Enable as trigger Install Lipdate uam Enable gt as trigger Plug in Development Enable as trigger Run Debug delay ms 500 Team Background For completion proposals Foreground For completion proposals a Restore Defaults Apply Import Export Search scope for completion proposals You can configure the Content Assist feature to select proposals from items contained only in the current file and included files or from the current project Insert single proposals automatically Inserts an element into your code when the Content Assist feature finds only one proposal Present proposals in alphabetical order Proposals by default appear in order of relevance determined by context scope and prefix Alternatively you can configure the Content Assist feature to order its proposals alphabetically Content Assist parsing timeout ms For very large projects the Content Assist feature might slow the response of the plug in as the Content Assist feature parses the project for proposals This setting stops the Content Assist parse when it reaches the specified threshold Auto activation Certain predefined triggers force the Content
124. e Perspective dialog box expand Other the Available Items list 3 Select the C C Debug check box Click OK 2 In the Add C C Watchpoint dialog box type an expression in the Expression to watch box The expression may be anything that can be evaluated inside an if statement 3 Do any of the following o To stop execution when the watch expression is read select the Read check box o To stop execution when the watch expression is written to select the Write check box In the C C editor open the file that you added the watchpoint to Click OK The watchpoint appears in the Breakpoints view list oof Related concepts C C Development perspective Related tasks Working with breakpoints and watchpoints Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Removing breakpoints and watchpoints When you remove a breakpoint or watchpoint the corresponding icon is removed from the marker bar where it was inserted and the Breakpoints view To remove breakpoints or watchpoints 1 In the Breakpoints view do one of the following o Select the breakpoints and watchpoints you want to remove o Click Edit gt Select All o Right click click Select All 2 In the Breakpoints view right click and select Remove or Remove All For more information on marker bar icons see Workbench User Guide gt Reference gt User interface information gt Icons and buttons gt Edit
125. e automatic query of variables can be disabled Manual queries are now an option Source location A new source locator in the Run Debug dialog box makes it possible to add directories to search mapping and the order of the search GDB MI new shared library launch pane For GDB MI code two new actions are added in the launch view stop on solib and auto load symbols Stop on solib will force the debugger to stop on any shared library events Auto load will load the symbols for any shared library GDB MI improvements in display of arrays Arrays are now separated into ranges to limit the possibility of a timeout on large arrays What s new for previous releases You can keep track of previous release specific developments in the CDT For more information see http www eclipse org cdt gt CDT Project Management Plans The Official CDT Plans section lists previous releases Copyright IBM Corporation and others 2000 2004 Getting Started How to bring C C source into Eclipse Updating the CDT Related reference CDT Home amp Copyright IBM Corporation and others 2000 2004 How to bring C C source files into Eclipse A common scenario that you may encounter when starting to use the CDT is determining how to bring existing C C source files into Eclipse There are a number of ways to do this The scenarios described below are recommended approaches Create a project from CVS If your existing source tree is
126. e that source folders can only be currently used with Standard Make projects Managed Make projects treat the entire project as a source folder Source folders are a way to cut down on a project s indexing scope You can mark the folders that are part of your day to day work or part of a subsystem that you work on All files inside source folders will be indexed and are thus searchable Note that any files pulled in by a file inside a source folder will also be indexed t Properties for HelloWorld B ial x Info C C Project Paths Builders C C File Types C C Include Paths amp Symbols C C Indexer gt Source Output io Projects Hl Libraries Path Containers Source Folders on build path C C Make Project 12 Helloworld Add Folder Project Paths 3 Exclusion filter None Project References Eeir amp New Folder x Folder name Advanced gt gt Remove To setup source folders 1 Right click on the project and select Properties gt C C Project Paths 2 Click on the Source tab By default the entire project is a source folder which means everything will be indexed This is reasonable for smaller projects but definitely not recommended for large projects 3 Click Add folder to add the folders A dialog will explain exclusion filters have been added to nesting folders You will see that the folder you added will be excluded from the
127. eate a new cpp file and type mai CTRL SPACE the following code is inserted at the cursor location int main int argc char argv No Completions If you invoke Content Assist but no completions are found a message will be displayed on the status to inform you that the Content Assist parser has timed out No completions available Related concepts Code entry Related tasks Using Content Assist Creating and editing code templates Importing and exporting code templates Related reference C C perspective icons Copyright IBM Corporation and others 2000 2004 Templates Templates are sections of code that occur frequently enough that you would like to be able to insert them with a few keystrokes This function is known as Content Assist the sections of code that are inserted are known as templates To input an existing Content Assist template into a file such as one for an if statement type the initial character i in this case then press Ctrl Space The templates that begin with that character appear Double click on a template to insert it into a file You can edit existing Code Content Assist templates or create new ones From the menu bar choose Window gt Preferences gt C C gt Code Templates Related concepts CDT Overview Related tasks Creating and editing code templates Using templates Importing and exporting code templates Related reference Edit menu Content Assist page Pref
128. eatures If Autodiscovery is enabled once a build has completed any discovered paths and symbols will be displayed in the Discoverd Paths section You can also define the properties on a per project basis in the C C Projects or Navigator views To add include paths and symbols C C Indexer Make Project C C Project Paths Project References 1 To set properties for your project right click your standard make project and select Properties 2 Click C C Include Paths and Symbols amp Properties for HelloWorld iol x Info C C Include Paths amp Symbols Builders C C File Types Include Paths and Preprocessor Symbols C C Include Paths amp Sy HelloWorld Add Folder File 5 0 Discovered Paths gu EE Includes Add Preprocessor Symbol c cyqwiniusriinclude c 3 3 1 EA ccygwintlusrtincludeVc4 2 43 3 106 EA eeygwinlusrtincludeVc4 2 43 3 1 be Add External Include Path cricygwinilbigec Ib 686 pc cygin Add Include Path from Workspace eMeygwinlusrtinclude E c cyqwin usr include w32Zapi Preprocessor Symbols Add Contributed Ace Hi Edit ace_debug TRUE Remove Export Down Up 2 Show Inherited Paths coe 3 Select Add Preprocessor Symbol amp Add Preprocessor Symbol Symbol definition and enter your symbol 4 Select Add External Include
129. ect Rebuild Project Other 2 In the File name box type makefile In the list of projects verify that the correct project is selected 4 Click Finish Mew File File Create a new File resource 5 The C C editor opens Type makefile instructions in the C C editor makefile X makefile all hello clean rm main o hello exe hella hello main o g g o hello main o main o mair Cpp g c g main cpp 6 Click File gt Save Related concepts Makefile Working with C C project files Related tasks Displaying C C file components in the C C Projects view Hiding files by type in the C C Projects view Related reference Views amp Copyright IBM Corporation and others 2000 2004 Hiding files by type in the C C Projects view You can hide files by type that you do not want to see in the C C Projects view To hide files by type 1 In the C C Projects view click the Menu icon Jr Oria Select Working Set Includes Deselect Working Set KE main cpp Edit Active Working Set E mainz cpp E F hello exe x86le Filters 2 main o x amp 6le Link with Editor makefile 2 Click Filters C Element Filters 8 ma i _ _ Tine patterns separated by comma string GE archive files Closed projects Executable files Non l
130. ective Close All Perspectives Navigation k Preferences Name Function Keyboard Shortcut New Window Window menu commands This command opens a new perspective in this Workbench window This preference can be changed in the Window Preferences Workbench Perspectives page All of the perspectives that are Open Perspective open within the Workbench window are shown on the shortcut bar The perspectives you will likely want to open are listed first This list is dependent on the current perspective From the Other submenu you can open any perspective This command displays the selected view in the current perspective You can configure how views are opened in the Window Preferences Workbench Perspectives page Views you are likely to want to open are listed first This list is dependent on the current perspective From the Other submenu you can open any view The views are sorted into categories in the Show View dialog Show View Each perspective includes a predefined set of actions that are accessible from the menu bar and Workbench toolbar Related actions are grouped into action sets This command allows you to customize the current perspective by showing or hiding various action sets The first three File gt New Window gt Open Perspective Window gt Show View control which actions appear as top level items in their respective menus The last category Other controls which act
131. el The diagram below shows the basic set of relationships between these components Build settings file Build model Makefile generator CDT parser User interface CDT End user Plug in manifest Tool Integrator Figure 1 Managed build system Overview 1 2 1 External Users From the perspective of the build model there are two external users The first is the end user that interacts with the build model through the UI elements described in section 4 The Ul includes a new project wizard that asks the build model about what tools have been defined for new projects When the project has been created the project property page uses the information in the build model to populate its display The user can change the information associated with the tools for a project through the property page and the build model is responsible for saving those changes between sessions The second external user is the tool integrator who adds information about their tool chain to a plug in manifest as described in the tutorial in Section 5 The tool chain integrator is the primary audience for this document 1 2 2 Internal Users There are three internal clients of the information in the managed build system The first is the makefile generator that creates a correct makefile for a project based on the tools and settings defined for the project in the build system The second is the built in CDT parser that relies on the build system to tell it ab
132. enabled for this project Enable C Index problem reporting When selected any index related errors detected will be reported Related concepts CDT projects Related tasks CDT Managed Make Tutorial CDT Standard Make Tutorial Related reference New Project Wizard Managed Make Select a Target Managed Make Referenced Projects Managed Make Error Parsers Managed Make C C Indexer Standard Make Name Standard Make Referenced Projects Standard Make Make Builder Standard Make Error Parsers Standard Make Binary Parser Standard Make Discovery Options Copyright IBM Corporation and others 2000 2004 Run and Debug dialog boxes This section describes the Run and Debug dialog boxes Main Arguments Environment Debugger Source Common Copyright IBM Corporation and others 2000 2004 Main page Run or Debug dialog boxes The Main page of the Run dialog box and the Debug dialog box identifies the project and application you want to run or debug Project Specifies the name of the project C C Application Specifies the name of the application Related concepts Debug overview Debug information Related tasks Running and debugging Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Arguments page Run or Debug dialog boxes The Arguments page of the Run dialog box and the Debug dialog box lets you specify the execution
133. ences window Workbench New Make Projects E Ant Build Order Specify the settings used as defaults by the New Standard Make Project creation wizard El C C Set required binary parser for this project Build Console Code Templates E Debug Make Builder Error Parsers Binary Parser Discovery Options GDB MI Binary Parser Source Code Locations EIF P Up d arser aged C GNU Elf Parser ni PE Windows Parser Down Make Targets Cygwin PE Parser New Make Projects Search Help Binary Parser Options Install Update addr2line Command Java Plug in Development addr2line Browse Run Debug c filt Command Team c filt Browse cygpath Command cygpath Browse Restore Defaults Apply Import Export Binary Parser Select binary parsers from the list and changed the order in which they are used Binary Parser Options If a binary parser has parser options you can define them in this section Related concepts Build overview Related tasks Selecting a binary parser Related reference Project properties Copyright IBM Corporation and others 2000 2004 Discovery Options page C C Preferences window You can define the discovery options on the Discovery Options page of a C C Preferences window ioi x Workbench New Make Projects
134. eneral Search dialog to help you search for e Files or for text in files e Elements in C C files e Textin the online help e Plug ins main cpp Eclipse Platform File Edit Navigate Search Project Run Window Help le See 0 9 Je c Search Ctrl H EIP File t Keyboard Shortcut Name Function C C Opens the search dialog on the C C search page Search Opens the search dialog for your current editor Ctrl H File Opens the search dialog on the File search page Related concepts Coding aids C C search Related tasks Searching for C C elements Customizing the C C editor Related reference C C editor preferences Search dialog Search view amp Copyright IBM Corporation and others 2000 2004 Project Menu actions a C C main cpp Eclipse Platform File Edit Mavigate Search Project Run Window Help LT m d Open Project e ux a Close Project aie Build All 1010 Build Project Build Working Set Clean Build Automatically Create Make Target Build Make Target Properties Name Function Keyboard Shortcut Shortcut Open Project Shows a dialog that can be used to select a closed project Sens lg GRISE open it a Close Close Project Closes the currently selected projects the Closes the currently selected project
135. enumerated option they treat any pre defined list option values as defaults The value defined in the command attribute will be applied to all the values in the list 2 7 1 4 1 Special List Options There are four special cases of string list options includePaths specify the paths to search for header files definedSymbols for user defined preprocessor defines 1ibs for libraries that must be linked into the final build goal and userOb js for external object files that must be linked While specifying these types of options as type stringList will make them appear in the UI correctly the build model will not be able to recognize them as special in any way Since certain functions of the CDT require this information to function correctly it is important to flag these types of options appropriately For example the search and indexing function may not perform correctly if the includes paths and defined symbols are not set for a project Similarly the makefile generator may not be able to generate dependencies correctly in the makefile if it is unaware that there are libraries and external object files that participate in the final build step 2 7 2 Default Values Options can contain default values that apply to the option until the user has edited them through the Ul You can specify those values using the defaultValue attribute However the type of option will determine how the build model treats the value it finds associated with the attrib
136. er In complex projects the makefile in the root folder calls other makefiles in other directories to produce the build results e external header files and library files do not need to be in or beneath the root folder The resources for the project are maintained in the remote location specified not in the workspace folder for Eclipse However your existing folder structure is displayed in the C C Projects view Meta data for the project such as the index for the project and the link to the existing source is stored in the metadata directory in the workspace folder For more information on the workspace folder see Workbench User Guide gt Tasks gt Upgrading Eclipse Once you create a CDT project you cannot easily move it or redefine its root folders If you need to you can delete the CDT project without deleting its contents and then recreate it specifying a different non default location Import your C C source file system Another approach would be to create a C C Project and then import your existing file system For more information see Workbench User Guide gt Tasks gt Importing gt Importing resources from the file system This approach copies the files from your file system to an Eclipse Workbench project or folder Your original source files remain unchanged and it is the copies of the files that will be edited built and debugged using the CDT When you have successfully imported your existing file system the fo
137. er of options To help organize the user interface for these options a hierarchical set of option categories can be defined A unique identifier must be specified in the d attribute This will be used by the build model to manage the category The user will see the value assigned to the name attribute If the category is nested inside another category the unique identifier of the higher level category must be specified in the owner attribute otherwise use the identifier of the tool the category belongs to 2 4 1 Schema Attribute Used by the build model to uniquely identify the option ategory A human readable category name such as Pre processor yes Options This will be the name the user sees displayed in he Ul Option categories can be nested inside other option ategories This is the ID of the owner of the category 2 4 2 Example This example shows an option category that will be displayed in the UI with the label Flags There are two options defined in this category General and Optimization tool gt lt optionCategory owner executable compiler name F lags id compiler category flags lt optionCategory gt lt option name General category compiler category flags lt option gt lt option name Optimization category compiler category flags gt lt option gt lt tool gt 2 5 Configuration A target defines the information about the tools needed to build a pro
138. erations For a description of what each menu item does select an item and press F1 By default the Navigator view is included in the Resources perspective To add it to the current perspective click Window gt Show View gt Navigator x Projects cw Er ded Hello Wor Id cdtproject L project oo hella exe Ila vigabor o 5 makefile H E Test Toolbar icons Icon Name Back command in the resulting display returns the view to the same This command displays the hierarchy of the parent of the current highest Minimize Console Minimizes the view E Maximize Console Maximizes the view d Back This command displays the hierarchy that was displayed immediately prior hierarchy from which you activated the Go Into command The hover help for this button tells you where it will take you This command is similar to the Back button in a web browser level resource The hover help for this button tells you where it will take you TE Collapse All This command collapses the tree expansion state of all resources in the view to the current display For example if you Go Into a resource then the c Forward This command displays the hierarchy that was displayed immediately after the current display For example if you ve just selected the Back command then selecting the Forward command in the resulting display returns the view to the same hierarchy from which you activated the Back
139. erences window Code Templates page Preferences window 5 Copyright Red Hat 2003 2004 Copyright IBM Corporation and others 2000 7004 Editing C C Files This section provides information on editing C C files C C editor C Makefile Copyright IBM Corporation and others 2000 7004 C C editor The CDT provides an editor that gives you specific support for editing C C code This C C editor is invoked automatically when you edit a C C source file The C C editor includes the following features e Syntax highlighting e Content code assist e Integrated debugging features You can customize some of the operation of the Editor view from the Window gt Preferences gt C C gt Editor preferences dialog Related concepts CDT Overview Related tasks Using Content Assist Related reference C C editor key binding actions C C editor preferences Outline view for C C Views and editors Copyright Red Hat 2003 2004 Copyright IBM Corporation and others 2000 2004 Makefile A makefile is a text file that is referenced by the make command that describes the building of targets and contains information such as source level dependencies and build order dependencies The CDT can generate a makefile for you such projects are called Managed Make projects Some projects known as Standard Make projects allow you to define your own makefile Sample Makefile A sample Makefile This Ma
140. error message similar to those shown If you already have a valid Makefile you may need to change the working directory of your build The default working directory for the build command is the project s root directory You can change this by specifying an alternate Build Directory in the Make Project properties Or if your Makefile is named something else eg buildFile mk you can specify the name by setting the default Build command tomake f buildFile mk If you do not have a valid Makefile create a new file named Makefile in the root directory You can then add the contents of the sample Makefile above and modify it as appropriate Q3 My Console view says missing separator make k clean all makefile 12 missing separator Stop The standard syntax of Makefiles dictates that every line in a build rule must be preceded by a Tab character This Tab character is often accidentally replaced with spaces and because both result in white space indentation this problem is easily overlooked In the sample provided the error message can be pinpointed to line 12 of the file makefile to fix the problem insert a tab at the beginning of that line Q4 My Console view says Target all not remade because of errors make k clean all make clean Error 255 rm f Testl o Test2 o Main o test me exe gtr g o IGestl o c Iestl cpp make Testl o Error 255 make c DPTest2 0 Error 255 make Main o Error 255
141. erties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Standard Project References Properties for HelloWorld Project References Builders C C File Types C C Include Paths amp Symbc C C Indexer C C Make Project CIC Project Paths Project References Project references for lt project gt Select the projects required to build this project Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Pro
142. es Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Managed Indexer You can select which C C Indexers to use for your project The indexer is necessary for search and related features like content assist C Properties for HelloWorld Info C C Indexer Builders C C Build CiC Indexer C C File Types Enable C C Indexing C C Indexer Error Binary Parsers Project References Index problem reporti
143. es Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Managed Builders You can select which Builders to enable for this project and in which order they are used Properties for HelloWorld oj Info Builders Em CIC Build Configure the builders For the project C C File Types on Generated Makefile Builder New CIC Indexer lt Error Binary Parsers Import Project References Edit Remove un Up Down Builders Select which Builders to enable New Add a new builder Import Import a builder Edit Edit a builder Remove Remove a builder Up Move the currently selected builder higher in the list Down Move the currently selected builder lower in the list Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Stand
144. es and click Apply For a description of the Color preferences click here 7 To customize Content Assist preferences click the Content Assist tab For more information see Using Content Assist 8 Click OK Related concepts Coding aids Related tasks Customizing the C C editor Related reference C C editor preferences Copyright IBM Corporation and others 2000 2004 Commenting out code You can comment out one or more lines of code The leading characters are added to the beginning of each line The characters on lines that already are already commented out are not affected when you comment and uncomment code as described above To comment out code 1 In the C C editor select the line s of code that you want to comment out If no lines are selected comments will be added or removed at the current cursor positition 2 Right click and do one of the following o To comment out the selected code select Comment o To remove the leading characters from the selected line s of code select Uncomment Tip Instead of using the context menu right click you can quickly comment out by pressing CTRL or remove comments by pressing CTRL Related concepts Code entry Related tasks Customizing the C C editor Working with Content Assist Related reference C C editor code templates and search preferences Copyright IBM Corporation and others 2000 7004 Working with Content
145. es on the host machine is defined in the cleanCommand attribute Typically a build target will only be valid on a limited subset of operating systems For example it does not make much sense to allow a user to create a Solaris shared library project if they are running Eclipse and the CDT on Windows You can specify the operating systems that the target is restricted to as a comma separated list in the osList attribute At the moment you can specify win32 linux and solaris as the filters The CDT offers a facility for parsing binary files if it knows which output format the build artifact has been produced with The binaryParser attribute must contain the id of the appropriate parser if you want build artifacts of the target to be parsed in the workspace There are currently two defined binary parsers org eclipse cdt core PE for Windows artifacts and org eclipse cdt core ELF for Linux and Solaris This information is used to set the parser when a project is created and is not something the user can change through the UI The target is responsible for maintaining the name of the final build goal The user selects the name of the build target in the Ul and the build model maintains it in the artifactName attribute The implementer of a tool chain should not specify this in the plug in manifest However the default extension for the target can be specified using the defaultExtension attribute 2 2 1 Schema Attribute he name of the bu
146. finding resources Related concepts C C search C C Indexer CDT Projects Open Declarations Related tasks Selection Searching for C C elements Navigate to C C declarations Related reference C C search page Search dialog box Copyright IBM Corporation and others 2000 7004 Selection Searching for C C elements It is recommended that you perform searches on successfully compiled programs to ensure the accuracy of search results It is important to familiarize yourself with the correct search syntax to use to complete an effective search It is also important to ensure that include paths and symbols are correctly defined For more information see Including paths and symbols See C C search for more information on What you can search for How to limit your search How to use wildcard characters in your search Syntax examples To search for an element in your project 1 Highlight the element you want to search 2 Right click and select Search For from the context menu Class Gete public shapezd private dou str public vir dou voi voi str dou voi voi Hendif Undo Revert File Cut Ctrl X Copy Ctrl C Paste Ctrl Shift Right Shift Left Comment Ctrl Uncomment Chri Content Assist Ctrl Space Include Gtr Shitt f Show in C C Projects Refactor Open Declaration Search For Run Line gt Resume At
147. following o Inthe Address box type an address and press Enter o Inthe memory view type a new value for memory The Memory view works in typeover mode To jump from byte to byte use the arrow keys To change the appearance of the Memory view 1 Do one of the following o Inthe Memory view click one of the tabs o Click Window gt Preferences 2 In list of memory addresses right click and select o Format gt Hexadecimal Signed Decimal or Unsigned Decimal o Memory Unit Size gt 1 2 4 or 8 bytes o Number of Columns gt 1 2 4 8 or 16 columns Related concepts C C Development perspective Related tasks Debugging Related reference Debug views Copyright IBM Corporation and others 2000 2004 Searching for C C elements It is recommended that you perform searches on successfully compiled programs to ensure the accuracy of search results It is important to familiarize yourself with the correct search syntax to use to complete an effective search It is also important to ensure that include paths and symbols are correctly defined For more information see Including paths and symbols See C C search for more information on What you can search for How to limit your search How to use wildcard characters in your search Syntax examples Performing a C C Search can be done in a number of different ways but regardless of the manner chosen the same information must be provided to C C Search The i
148. for a Managed make project Info Builders Build File Types Indexer Error Parser Project References Copyright IBM Corporation and others 2000 7004 C C Project Properties Managed Info amp Properties for HelloWorld 10 Info Builders CJC Build Path IHelloworld C C File Types Type Project C C Indexer Location C Eclipse eclipse workspace HelloWorld lt Error Binary Parsers Project References Last modified June 28 2004 4 04 37 PM Default encoding For text Files Inherit From container Cp1252 C Other Restore Defaults Apply Info Shows project information Default encoding for text files You can specify an alternate text encoding Restore Defaults Returns any changes back to their default setting Apply Applies any changes Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properti
149. g 3 In the Configurations box expand C C Local 4 Select a run or debug configuration 5 Click the Arguments tab X Create manage and run configurations Configurations Name Helloworld 1 36 C C Local Hellovorld _ 7 Java Applet Main 9 Arguments e Environment tS Debugger Source Common 3 Java Application Ju JUnit C C Program Arguments Init Plug in Test Run time Workbench Working directory Use default working directory Local directory Browse Helloworld Brawse Workspace New Delete Apply Revert 6 In the C C Program Arguments box type the arguments that you want to pass to the command line 7 To specify a local directory or a different project in your workspace clear the Use default working directory check box 8 Click Run or do the following as required o To set the environment variables and values to use when an application runs see Setting environment variables o To select a debugger to use when debugging an application see Creating a run configuration o To specify the location of source files used when debugging a C or C application see Specifying the location of source files o To specify where the run configuration is stored how you access it and the perspective to open when running an application see Specifying the location of the run configuration Related concepts CDT projects Project file vie
150. ges It is possible to customize the behavior of the indexer through the use of source folders or even turn it off completely This customizable behavior is available on a per project basis i e it is possible to have different indexer settings for each project in your workspace Related concepts C C search C C Indexer Problem Reporting C C Indexer Opening or Closing a project C C Indexer Progress Bar Related tasks Selection Searching for C C elements Enable Disable the C C Indexer C C Indexer Problem Reporting C C Indexer Indexer Timeout Setting Source Folders Related reference Search C C Preferences window C C search page Search dialog box C C Project Properties Managed Indexer C C Project Properties Standard Indexer Copyright IBM Corporation and others 2000 2004 C C Indexer Problem Reporting C C Index Problem reporting places a problem marker on the editor and adds an item to the error list for each preprocessor or semantic problem reported by the parser Note that the markers will only show up the next time the file is indexed Note This feature is not recommended for large projects Preprocessor Problems In order for search and search related features to work properly it is imperative that include paths are set up properly so that the parser can find source files and index them If you suspect that your search results are lacking you can turn on the preprocess
151. gned static myfunc int a char b Team This comment may span multiple lines int integer 0 This comment may span only this line if integer 0 printf zero gt Restore Defaults Apply Import Export System Default Uses the system default for the background color Custom Changes the background color Foreground Lists items such as comments keywords and strings for which you can specify a color Color Specifies the color in which to display the selected item Bold Makes the selected item bold Related concepts Coding aids Related tasks Customizing the C C editor Related reference C C editor preferences Copyright IBM Corporation and others 2000 2004 Content Assist preferences You can customize the Content Assist feature on the Contents Assist page of the C C Editor Preferences window To change the Content Assist preferences click Window gt Preferences gt C C gt C Editor gt Content Assist ioi xi Workbench Editor Ant Build Order C C Editor Preferences a Cice c General c Colors P c Content Assist c Hovers c Navigation Build Console Code Templates Search scope For completion proposals Debug Search current File and included files GDB MI C Search current project Source Cod
152. guments o To set the environment variables and values to use when an application runs see Setting environment variables o To select a debugger to use when debugging an application see Selecting a debugger o To specify where the run configuration is stored how you access it and the perspective to open when running an application see Specifying the location of the run configuration Related concepts CDT Projects Project file views Related tasks Creating or editing a run configuration Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Specifying the location of the run configuration When you create a run configuration it is saved with the extension Launch in org eclipse debug core You can specify an alternate location in which to store your run configuration You can also specify how you access it and what perspective to open when running an application To specify the location of a run configuration Inthe C C Projects view select a project Click Run gt Run or Run gt Debug In the Configurations box expand C C Local Click the Common tab ROND Create manage and run configurations Configurations Name Helloworld C C Local 6 3 Java Application Type of launch configuration Ju JUnit Local Ju JUnit Plug in Test P head Run time Workbench share Location of shared configuration 7 Java Applet
153. gurations that are defined for the target currently selected in the first The figure below shows a project targeted solely at a Cygwin executable with two configurations Release not shown and Debug Note that the build settings model is queried for the target and configuration name information Tite tule Active y iguratier up Plafom s sm sieht 3 Configui aout sex eec T Cons Cumis a H3 Command Line Level 9 TT ika Figure 4 Configuration selection Users change the build settings for options associated with categories and tools The UI relies on the information in the build settings model for that information The figure below shows how the tool list displayed in a tree view is populated Tools are the root elements of the tree Categories are displayed as leaves of the tool they belong to In both cases the name defined in the plug in manifest is used as the text of the tree elements Note that the tool uses an externalized string to identify its name to help internationalize a tool specification but this is not necessary C C Build Active configuration Platform Cygwin Executable Configuration Debug 1 Configuration settings 1 T Compiler Compiler Flag fi Preprocessor Optimization 1 H3 oeneral Command tir Debug Level
154. hat have been selected in the view Copyright IBM Corporation and others 2000 2004 Outline view The Outline view displays an outline of a structured C C file that is currently open in the editor area by listing the structural elements c main cpp h circle h 23 shape2d h shape3d h h shape h h cube h Outline Make Tar E class circle public shape2d wav private shape2d h double size Q circe string color size double public Constructors Destructors color string circle 9 circle ecirce virtual circle Q setSize double void Methods OQ setColor string void void setSize double s size s lt 0 0 5 getColor string m double return size area double void setColor string c color c print void string getColor return color set void double area return pi pow size 2 void printi cout lt lt Circle lt lt n tRadius lt 501 E Outline view toolbar icons The table below lists the icons displayed in the Outline view toolbar LIONEL OIN ae Outline view icons The table below lists the icons displayed in the Outline view em eerie Macro Definition o eee pem o pemm C NNNM C C eem e unen wenns s wmm e e em p emm Related concepts Outline view Re
155. he code template that is selected in the list Remove Removes the selected code templates from the list Import Imports a code template Export Exports the selected code templates Export All Exports all templates in the list Enable All Makes all templates available when you invoke the Content Assist feature Disable All Makes all templates unavailable when you invoke the Content Assist feature Related concepts Coding aids Related tasks Customizing the C C editor Working with Content Assist Related reference C C editor preferences Copyright IBM Corporation and others 2000 2004 Debug page Preferences window You can manipulate any of the common predefined debug settings by clicking Window gt Preferences gt C C gt Debug 5 nj Workbench E Ant i Build Order General settings For C C Debugging El CiC Build Console Opened view default settings Code Templates Show Full paths T MI Automatically refresh registers Source Code lacations Automatically refresh shared libraries Editar 1 kd File Types Default variable Format Natural Make Targets T New Make Projects Search Help Install Lipdate Java Disassembly options Plug in Development Maximum number of instructions 100 RunjDebug Team Restore Defaults Apply Import Export Cancel Show Full Paths Select this checkbox to show the fu
156. he remaining explicit dependencies in a separate makefile fragment for each subdirectory The figure below shows the fragment for the source1 subdirectory Automatically generated dependency list sourcei Classi o C iVeclipseiruntime workspacelProject headers Classli h C eclipse runtime workspace Projecta headers Class2 h 4 4 Inter Project Dependencies A project may reference one or more additional projects in the workspace The makefile generator attempts to generate these dependencies in two ways First the makefile must have a dependency on the build goal of the referenced project in the main target and it must include instructions for building those targets as a separate rule For the remainder of this discussion let us consider the following basic scenario Project A builds an executable a exe It references project B which builds a library 1ibB a The main build target in the makefile for project A would be generated with the output of project B as a dependency all deps deps cd C Eclipse runtime workspace ProjectB Release amp amp clean all OBJS C Eclipse runtime workspace ProjectB Release libB a g o 8 OBJS USER OBJS LIBS As you can see from the generated makefile above the rule for the target A exe will be evaluated if the output of B has changed This works well if the output of project B can be determined However that is only the case when proje
157. he selected process and remove it from Debug view Remove Relaunch Restarts the process Terminate All Ends all active processes in Debug view Related concepts Debug overview Debug information Related tasks Debugging Related reference Run and Debug dialog box amp Copyright IBM Corporation and others 2000 2004 Debug preferences The Debug view of the Debug perspective displays information about the variables in the currently selected stack frame Show full paths Displays the full path of resources Default variable format Specifies the number system in which to display variables Natural Hexadecimal or Decimal Default expression format Specifies the number system in which to display expressions Natural Hexadecimal or Decimal Default register format Specifies the number system in which to display registers Natural Hexadecimal or Decimal Automatically switch to disassembly mode Automatically examines your program in disassembly mode as it steps into functions for which you do not have source code such as printf Related concepts Debug information Related tasks Debugging Related reference Views Copyright IBM Corporation and athers 2000 7004 C C Icons The table below lists the icons displayed in the C C perspective Description C or C file Class Code template Macro Definition Enum Enumerator Variable Field private Field protected Field public nclude
158. he whole file or Selected Lines to search only within the highlighted area e Whether the search is Case Sensitive or Whole Word You can also specify whether the search wraps at the end of the file If you close the Find Replace dialog with text in the Find field you can use Ctrl K or Edit gt Find Next or Ctrl Shift K or Edit gt Find Previous to go to the next occurrence of that text The directions for Next and Previous are not affected by the Direction setting in the Find Replace dialog Note Wildcards are not currently supported for searches Incremental Find You can also choose Incremental Find from the Find Replace dialog With this option selected each letter you type in the Find field causes the editor focus to move to the first complete occurrence of the text you are typing You can also use incremental find by pressing Ctrl J Edit gt Incremental Find In this case the text you type appears in the Status Line at the bottom of the Eclipse window Note The settings in the Find Replace dialog do not affect the operation of incremental find in the Status Line Copyright Red Hat 2003 2004 Copyright IBM Corporation and others 2000 2004 C C preferences The C C Preference dialog box allows you to make changes to your C C environment 4B xi El Ant Build Order Link view selection to active editor c SEN v Show File members in Project View Build Console Code Templates Debug Foll
159. hers 2000 2004 Viewing and managing compile errors This section describes how to view and manage compile errors Compile errors are displayed in the console view Jumping to errors Filtering the Tasks view Setting reminders Copyright Corporation and others 2000 2004 Jumping to errors The CDT will parse the output from the make and compiler linker If the CDT can determine the location of an error it is added to the Console view To jump to the source of an error e In the Console view double click the Error icon e or the Warning icon A The file opens in the C C editor and the cursor moves to the line with the error To jump to errors sequentially e Click Jump to next or Jump to previous Related concepts Build overview Related tasks Defining Build Settings Filtering the Tasks view Setting reminders Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Filtering the Problems view Depending on the complexity and stage of your program an overwhelming number of errors can be generated You can customize Problems view to only view certain types of errors To filter errors In Problems view click the Filters icon r2 2 To view all errors and warnings select all checkboxes in the Show items of type list and click On any resource 3 Click OK Related concepts Build overview Related tasks Defining Build Settings Jum
160. ies Path Containers Output Folders on build path Add Folder Edit Remove p Info Builders C C File Types CiC Include Paths amp Symbc C C Indexer CIC Make Project C C Project Paths Project References d Exclusion filter None Add Folder Add an output folder Edit Edit an output folder Remove Remove an output folder Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References
161. ies Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Discovery Options You can define the discovery options on the Discovery Options page of a C C project s properties window C Properties for HelloWorld E Bf Info C C Make Project Builders C C File Types Set the scanner configuration discovery options for this project CiC Include Paths amp Symbols C C Indexer Make Builder Er
162. ild goal defined by the target This is set by he user through the UI and stored in the build model through this attribute he id of the appropriate parser for the build artifact leanCommand he command to remove files on the build machine You must define this value if the target does not have a parent or it is not defined in the parent defaultExtension he extension the build goal will have for example exe or so A unique identifier that the model manager will use to keep track yes of this specific target isAbstract Flags the target as abstract An abstract target can not be yes selected by the user in the UI but children of the target will inherit its tools and configurations A target can be flagged for test purposes only It can be manipulated programmatically in JUnit tests for example but not selected by the user in the UI he command to invoke the make utility You must define this alue if the target does not have a parent or it is not defined in he parent A comma separated list of operating systems that the target is alid for parent he unique ID of the parent of the target no 2 2 2 Example The example below shows a target definition called Executable Tool and configuration information will be added to our definition is later sections extension gt lt target makeFlags k isTest false cleanCommand rm rf name Executable defaultExtension2
163. indexer can be enabled or disabled at any time by Right clicking on the project Selecting Properties Navigate to the C C Indexer page Select Deselect the Enable C C Indexing checkbox A WNI If you enable the index on a project that had the index disabled the indexer will reindex all of the project s source folders If you disable the index on a project it will no longer react to any resource change events If the indexer is indexing at the time you disable the index it will throw away the rest of the index jobs at that point If some projects in your workspace have the indexer disabled then search will display a warning message in the status bar If all projects have the index disabled then Search will not allow you to continue until at least one project has the index enabled You can also disable the indexer when you first create a new project by clicking on the C C Indexer tab which is present in both Standard and Managed project wizards and deselecting the Enable C C Indexing checkbox Related concepts C C search C C Indexer C C Indexer Problem Reporting C C Indexer Opening or Closing a project C C Indexer Progress Bar Related tasks Selection Searching for C C elements C C Indexer Problem Reporting C C Indexer Indexer Timeout Setting Source Folders Related reference Search C C Preferences window C C search page Search dialog box C C Project Properties
164. ing make to build it D Make builder settings 1 Projects Make Builder Error Parsers Binary Parser Discovery Options Indexer Build command v Use default Build command make Build Setting on first build error Workbench Build Behavior Workbench build type Make build target Build on resource save Auto Build all Note See Workbench automatic build preference v Build Incremental Build all Iv Rebuild Full Build clean all M Clean clean gt Finish Cancel Function Build Command Specifies which make command to use when a build is performed Controls whether the compiler will Stop On Error or to keep building If you do not select Stop On Error this will force the compiler to attempt to build all referenced projects even if the current project has errors You can specify the behavior of builds predefined by the C C toolkit by Workbench Build Behavior linking them to specific build targets in your makefile The predefined builds are Auto Build Incremental Build Rebuild and Clean Related concepts CDT projects Related tasks CDT Managed Make Tutorial CDT Standard Make Tutorial Related reference New Project Wizard Managed Make Select a Target Managed Make Referenced Projects Managed Make Error Parsers Managed Make C C Indexer Standard Make Name Standard Make Referenced Projects Standard Make Erro
165. ing a project Selecting referenced projects Defining build settings Filtering errors Selecting a binary parser Adding Include paths and symbols Selecting a deployment platform Setting build order Building Manually Removing Build Automatically Autosaving on a build Creating a make target Customizing the Console view Viewing and managing compile errors Jumping to errors Filtering the Tasks view Setting reminders Copyright IBM Corporation and others 2000 2004 Renaming a project You can rename a project and have all references changed using the refactoring engine To rename a project 1 In the C C Projects view right click a project and select Rename Navigator hy CC Projects ao Into Open in New Window il Build Make Target Create Make Target Build Project Rebuild Project Copy Buc Delete Move Rename L Import _ Export Refresh Close Project Team Compare With Restore From Local History Properties 2 Type a new name 3 Press Enter Note Renaming a project causes it to be re indexed This can take a significant amount of time for very large projects Related concepts CDT Projects Project file views Related tasks Working with C C project files Related reference Project properties amp Copyright IBM Corporation and others 2000 2004 Selecting referenced projects The Referenced C C Projects list on the Projects Refe
166. ion sets are visible in the perspective Customize Perspective This command allows you to save the current perspective creating your own custom perspective You can open more perspectives of this type using the Window gt Open Perspective gt Other menu item once you have saved a perspective Save Perspective As This command changes the layout of the current perspective to its original configuration Close Perspective This command closes the active perspective Close All Perspectives This command closes all open perspectives in the Workbench window This submenu contains shortcut keys for navigating between the views perspectives and editors in the Workbench window e Show System Menu Shows the menu that is used for resizing closing or pinning the current Reset Perspective view or editor e Show View Menu Shows the drop down menu that is available in the toolbar of the active view e Maximize Active View or Editor Maximizes the current view or editor to fill the workbench e Activate Editor Makes the current editor active e Next Editor Activates the next open editor in the Navigation list of most recently used editors e Previous Editor Activates the previous open editor in the list of most recently used editors e Next View Activates the next open view in the list of most recently used views e Previous View Activates the previous open view in the list of most recently used views e Next Perspe
167. ion writable Smart Insert 9 26 For more information see Adding Include paths and symbols Related concepts CDT Projects C C search Related tasks Adding Include paths and symbols Navigate to a C or C element s declaration Searching for C C elements amp Copyright IBM Corporation and others 2000 2004 Build This section describes the build views and terminology Building C C Projects Manage Build Extensibility Document Copyright IBM Corporation and others 2000 2004 Building C C projects The CDT relies on an external make utility such as GNU make to build a project The CDT can generate makefiles automatically when you create a Managed Make C project or a Managed Make C project You have the option of creating a Standard Make C project or a Standard Make C project and providing the makefile yourself Required utilities You must install and configure the following utilities e Build e g make e Compile e g gcc e Debug e g gdb Note while make gcc and gdb are the examples used in the documentation virtually any similar set of tools or utilities could be used Tip Cygwin contains these utilities make gcc and gdb for a Windows environment while running the cygwin installation ensure gcc and make are selected they are not installed by default For more information see http www cygwin com Red Hat users all you need to build your project is included in the Red Hat Linux insta
168. is new a descriptive name for this launch configuration o Inthe Project box type the name of the project containing the application that you want to run o In the C C Application box type the name of the executable that you want to run 7 Click Run or do the following as required o To specify the execution arguments that an application uses and to specify the working directory for a run configuration see Specifying execution arguments o To set the environment variables and values to use when an application runs see Setting environment variables o To select a debugger to use when debugging an application see Selecting a debugger o To specify the location of source files used when debugging a C or C application see Specifying the location of source files o To specify where the run configuration is stored how you access it and the perspective to open when running an application see Specifying the location of the run configuration Related concepts CDT projects Project file views Related tasks Creating or editing a run configuration Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Specifying execution arguments You can specify the execution arguments that an application uses and the working directory for a run configuration To specify execution arguments 1 In the C C Projects view select a project 2 Click Run gt Run or Run gt Debu
169. ject Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 New Project Wizard The New Project wizard helps you create a new C or C project in the workbench To access the wizard from the menu bar select File gt New gt Project The New Project wizard appears E New Project I X Select a wizard Wizards 009 Java Project Plug in Project ER pet Managed Make C Project Standard Make C Project Be Managed Make C Project x 4 Standard Make C Project cys Leb Java L Plug in Development Simple Back gt Cancel With the New Project wizard you can choose to Create a Managed Make C Project Create a Standard Make C Project Create a Managed Make C Project Create a Standard Make C Project Related concepts CDT projects Related tasks CDT Managed Make Tutorial CDT Standard Make Tutorial Related reference Managed Make Name Managed Make Select a Target Managed Make Referenced Projects Managed Make Error Parsers Managed Make C C Indexer Standard Make Name Standard Make Referenced Projects Standard Make Make Builder Standard Make Error Parsers Standard Make Binary Parser Standard Make Discovery Options Standard Make C C Indexer amp Copyright IBM Corporation and others 2000 2004 C
170. ject Run Window Help Ire Into x A an Ta Open Type Ctrl ShiFt T Open Resource Ckri4 ShifE R Show In AIE SHIFE VY B us a Previous to Last Edit Location an En Line lt Back Alt Left ub Forward AlE Right Name Function Keyboard Shortcut Go Into Sets the view input to the currently selected element Go To e Back This command displays the hierarchy that was displayed immediately prior to the current display For example if you Go Into a resource then the Back command in the resulting display returns the view to the same hierarchy from which you activated the Go Into command This command is similar to the Back button in an HTML browser e Forward This command displays the hierarchy that was displayed immediately after the current display For example if you ve just selected the Back command then selecting the Forward command in the resulting display returns the view to the same hierarchy from which you activated the Back command This command is similar to the Forward button in an HTML browser e Up one level This command displays the hierarchy of the parent of the current highest level resource e Resource This command allows you to navigate quickly to a resource For more information see the links to related tasks below Open Type Brings up the Open Type selection dialog to open a type in the editor The Open T
171. ject for a particular environment Configurations are used to pre define and store the settings that the user specifies for those tools A target must have at least one default configuration defined for it Users can create new configurations for a project but they must be based on the settings defined in a default configuration For example a user may want to create a Profile configuration based on the target s default Debug configuration Each configuration must have a unique identifier specified in the d attribute that will be used by the build model to manage the configuration It must also have a name that will be displayed in the UI in the build property page and new project wizards 2 5 1 Schema Attribute Description rack of this specific configuration he human readable name that will be displayed in the UI o identify this configuration 2 5 2 Example The example below shows a configuration named Default that belongs to the target Executable target name Executable gt configuration name Default id example confidg default configuration lt target gt 2 6 Tool Reference A tool reference is primarily intended to be used when saving user settings between sessions When the user has overridden an option in the referenced tool an option reference with the new setting is created and added to the tool reference Tool references are used by the build model for two distinct tasks because
172. ke errors e Change the default build command e Map the target passed to make when you select build or rebuild You can define the properties on a per project basis in the New Project wizard in the C C Projects view or in the Navigator view You can also define project properties in the Preferences window for future standard make projects Before you begin In order to be able to turn on or to turn off the feature that automatically performs an incremental build of your project every time a resource is saved for individual projects you need to enable the Workbench Build Automatically preference You can then disable this feature or change the associated make target for individual projects To enable build on resource save 1 Click Window gt Preferences 2 To automatically perform an incremental build of your project every time a resource is saved select Workbench from the list 3 Select the Perform build automatically on resource modification check box Note this is the default setting You can now enable or disable this feature on a per project basis To define build settings amp Preferences Workbench Ant Build Order CIC Build Console Code Templates Debug GDB MI Source Code Locations Editor File Types Make Targets New Make Projects Search Help Install Update Java Plug in Development RunjDebug Team Import
173. kefile demonstrates and explains Make Macros Macro Expansions Rules Targets Dependencies Commands Goals Artificial Targets Pattern Rule Dependency Rule Comments start with a and go to the end of the line Here is a simple Make Macro LINK_TARGET test_me exe Here is a Make Macro that uses the backslash to extend to multiple lines This allows quick modification of more object files OBJS Testl o Test2 0 V Main o Here is a Make Macro defined by two Macro Expansions A Macro Expansion may be treated as a textual replacement of the Make Macro Macro Expansions are introduced with and enclosed in parentheses REBUILDABLES OBJS S LINK TARGET Make Macros do not need to be defined before their Macro Expansions but they normally should be defined before they appear in any Rules Consequently Make Macros often appear first in a Makefile Here is a Simple Rule used for cleaning your build environment It has a Target named clean left of the colon on the first no Dependencies right of the colon and two Commands indented by tabs on the lines that follow The space before the colon is not required but added here for clarity clean rm f REBUILDABLES echo Clean done There are two standard Targets your Makefile should probably have all and clean because they are often command line Goals Also these are
174. kets When the cursor is beside a bracket the matching bracket is highlighted Highlight current line Highlights the line that was last selected Show print margin Displays the print margin in the editor Insert space for tabs Inserts a space instead of a tab character when you press Tab Use custom caret Select a custom caret vertical bar icon showing cursor position Enable thick caret Displays a thicker caret vertical bar icon showing cursor position Appearance color options Lists the items for which you can specify a color Color Changes the color of the item that is selected in the list Related concepts Coding aids Related tasks Customizing the C C editor Related reference C C editor preferences Copyright IBM Corporation and others 2000 2004 Color preferences You can customize the appearance of the C C editor on the Colors page of the Preferences window ioi x Workbench C O E Ant Build Order C C Editor Preferences El C C Content Assist c Hovers c Navigation Build Console m Code Templates Background Color H Debug System Default C Custom SI Source Code Locations Editor Foreground File Types Multi line comment color NEN Make Targets Single line comment New Make Projects Keywords Bold Search Preview Help Install Update This is sample C code Java E Plug in Development include lt stdio h gt e unsi
175. l Files Copyright IBM Corporation and others 2000 2004 CDT Overview The C C Development Toolkit CDT is a set of Eclipse plug ins that provide C and C extensions to the Eclipse workbench For more information about Eclipse see Workbench User Guide gt Concepts gt Workbench The CDT provides a C C IDE that simplifies many of the same tools that you can use from the command line The CDT can also communicate with many external utilities and interpret their responses for example e Build such as make e Compile such as gcc For more information see http gcc gnu org e Debug such as gdb For more information see http sources redhat com gdb Note while make gcc and gdb are the examples used in the documentation virtually any similar set of tools or utilities could be used The CDT opens as the C C perspective of the Eclipse workbench The C C perspective consists of an editor and the following views C C Projects Shows your C C projects and files It operates in much the same way as the Navigator Console Displays your program s output as well as the output from your build and external tool chain Editor The C C editor view provides specialized features for editing C C related files Make Targets Enables you to select the make targets you want to build in your workspace Navigator Shows all of the file system s files under your workspace directory Outline Displays the structure of the file cur
176. lack upside down triangle icon to open a menu of items specific to the Navigator view c Select Working Set Opens the Select Working Set dialog to allow selecting a working set for the Navigator view Deselect Working Set Deselects the current working set Edit Active Working Set Opens the Edit Working Set dialog to allow changing the current working set Sort This command sorts the resources in the Navigator view according to the selected schema o By Name Resources are sorted alphabetically according to the full name of the resource e g A TXT then B DOC then C HTML etc o By Type Resources are sorted alphabetically by file type extension e g all DOC files then all HTML files then all TXT files etc Filters This command allows you to select filters to apply to the view so that _ sss you can show or hide various resources as needed File types selected in the list will not be shown in the Navigator Link with Editor See the toolbar item description above C C Projects view icons The table below lists the icons displayed in the C C Projects view Field private e Field protected Field public Include Lu e a al ca ka EE EX Lu E m Type definition Related concepts Project file views Related tasks Displaying C C file components in the C C Projects view Hiding files by type in the C C Projects view amp C
177. lated tasks Displaying C C file components in the C C Projects view Related reference Views Copyright IBM Corporation and others 2000 2004 Make Targets view Enables you to select the make targets you want to build in your workspace Outline argets Ei Hellow arld lcon Command Description te Home Move to the top level lt n Back Navigates back to a previous level Forward Navigates forward to the next level 8 Build Target Builds currently selected target ie Copyright Red Hat 2003 2004 Copyright IBM Corporation and others 2000 2004 Editor view The C C editor provides specialized features for editing C C related files G main cpp X 9 makefile Hinclude lt iostream gt al Hinclude lt string gt using namespace std int maini 1 string yourName cout lt lt Enter your name cin gt gt yvourHMame cout lt lt Hello yourName lt lt endl return 0 Associated with the editor is C C specific Outline view which shows the structure of the active C or makefile It is updated as you edit these files The editor includes the following features e Syntax highlighting e Content code assist e Integrated debugging features The most common way to invoke the C C editor is to open a file from the Navigator or the C C Project views using pop up menus or by clicking the file single or double click depending on the user
178. ld a project Related concepts Build overview Related tasks Defining build settings Building Related reference Make Builder page C C Properties window amp Copyright IBM Corporation and others 2000 2004 Creating a Make Target To create a make target 1 Right click on the project and select Create Make Target H Mew E Into ef Open in New window H Build Make Target awe T Create Make Target Build Project Rebuild Project 2 Enter the Target name and build options and click Create Create anew Make target Target Name EI Make Target Make Target Build command v Lise default Build command make Build Setting on first build error Iv Run all project builders ce 3 The make target will appear in the Make Targets view e Make Targets X Related concepts Build overview Related tasks Defining Build Settings Building Related reference Create a Make Target Make Target View amp Copyright IBM Corporation and others 2000 2004 Customizing the Console view The Console view displays the output of the utilities invoked when building a project or the programs output when running debugging To set Console view preferences 1 Click Window gt Preferences 2 Expand C C and click Build Console iol xj Build Console E Workbench E Ant Build Order v Alway
179. lder structure is displayed in the C C Projects view Again you should identify an appropriate root folder to import from Tip e Importing your existing file system can consume significant disk space depending on the size of your files e Your files may become detached from an existing source control system that previously referenced the original file location such as a ClearCase view Related concepts Overview of the CDT CDT Projects Related tasks Working with C C project files Related reference Project properties Copyright IBM Corporation and others 2000 2004 Updating the CDT The CDT can be updated directly from the workbench using your internet connection 1 Click Help gt Software Updates gt Find and Install File Edit Navigate Search Run Project Window Help lon O CR EN 3s Welcome EOS Help Contents Tips and Tricks Cheat Sheets Software Updates 3 Find and Install About Eclipse Platform 2 Manage Configuration 2 In the Feature Updates window select Search for new features to install and click Next E Instal kl Feature Updates Choose the way you want to search For Features to install ei C Search for updates of the currently installed Features Search for new Features to install Back Finish 3 If you have not updated previously you will have to enter the location of the CDT Install site Click the Add Up
180. leted do not exist yet or anymore Copyright IBM Corporation and others 2000 7004 Navigation Aids This section provides information on navigating through the C C Perspective Outline View Project File views Make Targets View C C search Open declarations Open Type Class Browser Copyright IBM Corporation and others 2000 7004 Outline view The Outline view displays an outline of a structured C C file that is currently open in the editor area by listing the structural elements Class circle public shape2d 18 LF ss 9 private 884 shape2d h double size EQ circle string color size double public Constructors Destructors circle t virtual circle color string circle e circle setSize double void getSize double setColor string void getColor string area double print void set void Methods void setSize double s size lt 0 0 8 3 double 4 return size void setColor string c color c string dgetColor return color double return pow size 2 void print i cout lt lt Circle lt lt n tRadius lt lt cv b The Outline view shows the following elements in the source file in the order in which they occur Class Namespace Include Enum Enumerator Field private Field protected Field public Include Method private Method protected Method public
181. lipse Tools CDT newsgroup License The CDT is an open source project and is licensed under the Common Public License Related concepts Working with existing code What s new Related reference Views Copyright IBM Corporation and others 2000 2004 CDT projects Before you can work in the CDT you must create a project to store your source code makefiles binaries and related files C C projects are displayed in the C C Projects view Tip Nested projects are not supported Each project must be organized as a discrete entity Project dependencies are supported by allowing a project to reference other projects that reside in your workspace For more information see Selecting referenced projects For more information about projects and where they are stored see e Workbench User Guide gt Tasks gt Resources e Workbench User Guide gt Tasks gt Running Eclipse Project types You can create a standard make C or C project or a managed make C or C project Standard make C or C project You need to create a makefile in order to build your project or use an existing makefile Managed make C or C project A managed make project generates the makefile for you automatically In addition the files module dep and module mk are created for every project sub directory These files are required for your managed make projects to build successfully Project conversion You can convert projects from C to C or from C
182. ll path to files and directories Automatically refresh registers Select this checkbox to refresh registers before debugging Automatically refresh shared libraries Select this checkbox to refresh links to shared libraries before debugging Default variable format Select the default variable format from either Natural Decimal or Hexidecimal Default expression format Select the default expression format from either Natural Decimal or Hexidecimal Default register format Default expression Format Natural Default register Format Natural Select the default register format from either Natural Decimal or Hexidecimal Maximum number of instructions Enter the maximum number of disassembly instruction in the field provided amp Copyright IBM Corporation and others 2000 2004 Debug GDB MI page Preferences window You can manipulate certain GDB timeout settings Window gt Preferences gt C C gt Debug gt GDB MI iol x E Workbench E Ant ow Build Order General settings For SDB MI E C C Build Console Communication Debugger timeout ims 10000 Launch timeout tms 30000 File Types Make Targets ha New Make Projects Search Help Install Lipdate Java Plug in Development RunjDebug Team Restore Defaults Apply Import Export Cancel Debugger timeout ms Sets the timout value for the debugger Launch timeout ms Sets the Lau
183. llation For other operating systems please refer to your installation documentation Build terminology The CDT uses a number of terms to describe the scope of the build Build Project This is an incremental build make all assuming all is defined in your makefile Only the components affected by modified files in that particular project are built Rebuild Project Builds every file in the project whether or not a file has been modified since the last build A rebuild is a clean followed by a build For more information on builds see e Workbench User Guide gt Concepts gt Workbench gt Builds e Workbench User Guide gt Tasks gt Building resources Build related information is displayed as follows e The Console view displays the output of the build tools e The Tasks view displays a list of compiler errors and warnings related to your projects e Makefile targets are displayed in the Make Targets view For more information about the Tasks view see Workbench User Guide gt Reference gt User interface information gt Views and editors gt Tasks view Getting a makefile You can either create a C C project for which you supply the makefile or create a C C project for which the CDT generates makefiles automatically To create a new project from the menu bar choose File gt New gt Project In the dialog that appears e To create a project for which you supply the makefile select either Standard Make C project
184. m GDB to display the current state of the program being debugged Tip Editing the source after compiling causes the line numbering to be out of step because the debug information is tied directly to the source Similarly debugging optimized binaries can also cause unexpected jumps in the execution trace Related concepts Overview of the CDT Debug information Related tasks Debugging Related reference Run and Debug dialog box Copyright Corporation and others 2000 2004 Debug information The Debug perspective lets you manage the debugging or running of a program in the Workbench You can control the execution of your program by setting breakpoints suspending launched programs stepping through your code and examining the contents of variables The Debug perspective displays the following information e The stack frame for the suspended threads for each target that you are debugging e Each thread in your program represented as a node in the tree e The process for each program that you are running The Debug perspective also drives the C C Editor As you step through your program the C C Editor highlights the location of the execution pointer Variables You can view information about the variables in a selected stack frame in the Variables view When execution stops the changed values are by default highlighted in red Like the other debug related views the Variables view does not refresh as you run your exe
185. managed in CVS you can use the CVS Repository perspective to Checkout As any folder in the repository The first time you Checkout As the New Project wizard is launched and you need to create a C or C project for the folder For more information see Creating a project and Working with C C project files A CVS checkout of the project into the project s location occurs It is recommended that you eventually add and commit the CDT project files back into CVS The CDT project files include project cdtproject and cdtbuild for Managed Build projects and are located at the root folder of each CDT project Create new projects from existing source roots If your resource code is not managed in CVS but is available from the file system then you need to perform two steps 1 Identify a root folder of your source code tree 2 Create a new C C project using the New Project Wizard and specify the root folder as a non default location of the new project Typically existing projects will have their own makefiles so you should create a new Standard Make C C project For more information see Creating a project and Working with C C project files To help you to identify a root folder for your project consider the following guidelines e all source code for the project is available on or beneath the root folder e the build results are also produced in or beneath the root folder e there is often a makefile in the root fold
186. mount of time Content Assist is permitted to parse proposals enter the value for Content Assist parsing timeout in the text box area Enable Auto activation of content assist for gt or triggers by selecting the appropriate checkboxes To change the delay before Content Assist is automatically invoked for the triggers shown above enter the new delay in the Auto activation delay text box area To change the background color of the Content Assist dialog box click the color palette button To change the foreground color of the Content Assist dialog box click the color palette button 5 Click OK Related concepts Content Assist Related tasks Creating and editing code templates Importing and exporting code templates Related reference Content Assist page Preferences window Code Templates page Copyright IBM Corporation and others 2000 2004 Creating and editing code templates Content Assist uses code templates enable you to use commonly used code snippets quickly To create a code template 1 Click Window gt Preferences 2 Expand and click Code Templates 3 Click New New Template Ioj x Context c Global Description Pattern Insert Variable 4 Do the following if required o Inthe Name field enter a template name Select Structure Global or Function for either C or C from the Context drop down list
187. mp Copyright IBM Corporation and others 2000 2004 C C Views and Editors This section describes views and editors of the C C perspective Selecting Views and Editors C C Projects view Navigator view Outline view Make Targets view Editor view Console view Problems view Properties view Search view Debug views Registers view Memory view Memory view preferences Shared libraries view Signals view Debug view Debug preferences C C Icons amp Copyright IBM Corporation and others 2000 2004 Selecting Views and Editors To see a list of all views from the menu bar choose Window gt Show View gt Others be Us Navigator Outline PU i Prablems Lc Progress E Properties Search 4 Simple Search Projects gt Cheat Sheets m CYS E Debug gt Java gt Java Browsing m Make Make Taraets 2 ca The following views comprise the C C Projects View Basic views Console Displays the application s output Navigator Displays the file system under the launchdir workspace directory Outline Displays the functions and header files in your source files Open a source file in an editor to view its outline Problems Displays problems Properties Displays the name path size permissions and last modified date of the resource highlighted in the Navigator view Search Displays the results of file or text searches C views C C Projects Displays y
188. mport Click OK The code template list is updated to include the template that you imported To export a code template 1 Click Window gt Preferences 2 Expand C C and click Code Templates 3 Select the templates that you want to export and click the Export or Export All button The Exporting x dialog opens where x is the number of code templates that you are exporting 4 In File name box type the path where you want your code templates file to be saved 5 Click Save The templates xml file containing the code templates you exported is saved in your file system Related concepts Content Assist Related tasks Using Content Assist Creating and editing code templates Related reference Code Templates page Preferences window Code Templates page Copyright IBM Corporation and others 2000 2004 Shifting lines of code to the right or left You can shift lines of code to the left or right in the C C editor You can change the tab width in the C C editor preferences window For more information see Customizing the C C editor To shift lines of code to the right or left 1 In the C C editor select the full length of the lines that you want to shift 2 Do one of the following o To move the text to the right press Tab o To move the text to the right click Edit gt Shift Right o To move the text to the left press Shift Tab o To move the text to the left click E
189. n about the Navigator view toolbar and icons see Workbench User Guide gt Concepts gt Views gt Navigator View For information about the pop up menu in the Navigator view see Workbench User Guide gt Reference gt User interface information gt Views and Editors gt Navigator View For information about the Working Sets see Workbench User Guide gt Concepts gt Workbench gt Working sets Related concepts CDT Projects Working with existing code Related tasks Creating a project Working with C C project files Related reference C C perspective icons Copyright IBM Corporation and others 2000 7004 Open declaration You can select an element name in your code and quickly navigate to its declaration Square exl exi pr Lindo Revert File Cut Crit Copy Paste Chrl Shift Right Shift Left Comment Chri Uncomment Chri Content Assist Chri Space Edd Include ohrl Shift hd Show in Projects Refactor r Open Declaration Search For Rum Ta Line Be Resume At Line 17 Add Expression Save Open declaration will attempt to navigate to the exact declaration of the selected element Open declaration requires your file to have the proper include paths set up to the declaration If for any reason open declaration cannot find the declaration it will display the following message in the status line The operation is unavailable an the current select
190. nces window x Workbench Editor Ant Build Order C C Editor Preferences c General Colors c Content Assist Hovers c Navigation Build Console Code Templates Displayed tab width 4 Debug Print margin column 60 GDB MI Source Code Locations Show overview ruler Editor Show line numbers Types Highlight matching brackets Make Targets New Make Projects Highlight current line Search show print margin Help Insert space for tabs Install Update 4 Java Use custom caret Plug in Development v Enable thick caret Run Debug Team Appearance color options Line number foreground Matching bracket highlight Current line highlight Print margin HyperLink Selection foreground Cale ae mes ms oom Restore Defaults i Import Export OK Displayed tab width Specifies the width of the tab as a number of characters For example a value of 4 means that the tab width is 4 characters wide Print margin column Specifies the width of the print margin as a number of characters For example a value of 80 means that the print area is 80 characters wide Show overview ruler Displays the vertical ruler in the editor view Show line numbers Displays line numbers in the left margin Highlight matching brac
191. nch timeout for a debug session amp Copyright IBM Corporation and others 2000 2004 Source Code Locations page Preferences window You can add or remove source code locations by clicking Window gt Preferences gt C C gt Debug gt Source Code Locations Bixj Source Code Locations E Workbench Ant Build Order Common source lookup settings E C C Source Locations Build Console Add 2 File Types i Make Targets REMOVE 2 Mew Make Projects Search Help Install Update Java Plug in Development Run Debug co Search For duplicate source Files Restore Defaults Apply Import Export Cancel Add Insert a new source code location Up Move the currently selected source code location higher in the list Down Move the currently selected source code location lower in the list Remove Remove the currently selected souce code location Search for duplicate source files Searches the source locations for duplicate entries Copyright IBM Corporation and others 2000 2004 C C editor preferences This section describes how to set preferences for the C C editor General preferences Color preferences Content Assist preferences Hover preferences Navigation preferences amp Copyright IBM Corporation and others 2000 2004 General preferences You can customize the appearance of the C C editor on the General page of the Prefere
192. ndard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Project Paths Libraries amp Properties for HelloWorld Ioj x C C Project Paths 29 Source lt gt output i Projects EH Libraries Path Containers Libraries on the build path Info Builders C C File Types CiC Include Paths amp Symbc CIC Indexer C C Make Project CIC Project Paths Project References Add from Workspace Add Contributed Remove Export Add External Library Add and external library Add from Workspace Add a library from a project in your workspace Add Contributed Add a contributed library Edit Edit the currently selected library Remove Remove the currently selected library Export Export the currently selected library to a text file Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project P
193. nfo required to do a search is Search string this is the name of the element you are looking for See C C search for more information on how to specify wildcard searches and how to further refine your searches by using fully qualified names Search For his is the element type that you wish to search for You can also select to search on Any Element which will perform the search on a combination of all elements this allows you to limit your search to declarations definitions or references You can also select All Occurrences which will search for declarations definitions and references that match the element Scope this allows the user to limit the scope of the search The three available scopes are Workspace this searches all of the open projects in the workspace Selected Resources this option becomes enabled whenever something is selected in one of the following views in the C C perspective e C C Projects e Navigator e Search e Outline The scope will be limited to whatever element is selected in the view Working Set working sets can be selected and created There are 3 main ways for initiating a C C search e Using the C C Search dialog e Selecting an element in the Editor view e Selecting an element in the C C Projects view or Selecting an element from the Outline view Using the C C Search dialog search eee El File Search ep CiC Search Ez Help Search Ble Java Search E Pl
194. ng Report preprocessor problems Report semantic problems Report syntactic problems Restore Defaults Apply Enable C C Indexing When selected C Indexing is enabled for this project Enable C Index problem reporting When selected any index related errors detected will be reported Restore Defaults Returns any changes back to their default setting Apply Applies any changes Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Error Parser C Project Properties Managed Project References
195. not available you can find the instructions for adding it here C C main cpp Eclipse Platform File Edit Navigate Search Run Project Window Help Mew d Project Class Open External File Open Workspace S lose EM Convert to Make Project Close All Ctrl Shift F4 7 Polder File EN Save Chi s 5 Save As F5 Other Ctrl From the Convert to C C Make Project Wizard select the project you want to convert and click Finish amp Convert C C Projects Convert to C C Make project Convert a project to a project which uses make to build it e Candidates For conversion Select All 7 i oldProject Deselect All EM vest Convert to C or C Project fe C Project Note You may need to manually enable Path Discovery for CDT 1 x Standard Make projects depending on how your CDT project was configured See Set Discovery Options for details Related tasks Adding Convert to a C C Make Project to the New menu Set Discovery Options Copyright IBM Corporation and others 2000 2004 Adding Convert to a C C Make Project to the New menu If Convert to a C C Make Project is not available in your menubar you can add it by clicking Window gt Customize Perspective C C main cpp Eclipse Platform File Edit Navigate Search Run Project Window amp SB y A __
196. nt variables and values to use when an application runs see Setting environment variables e To select a debugger to use when debugging an application see Selecting a debugger e To specify the location of source files used when debugging a C or C application see Specifying the location of source files e specify where the run configuration is stored how you access it and what perspective to open when running an application see Specifying the location of the run configuration To use a debug configuration You can reuse a previously created debug launch configuration to debug your program 1 Click Run Debug 2 In the Debug dialog box select a debug configuration from the Configurations list 3 Click Debug Related concepts Debug overview Debug information Related tasks Debugging Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Working with breakpoints and watchpoints This section explains how to work with breakpoints and watchpoints Adding breakpoints Adding watchpoints Removing breakpoints and watchpoints Enabling and disabling breakpoints and watchpoints Copyright IBM Corporation and others 2000 7004 Adding breakpoints A breakpoint is set on an executable line of a program If the breakpoint is enabled when you debug the execution suspends before that line of code executes To add a breakpoint point double click the marker ba
197. o function properly Things like the indexing service search or code assist will only function correctly if the built in parser can retrieve information about the paths to search for include files and the preprocessor symbols defined for the project The build model only promises to store the type and value of an option it does not know anything about the contents However you can flag certain options as special so the build model will know to pay special attention to them As the implementer of the tool chain you should make sure your specification has options of type includePaths and definedSymbols The build model will pay special attention to these options and answer them to the appropriate clients in the CDT core without any further intervention on your part 5 9 3 Built in Symbols and Search Paths Every compiler relies on having a correct set of preprocessor symbols and header file search paths to perform proper builds Even compiler from the same vendor may use different symbols and search paths when building for different operating systems Some of these values may be defined by the user but others will be built into the tools themselves so the user will be unaware of them Unfortunately the CDT parser needs to know about the entire set to properly parse source files There are two approaches you can take but both involve pre populating the include path and defined symbol options with list option values containing the correct informati
198. ode templates You can import and export code templates Note A code template must be an xml file formatted as follows lt xml version 1 0 encoding UTF 8 gt lt templates gt lt template name author description author name context C enabled true gt author user lt template gt lt templates gt igixi E Workbench Templates E Ant Build Order Create edit or remove templates a C C Name contet Description Al 1 Templates catch C Fu catch block E De pat class C Glo class declaration Remove Source Code Locations comment C Global default multiline comment Editor do C Function do while statement Import File Types else C Function else block E3 elseif C Function else if block Export Make Targets New Make Projects Ba for C Function For loop tal Search 82 for C Function For loop with temporary variable Export Al Help if C Function if statement Install Update ED ifelse Function else statement Enable All Java main C Global main method Disable All Plug in Development Previo Run Debug Team E Restore Defaults Apply Import Export To import a code template Click Window gt Preferences Expand C C and click Code Templates Click Import Select the template file that you want to i
199. og that moves the focus to the line you specify The dialog also indicates the total number of lines in the console buffer Terminate Terminates the process that is currently associated with the console Console View Toolbar Icon Command Description m bu the process that is currently associated with the console r Remove all Terminated Launches Removes all terminated launches that are associated with the console BE Scroll Lock Toggles the Scroll Lock a Clear Console Clears the console zl Pin Console Forces the Console view to remain on top of other views in the window area EJ Display Selected Console If multiple consoles are open you can select the one to display from a list MinimizeConsole Minimizes the Console view ee Maximizes the Console view Copyright Red Hat 2003 2004 Copyright IEM Corporation and others 2000 2004 Problems view If you encounter any errors during a build they will be displayed in the Problems view HR Problems X Properties Console main o Error 1 HelloWorld error yourName undeclared first use this Function main cpp Helloworld 0 error Each undeclared identifier is reported only once For each main cpp Helloworld en Errors are passed up from your C compiler The Problems view lists the error filename and folder If you select an error the associated file will open in the C C Editor view and the cu
200. oject Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Binary Parser You can select the Binary Parsers you require for the project To ensure the accuracy of the C C Projects view and the ability to successfully run and debug your programs After you select the correct parser for your development environment and build your project you can view the symbols of the o file in the C C Projects view Properties for HelloWorld a E E Info C C Make Project Builders C C File Types Set required binary parser for this project C C Include Paths amp Symbc C C Indexer C C Make Project C C Project Paths Binary Parser Make Builder Error Parsers Binary Parser Discovery Options Project References PE Windows Parser Up Parser GNU Elf Parser Down Cygwin PE Parser r Binary Parser Options Restore Defaults Apply coc Binary Parser Select a binary parser from the list Binary Parser Options If a binary parser has parser options you can define them in this section Restore Defaults Returns any changes back to their default setting Apply Applies any changes Related concepts Build overview Related tasks Selecting a binary parser Related reference C Project Propert
201. on Debugger Selects debugger from the list Run program in debugger Runs the program in debug mode Attach to running process Prompts you to select a process from a list at run time Stop at main on startup Stops program at main Enable variable bookkeeping Updates variables in the Variables view Individual variables can be updated manually in the Variables view Related concepts Debug overview Debug information Related tasks Running and debugging Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 7004 Source page Run or Debug dialog box The Source page of the Run dialog box and the Debug dialog box lets you specify the location of source files used when debugging a C or C application By default this information is taken from the build path of your project Generic Source Locations Displays the location of the project selected in the C C Projects view and in any referenced projects Additional Source Locations Lists projects and directories added to the debugger search list Select All Selects all items in the Generic Source Locations list Deselect All Deselects all items in the Generic Source Locations list Add Adds new projects and directories to the debugger search list Up Moves selected items up the Additional Source Locations list Down Moves selected items down the Additional Source Locations list Remove Removes selected items from the Additional S
202. on If you add a value to the include path or symbol option it will be displayed to the user by default This may be the right approach to take if you believe that users will change these values frequently However it will clutter the UI with values and since they are editable users may delete them accidentally The alternative is to flag the list option value as a built in value In this case the user will not be able to edit the values through the UI This has the advantage of keeping the UI cleaner but the only way for the user to edit these values if something changes is to directly edit the plug in manifest where the extension is specified The CDT team is currently developing a mechanism to specify this information in an extensible way In the current release however we are relying on the implementers of a tool chain to supply the default symbols and paths in their specification Please refer to section 2 9 for more details on specifying list option values 5 9 4 User Specified Libraries and Object Modules Similarly a user may want to specify external libraries to link against in the final build step The build model needs to be told to pay special attention to an option containing libraries so that when the makefile generator requests them it can answer a valid list Flag the option value type as libs for external libraries or userObjs for object modules 5 9 5 Target Hierarchies One area of the build model that the tutorial
203. ons C C Menubar File Menu actions Edit Menu actions Navigate Menu actions Search Menu actions Project Menu actions Run Menu actions Window Menu actions C C Toolbar C C Open Type Create a Make Target C C Find Replace C C preferences Build Console preferences Code Templates preferences Debug preferences GDB MI preferences Source Code Locations preferences C C Editor preferences General preferences Color preferences Content Assist preferences Hover preferences Navigation preferences File Types preferences Make Targets preferences New Make Projects properties preferences Make Builder preferences Error Parser preferences Binary Parser preferences Discovery Options preferences Search preferences C C Project Properties Managed Make Projects Info Builders Build File Types Indexer Error Parser Binary Parser Project References Standard Make Projects Info Builders File Types Include Paths and Symbols Indexer Make Project Make Builder Error Parser Binary Parser Discovery Options Project Paths Source Output Projects Libraries Path Containers Project References C C New Project Wizard Managed Make Projects Name Select a Target Referenced Projects Error Parsers C C Indexer Standard Make Projects Name Referenced Projects Make Builder Error Parsers Binary Parser Discovery Options C C Indexer C C Run and Debug Main Arguments Environment Debugger Source Common C C search a
204. operties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Project Paths This section describes C C Project Path Properties of a Standard make project Source Output Projects Libraries Path Containers Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Project Paths Source amp Properties for HelloWorld Ioj C C Project Paths Source o Output Ira Projects E Libraries Path Containers Source Folders on build path Add Folder Edit Remove p Info Builders C C File Types CIC Include Paths amp Symbc C C Indexer CIC Make Project C C Project Paths
205. opyright Red Hat 2003 2004 Copyright IBM Corporation and others 2000 2004 Navigator view This view provides a hierarchical view of the resources in the Workbench Mavigator X CiC Projects E edtprajeck E project helo exe main cpp m main o makefile ee Test Toolbar Icon Name Description c MinimizeConsole Minimizes the Console view Fi Maximize Console Maximizes the Console view r Back This command displays the hierarchy that was displayed immediately prior to the current display For example if you Go Into a resource then the Back command in the resulting display returns the view to the same hierarchy from which you activated the Go nto command The hover help for this button tells you where it will take you This command is similar to the Back button in a web browser c Forward This command displays the hierarchy that was displayed immediately after the current display For example if you ve just selected the Back command then selecting the Forward command in the resulting display returns the view to the same hierarchy from which you activated the Back command The hover help for this button tells you where it will take you This command is similar to the Forward button in a web browser gg Up This command displays the hierarchy of the parent of the current highest level resource The hover help for this button tells you where it will take you
206. or Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Managed Binary Parser You can select the Binary Parsers you require for the project To ensure the accuracy of the C C Projects view and the ability to successfully run and debug your programs After you select the correct parser for your development environment and build your project you can view the symbols of the o file in the C C Projects view C Properties for HelloWorld 2 m Info Error Binary Parsers Builders C C Build Set required binary parser for this project C C File Types C C Indexer Error Parsers Binary Parser Error Binary Parsers Project References Binary Parser Cygwin PE Parser Up PE Windows Parser C EIF Parser Down C
207. or area marker bar Related concepts C C Development perspective Related tasks Working with breakpoints and watchpoints Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Enabling and disabling breakpoints and watchpoints You can temporarily disable a breakpoint or watchpoint without losing the information it contains To enable or disable breakpoints or watchpoints 1 In the Breakpoints view do one of the following o Select the breakpoints and watchpoints that you want to remove o Click Edit gt Select All o Right click and select Select All 2 In the Breakpoints view right click the highlighted breakpoints and watchpoints and click Disable or Enable Related concepts C C Development perspective Related tasks Working with breakpoints and watchpoints Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Controlling debug execution The debug execution controls are superceded by breakpoints For example if you attempt to step over a function and the program hits a breakpoint it pauses regardless of whether the function is completed You can control your debug execution in various ways but they all rely on a core set of debug controls To control a debug execution 1 In the Debug view select a thread 2 To complete the debug session click O Run gt Resume o Run gt Suspend 0 O
208. or problem markers These will place a marker on the line that has the preprocessor problem This includes Pound error Inclusion not found Definition not found Invalid macro definition Invalid directive Conditional evaluation error Semantic Problems The problem markers can also indicate semantic errors in your code The errors flagged include Name not found Invalid overload Invalid using Ambiguous lookup Invalid type Circular inheritance Invalid template Related concepts C C search C C Indexer C C Indexer Opening or Closing a project C C Indexer Progress Bar Related tasks Selection Searching for C C elements Enable Disable the C C Indexer C C Indexer Problem Reporting C C Indexer Indexer Timeout Setting Source Folders Related reference Search C C Preferences window C C search page Search dialog box C C Project Properties Managed Indexer C C Project Properties Standard Indexer Copyright IBM Corporation and others 2000 2004 C C Indexer Opening or Closing a project The user opening a previously closed project results in the entire project being re indexed Closing a project results in the index being deleted Search features will not reperot any results for closed projects Related concepts C C search C C Indexer C C Indexer Problem Reporting C C Indexer Progress Bar Related tasks Selection Searching for C C elements Enable Disable
209. or tabs Install Update 41 Java Use custom caret Plug in Development v Enable thick caret Run Debug Team Appearance color options Line number foreground Matching bracket highlight Current line highlight Print margin HyperLink Selection Foreground gt f ul ee ee ee mmm Import Export 4 On the General Page set your preferences and click Apply For a description of the General preferences click here 5 To customize the color of the text in the editable area of the C C editor click the Colors tab CT agis Editor Workbench E Ant Build Order C C Editor Preferences E Cicer General Colors Content Assist Hovers Navigation Build Console Code Templates Background Color Debug System Default var Custom Source Code Locations Editor Foreground File Types Multi line comment color Make Targets Single line comment New Make Projects keywords Bold Search Preview Help T E Install Update This is sample C code E Java Plug in Development Hinclude lt stdio h gt Run Debug unsigned static myfunc int a char b Team This comment may span multiple lines int integer 0 This comment may span only this line if integer 0 printf zero M Restore Defaults Apply Import Export 6 On the Colors page set your preferenc
210. orporation and others 2000 2004 C C Project Properties Managed Project References Properties for HelloWorld CIC Build CIC File Types CiC Indexer ErrorjBinary Parsers i Project References 9 em Project references for lt project gt Select the projects required to build this project Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Cor
211. ose Project ovo Build All Build Project Build Working Set Clean Build Automatically Create Make Target Build Make Target Properties Related concepts Build overview Related tasks Building Manually Defining Build Settings Building Related reference Make Builder page C C Properties window Copyright IBM Corporation and others 2000 2004 Autosaving on a build You can let the CDT save modified files whenever you perform a manual build The files are saved before the build is performed so that the latest version of your files is built You can view the output of the make utility in the Console view To save resources before manual builds 1 Click Window gt Preferences 2 Select Workbench from the list 5 x E Ant Build Order Always run in background Cic Build automatically Help Install Update Java M Save automatically before build Refresh workspace automatically Plug in Development Keep next previous part dialog open Run Debug Team Workspace save interval in minutes 5 Open mode Double click C Single click Select on hover Open when using arrow keys Note This preference may not take effect on all views Restore Defaults Apply Import Export Cancel 3 On the Workbench page select the Save automatically before build check box 4 Click OK The CDT will now save your resources when you bui
212. others 2000 7004 Memory view The Memory view of the Debug perspective lets you inspect and change your process memory The view consists of four tabs that let you inspect multiple sections of memory The options described below are available when you right click a memory value Auto Refresh Updates the memory address list each time execution stops Refresh Updates the memory address list Clear Clears the selected memory address Format Specifies the number system in which to display memory values Hexadecimal Signed Decimal or Unsigned Decimal Memory Unit Size Specifies the memory address size 1 byte 2 bytes 4 bytes 8 bytes Number of Columns Specifies the numbers of columns displayed in the Registers view 1 column 2 columns 4 columns 8 columns 16 columns Show ASCII Displays the selected value as ASCII Detail panel Displays the raw output from GDB for the selected variable Related concepts Debug information Related tasks Working with memory Related reference Views Copyright IBM Corporation and others 2000 2004 Memory view preferences You can change the appearance of the memory view Text Color Changes the color of the text Background Color Changes the background color Address Color Changes the color of the memory address text Changed Value color Changes the color of values Font Changes the font Padding Character Specifies the character to use for padded values Auto refresh by
213. ough a loop 1 In Variables view right click a variable and select Change Variable Value 2 Type a value To disable a variable value while debugging You can disable a variable so that the debugger does not read the variable s value from the target This is useful if the target is very sensitive or the variable is specified as volatile e In Variables view right click a variable and select Disable Related concepts C C Development perspective Related tasks Debugging Related reference Debug views Copyright IBM Corporation and athers 2000 7004 Adding expressions You can add and view expressions in the Expressions view The Expressions view is part of the Debug perspective To add an expression 1 Click Run gt Add Expression 2 Type the expression that you want to evaluate For example x 5 3 3 Click OK The expression and its value appear in the Expressions view When the execution of a program is suspended all expressions are reevaluated and changed values are highlighted Related concepts C C Development perspective Related tasks Debugging Related reference Debug views Copyright IBM Corporation and others 2000 2004 Working with registers You can modify registers in the Registers view To modify Registers 1 In the Registers view right click a register and click Change Register Value 2 Type a new value 3 Press Enter The Register value is highlighted in red
214. our current projects This is similar to the Navigator view except that o Only projects and their contents are displayed o You are able to view the building blocks of the files such as the include files and the functions Make views Make Targets Lists your projects To build a project double click on it Editor view The Editor view is not listed under Window Show View or Window Show View Others it is opened whenever an editable file is opened from the C C Projects or Navigator views Copyright Red Hat 2003 2004 Copyright IBM Corporation and others 2000 2004 C C Projects view The C C Projects view displays in a tree structure only elements relevant to C and C project files In this view you can do the following Browse the elements of C C source files Open files in the editor view Open projects in a new window Create new projects classes files or folders Manage existing files cut paste delete move or rename Restore deleted files from local history Import or Export files and projects Files that you select in the C C Projects view affect the information that is displayed in other views fs CIC Projects eM Navigator S0 E dE HelloWorld Fi lt gt Binaries ELA hella exe x amp 6 amp le Includes iostream E string maint int hella exe x86le main o x amp 8le makefile Shapes Test Toolbar Description
215. ource Common 3 Java Application Ju JUnit Project Ju JUnit Plug in Test E Run time Workbench HelloWor Browse C C Application hello exe Search Browse New Delete Apply Revert ee 5 To change the default name of the new run debug configuration see Selecting an application to run or debug Related concepts CDT Projects Project file views Related tasks Creating or editing a run configuration Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Selecting an application to run or debug You need to specify the project or program that you want to run or debug for this run configuration To select an application to run 1 In the C C Projects view select a project 2 Click Run Run or Run Debug 3 In the Configurations box expand C C Local 4 Select a run or debug configuration 5 Click the Main tab Create manage and run configurations Configurations Name Helloworld 1 36 C C Local 6 Helloworld E Java Applet 3 Java Application Ju JUnit Project Ju JUnit Plug in Test Run time Workbench Hellowor Browse Main eo Arguments Environment tS Debugger amp Source EJ Common C C Application hello exe Search Browse New Delete Apply Revert de 6 Do the following o Inthe Name box type a descriptive name for th
216. ource Locations list Related concepts Debug overview Debug information Related tasks Running and debugging Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 7004 Common page Run or Debug dialog box The Main page of the Run dialog box and the Debug dialog box lets you specify the location in which to store your run configuration and how you access it and what perspective to open when running an application Local Saves the launch configuration locally Shared Saves the launch configuration to a project in your workspace and be able to commit it to CVS Location of shared configuration Specifies the location of a launch configuration Run mode Selects a perspective to switch to when you run an application Debug mode Selects a perspective to switch to when you debug an application Run Displays Run in favorites menu Debug Displays in Debug favorites menu Related concepts Debug overview Debug information Related tasks Running and debugging Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 C C search Search EIP File Search SY C C Search Help Search HI Java Search 35 Plug in Search Search string any string any character Case sensitive Search For J Class Struct Function variable union Method Field Enumeration Enumerator Namespace Any Elemen
217. out the include paths and defined preprocessor symbols for a given project so that it can properly parse a file The third client is the UI component of the build system that queries the build model for the tools and options defined for a project to build its display and store the user settings 1 2 3 Tool Definitions and Settings Storage A key feature of the managed build system is that it is extensible Tool integrators can use the grammar described in Section 2 to add their own tools to the build system The same grammar is used to save the settings that the user overrides through the UI between sessions 1 3 The Standard Build System There is also a standard build system supplied as part of the CDT framework that is unrelated to the managed build system The standard system provides a small set of tools to build a user s projects The user is expected to supply a makefile which includes enough information to build their project The UI allows the user to switch between targets defined in the makefile like clean or all and for the user to enter the information the parser requires The decision to use the standard or managed build system is a trade off For users with an existing project that already has a set of working makefiles or for users that prefer to write their own makefile the standard system may be perfect However many users are uncomfortable writing makefiles so the standard system may present a barrier to adoption for them
218. ow include s when producing the outline view i Source Code Locations Editor File Types Make Targets New Make Projects Restore Defaults Apply Search Import Export Cancel Link view selection to active editor Select this checkbox to open an item selected in the Projects view in the Editor view Show file members in Project View Select this checkbox to browse your C and C file members in the Projects view Follow include s when producing the outline view Select this checkbox to follow all defined includes when you produce the Outline view Note This is not recommended for large projects or large files C C Submenu Items Build Console Preferences for customize the appearance of the Build Console view Editor Preferences for customizing the C C editor Code Templates Manipulate any of the common code templates that are predefined within the CDT Debug Preferences for customizing the Debugger GDB MI Preferences for customizing the GDB MI Source Code Locations Modify add or remove source code locations Editor Set preferences for the C C editor File Types Define which file extensions are linked to specific languages Make Targets Set preferences for make target build settings New Make Projects Set preferences for customizing Make Builder settings Search Set preferences for customizing the Search configuration Related reference Views Copyright IBM Corporation an
219. pe selection dialog shows all types existing in the workspace Launches the C C Search dialog box EB Synchronize Synchronizes selected project to CVS repository Go to Last Edit Location Returns editor view to the last line edited if the file that was last edited was closed it will be re opened Back Navigates back through open files o gt Forward Navigates forward through open files r4 to Next Problem Navigates to the next problem marked during the last build attempt Go to Previous Problem Navigates to the previous problem marked during the last build attempt Copyright IBM Corporation and others 2000 2004 C C Open Type Use Open Type to open up the declaration of C C classes structures unions typedefs enumerations and namespaces Ani xl Choose type any character any string sss Visible types Iv namespace 3 cass Iv e struct Iv T typedef enum Iv union Show low level types Matching types e pair m part part e pattern T pid t E plus T pointer 9 pointer to binary Function 9 pointer Eo unary Function T pos type T pthread attr t Qualifier 9 std allocator HellowWorld std iterator Hello World std iterator traits Helloworld amp Copyright IBM Corporation and others 2000 2004 Create a Make Target You can define build settings when you create a Make Target t
220. pen Include files from the Outline View You can now perform selection searches from the C C Editor Improved Search Search now supports external files referenced using include Makefile Outline View You can now browse the structure of your Makefile in Outline View Content Assist Enhancements Content Assist now produces proposals from classes and structure members local amp global variables pre processor defines pre processor commands Content Assist now supports C What s New in 1 2 Find out what s new in CDT 1 2 C C Search You can search the projects in your workspace for references to declarations or definitions of particular elements Only header files referenced by a source file in your workspace are included in a search Build Managed build You can now create a Managed build and have makefiles generated for you Error parser The error parsers are now extension points that can contributed by other plug ins The error parsers are used to detect errors or warnings or informational messages from compilers linkers etc during a build New Global preferences for all Standard Make Project properties Make builder options Support changing enabling default make targets for each workbench build type New default build location setting Make project options You can now make changes the Error Parser Configuration You can change the order in which error parsers are applied or disable them entirely You
221. ping to errors Setting reminders Related reference Run and Debug dialog box Copyright Corporation and others 2000 2004 Setting reminders The Tasks view lets you create your own tasks In addition to having the Tasks view automatically list build errors you can set personal reminders for tasks such as unfinished functions that you write or error handling routines that you want to verify To set a reminder 1 In Tasks view right click the Tasks pane and select New Task 2 In the Description box type a new task 3 Click OK For more information on the Tasks view see e Workbench User Guide gt Concepts gt Views gt Tasks view e Workbench User Guide gt Reference gt User interface information gt Views and editors gt Tasks view Related concepts Build overview Related tasks Defining Build Settings Jumping to errors Filtering the Tasks view Related reference Run and Debug dialog box Copyright Corporation and others 2000 2004 Running and debugging projects This section explains how to run a C or C application using an existing run configuration and how to create a new run configuration Creating or editing a run debug configuration Selecting a run or debug configuration Creating a run or debug configuration Selecting an application to run or debug Specifying execution arguments Setting environment variables Defining debug settings Specifying the location of sour
222. plates Shifting lines of code to the right or left Navigating to C C declarations Refactoring Building projects Renaming a project Selecting referenced projects Defining build settings Filtering errors Selecting a binary parser Adding Include paths and symbols Selecting a deployment platform Setting build order Building Manually Removing Build Automatically Autosaving on a build Creating a make target Customizing the Console view Viewing and managing compile errors Jumping to errors Filtering the Tasks view Setting reminders Running and debugging projects Creating or editing a run debug configuration Selecting a run or debug configuration Creating a run or debug configuration Selecting an application to run or debug Specifying execution arguments Setting environment variables Defining debug settings Specifying the location of source files Specifying the location of the run configuration Debugging Debugging a program Working with breakpoints and watchpoints Adding breakpoints Adding watchpoints Removing breakpoints and watchpoints Enabling and disabling breakpoints and watchpoints Controlling debug execution Stepping into assembler functions Working with variables Adding expressions Working with registers Working with memory Searching for C C elements Selection Searching for C C elements Searching External Files Enable Disable the C C Indexer C C Indexer Problem Reporting C C Indexer Indexer Timeout Setting Sou
223. poration and others 2000 2004 C C Project Properties Standard Make Project This section describes properties for a Standard make project Info Builders File Types Include Paths and Symbols Indexer Make Project Make Builder Error Parser Binary Parser Discovery Options Project Paths Source Output Projects Libraries Path Containers Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Info amp Properties for HelloWorld Bf x Info Builders C C File Types Path iHelloworld CIC Include Paths amp Symbc Type Project C C Indexer Location C Program FilesyeclipseyworkspacelHelloworld CIC Make Project T CJC 4 Project Paths Last modified May 30 2004 7 07 42 PM Project References Default encoding For text Files Inherit from container Cp1252 C Other Restore Defaults Apply cm Info Shows project information Default encoding for text files You can specify an alternate text encoding Restore Defaults Returns any changes back to their default setting Apply Applies any changes Related reference C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C P
224. project From the resource perspective use File gt Import gt External Plug ins and Fragments 2 Continue clicking on the Next button until you get to the screen called Selection This screen will contain a list of all of the plug ins in your host workbench instance 3 Select org eclipse cdt core org eclipse cdt make ui andorg eclipse cdt managedbuilder ui from the list and then click the button Add Required Plug ins 4 Click on the Finish button Your Navigator view should contain the selected plug ins and all of the plug ins they require 5 2 Creating your Plug in Project You will need to create a project to add your tool chain definition Technically the extension can be defined in any plug in manifest but for this tutorial we will create a new empty plug in project with an empty plug in manifest file 1 2 3 4 Open the New Project wizard File gt New gt Project choose Plug in Project from the Plug in Development category and click the Next gt button On the Plug in Project Name page use org eclipse cdt example toolchain as the name for your project and click the Next gt button On the Plug in Project Structure Page you will see that the wizard has set the id to org eclipse cdt example toolchain by default We are going to be defining the tool chain in the plug in manifest file without writing any code so choose the Create a simple project radio button and click on the Finish button
225. project folder in order to avoid including a folder twice Repeat until all the folders have been added Note Don t forget to remove the project folder which appears by default otherwise everything will be indexed 4 Click OK Your view in C C projects will now change You should see your source folders designated with a C and all other source and header files icons that are in a non source folder will change to a hollow C or H Related concepts C C search C C Indexer C C Indexer Problem Reporting C C Indexer Opening or Closing a project C C Indexer Progress Bar Related tasks Selection Searching for C C elements Enable Disable the C C Indexer C C Indexer Problem Reporting C C Indexer Indexer Timeout Related reference Search C C Preferences window C C search page Search dialog box C C Project Properties Managed Indexer C C Project Properties Standard Indexer Copyright IBM Corporation and others 2000 2004 Reference This section describes the Views Windows and Dialog Boxes available from the C C perspective C C Views and Editors Selecting Views and Editors C C Projects view Navigator view Outline view Make Targets view Editor view Console view Problems view Properties view Search view Debug views Registers view Memory view Memory view preferences Shared libraries view Signals view Debug view Debug preferences C C Ic
226. r Discovery Options C C Project Paths Build command Project References IV Use default Build command make Build Setting Stop on first build error Workbench Build Behavior Workbench build type Make build target Build on resource save Auto Build all Note See Workbench automatic build preference Build Incremental Build all Rebuild Full Build clean all Clean clean Build Directory Build directory Browse Restore Defaults Apply cma Use default Select this checkbox to use the default make command Clear the check box to specify a new make command Build command If you clear the Use default checkbox type a new make command in this field Stop on first build error Stops the build when an error occurs Workbench Build Behavior These settings are what the standard builder will call by default when told to build rebuild clean etc You can change these so that new projects will use different targets if the defaults are not appropriate Build on resource save Auto Build This defines what the standard builder will call when a file is saved it is not recommended to enable Auto Build for C C projects Related concepts Build overview Related tasks Defining build settings Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project
227. r Standard Make Name Standard Make Referenced Projects Standard Make Make Builder Standard Make Error Parsers Standard Make Discovery Options Standard Make C C Indexer Copyright IBM Corporation and others 2000 2004 New Project Wizard Standard Make Discovery Options You can define the discovery options on the Discovery Options page of the C C Preferences window New project x C Make Project Create a New C Project using make to build it D Set the scanner configuration discovery options For this project i Projects Make Builder Error Parsers Binary Parser Discovery Options Indexer Automated discovery of paths and symbols v Automate discovery of paths and symbols Build output parser options Enable build output parser Make build output parser anu CIC4 Scanner Info Parser Generate scanner info command options v Enable generate scanner info command v Use default gcc E P v 4plugin state location 4specs_file anu CIC4 Compiler Specs Parser Generate scanner info command Command output parser Discovery problem reporting v Report path detection problems gt Finish Cancel Name Function A Select this checkbox to configure the scanner discovery to utomate scanner configuration discovery run automatically Build output parser options This section allows
228. r Parsers Standard Make Binary Parser Standard Make Discovery Options Standard Make C C Indexer Copyright IBM Corporation and others 2000 2004 New Project Wizard Standard Make Error Parsers You can select which error parsers to use and in which order they are used for your project amp New Project C Make Project Create a New C Project using make to build it v E Set Ehe error parsers for this project 1 Projects Make Builder Error Parsers Binary Parser Discovery Options CiC Indexer Error Parsers CDT GNU C C Error Parser p COT GNU Assembler Error Parser CDT GNU Linker Error Parser Dion CDT GNU Make Error Parser CDT Visual C Error Parser Select All Unselect All Back gt Cancel Function Error Parsers You can select which Error Parsers to enable from this window Up Moves the currently selected Error Parser higher in the ordered list Down Moves the currently selected Error Parser lower in the ordered list Select All Selects all Error Parsers Unselect Unselects all Error Parsers Related concepts CDT projects Related tasks CDT Managed Make Tutorial CDT Standard Make Tutorial Related reference New Project Wizard Managed Make Select a Target Managed Make Referenced Projects Managed Make Error Parsers Managed Make C C Indexer Standard Make Name Standard Make Referenced Projects Standard
229. r located in the left margin of the C C Editor beside the line of code where you want to add a breakpoint A dot is displayed in the marker bar and in the Breakpoints view along with the name of the associated file Hinclude lt iostream gt SHinclude lt string gt using namespace std int maint 1 string yourName cout lt lt Enter your name cin gt gt yourName for iint index O index lt 5 index i court lt lt Hello yourName lt lt endl cout lt lt endl return 0 For more information on marker bar icons see Workbench User Guide gt Reference gt User interface information gt Icons and buttons gt Editor area marker bar Related concepts C C Development perspective Related tasks Working with breakpoints and watchpoints Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Adding watchpoints A watchpoint is a special breakpoint that stops the execution of an application whenever the value of a given expression changes without specifying where this may happen Unlike breakpoints which are line specific watchpoints are associated with files They take effect whenever a specified condition is true regardless of when or where it occurred To add a watchpoint 1 Click Run gt Add C C Watchpoint 1 If Add C C Watchpoint is not listed on the Run menu select Window gt Customize Perspective 2 In the Customiz
230. rce Folders amp Copyright IBM Corporation and others 2000 2004 Creating a project You can create a standard make or managed make C or C project To create a project 1 Click File gt New gt Project E T C C Eclipse Platform File Edit Navigate Search Project Run Window Help Al shift M Project ra Glose Cr oe Class Glose All rSh EE EN Save t Folder H Save S Other Ctrl Wy Save All 2 In the New Project wizard click C 3 Choose either a Standard Make C Project or a Managed Make C Project Mew Project a X Select a wizard gt Wizards pee 2 Java Project i Plug in Project Managed Make C Project i Standard Make Project _ P Be Managed Make C Project 4 Standard Make C Project e cys 15 Java 0 Plug in Development Simple Back gt Cancel Click Next In the Name box type a name To specify a different directory in which to save your project clear the Use Default Location check box and enter the path in the Location box For managed make projects click Next to select a deployment platform For more information see Selecting a deployment platform To create your project click Finish Project Managed Make C Project Create a new Managed Make C Project WIPE Goon yy POW SE 5 9 If a message box promp
231. rences page for a given project displays every project in your workspace in the build order you specify For more information see Setting build order Projects selected in the list are built before the current project according to their dependencies The least used projects are built first To select referenced projects 1 In the C C Projects view right click a project and select Properties tf C C Projects X New Go Into Open in New Window aaa met r3 Build Make Target Create Make Target Build Project Rebuild Project oso 22 Copy i Paste XX Delete Move Rename Import Export 9 Refresh Close Project Team Compare With Restore from Local History Properties 2 Onthe left select Project References from the list 3 In the Project references list select referenced projects Properties for HelloWorld Builders C C File Types C C Include Paths amp Symbols C C Indexer C C Make Project C C Project Paths za Project References 4 Click OK Related concepts CDT Projects Project file views Related tasks Working with C C project files Related reference Project properties Copyright IBM Corporation and others 2000 2004 Project References Dt shapes Oe test Defining build settings The Make Builder page lets you e Configure how the CDT handles ma
232. rently open in an editor Problems View If you encounter any errors during a build they will be displayed in the Problems view Properties Shows the attributes of the item currently selected in a view or an editor Search Shows the results of searches for files or text Tasks Lists tasks that you want to keep track of either as a schedule of things to do or a history of things that have been done For more information see Workbench User Guide gt Concepts gt Perspectives CDT updates The Install Update wizard provides information about your current Eclipse installation and provides the framework to manage your updates For more information see Workbench User Guide gt Tasks gt Updating features with the update manager To view a list of the updates available for the toolsets that you installed click Help gt Software Updates gt New Updates Additional information For more information on the Eclipse CDT project refer to http www eclipse org cdt e CDT newsgroup The place to ask questions about how to use the CDT e User FAQ Provides answers to the most common questions about using the CDT e Developer Documentation Provides feature and design specifications for building and extending the CDT e CDT Community Webpage Showcases plug ins and tools developed by and for the CDT Community If you have tools or plug ins that you would like to submit to the CDT Community Page use the CDT Development Mailing List or the Ec
233. roject Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Builders You can select which Builders to enable for this project and in which order they are used amp Properties for HelloWorld E 0 xj Edit Info Builders oo CIC File Types Configure the builders for the project Include Paths amp Symbc lar CDT Makefile Builder New Indexer Scanner Configuration Builder CiC Make Project Import CIC Project Paths Project References Remoy 27 Down Builders Select which Builders to enable New Add a new builder Import Import a builder Edit Edit a builder Remove Remove a builder Up Move the currently selec
234. roject wizard From the Selection page choose either a managed C or C project Click the Next gt button give your project any name you wish and click Next gt again Note if the wizard does not display a next button you have probably forgotten to specify the make and clean commands You will have to add this information to the tool chain definition and restart your debugging session 4 You should now be at the Select a Target page Your new target will appear as a choice in the Platform selection widget Select it and note that the list of available configurations now contains the single configuration we defined for the target Click Finish Right click on your new project in the Navigator or C C Project view to access the context menu and select Properties to open the property browser for the project Select C C Build from the choices and note that the tool we defined appears in the list At this point you have no doubt noticed that the property page does not have any way to edit the settings for the tool That is because we have not defined any options yet It is time to edit the tool chain definition again 5 8 Adding Tool Options Users expect to be able to change the settings for their build tools through the property page for a project What they see is controlled by the way options are defined in the tool chain specification We will create an option category and then add two example options to it Switch back to
235. roperties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Project Paths Path Containers amp Properties for HelloWorld Bl x C C Project Paths e Source o Output i Projects Libraries Path Containers Containers Info Builders C C File Types C C Include Paths amp Symbols oo Indexer CIC Make Project 51 0 Discovered Paths Add EE Paths EH Includes 0 ecygwinlusrtincludelc4 43 3 11686 pc cygwin EL NN i ciicygwin usr include c 3 3 1 backward Remove ccygwinlibYgcc liblieS6 pc cyqwinl3 3 1 include
236. ror Parsers Binary Parser Discovery Options C C Make Project C C Project Paths Automated discovery of paths and symbols Project References v Automate discovery of paths and symbols Build output parser options v Enable build output parser Make build output parser anu C C Scanner Info Parser r Generate scanner info command options Enable generate scanner info command use default Generate scanner info command acc E P v iplugin_state_location specs_file Command output parser cuu C C Compiler Specs Parser Discovery problem reporting Report path detection problems Restore Defaults Apply cma Automate scanner configuration discovery Select this checkbox to configure the automatic discovery of paths and symbols Build output parser options Monitors the output of the build to automatically keep the list of include paths and symbols up to date with the makefile Generate scanner info command options This section allows you to select the scanner info settings Restore Defaults Returns any changes back to their default setting Apply Applies any changes Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Pr
237. rs 2000 2004 Specifying the location of source files You can specify the location of source files used when debugging a C or C application By default this information is taken from the build path of your project To specify the location of source files In the C C Projects view select a project Click Run Run or Run Debug In the Configurations box expand C C Local Select a run or debug configuration Click the Source tab The Generic Source Locations list shows the location of the project selected in the C C Projects view and any referenced projects To add an existing source locations o Click Add to be prompted to select a process from a list at run time o In the Add Source Location dialog box select a location type o Click Next o Doone of the following a Select an existing project in your workspace Click Finish a Specify a location in your file system Click Finish You can change the order of source locations are used by selecting a location and clicking the Up or Down buttons You can remove a source location by selecting the location and clicking the Remove button To search for duplications in your source locations select the Search for duplicate source files checkbox Click Run or do the following as required o To specify the execution arguments that an application uses and the working directory for a run configuration see Specifying execution ar
238. rser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard Include Paths and Symbols You can modify the list of included paths and preprocessor symbols and change the order in which they are referenced Properties for HelloWorld 4 Bf x Info C C Include Paths amp Symbols Builders C C File Types Include Paths and Preprocessor Symbols C C Include Paths amp Symbc us Add FolderjFile C C Indexer C C Make Project C C Project Paths Add Preprocessor Symbol Project References Add External Include Path Add Include Path From Workspace Add Contributed Edit Remove Export Show Inherited Paths M Add Folder File Add a new file or fol
239. rsor will display the line where the error was encountered amp C C main cpp Eclipse Platform cmi xj File Edit Navigate Search Project Run Window Help 5 9 wow M loGc H A BS 6 GO cicer in DZ Outline 23N Make Ta 5 2 Jw L include lt iostream gt o 3 85 HelloWorld ee lt string gt Doi iostream Bg ren using namespace std H ME string Y iostream g int main int A makefile string yourNam cout lt lt Enter your name yourName cout lt lt Hello yourName lt lt endl return 0 oil Problems 3 items main o Error 1 _ HelloWorld 0 error yourName undeclared First use this Function main cpp Helloworld 6 error Each undeclared identifier is reported only once for each main cpp Helloworld al main o Error 1 Problems view Toolbar Icon Command Description Delete Deletes the selected error from the Problems view x 7 Filters Lauches the Filter dialog box to filter the errors in the problems view w Select the Sort or Filters help navigate through errors in the Problems view c Minimize Minimizes the Problems view Maximize Maximizes the Problems view Copyright IBM Corporation and others 2000 2004 Properties view The properties view displays property names and values for a selected item such as a resourc
240. rules for building sources it contributes sourcel o ROOT sourcel cpp I I IC eclipse runtime workspace Project headers 03 qsctabs Wall c o 0 F lt The fragment contributes one file class1 cpp and a rule to build all source files with the cpp extension The content of the dependency and command lines is derived from the build settings model For the dependency line the makefile generator asks the build model if there are any tools that build files with a particular extension If so the tool is asked for the extension of the output For the command line the tool that builds for the extension supplies the actual command while the options for the tool supply the arguments to pass to it 4 3 Dependency Makefile Fragments There is one final piece to the puzzle and that is a list of dependencies for each source file in the build Recall that make will rebuild any file that is out of date in its dependency graph but it only adds the dependency to the graph if it is explicitly told to do so Thus it is the responsibility of the makefile generator to completely describe all dependencies for make Consider the dependencies of the final build target to Class as shown in the graph above We can see that make will need to rebuild Classl olifClassl cpp Classl horClass2 h changes In the makefile fragment we have only defined a dependency between files with an o and a cpp extension The makefile generator places t
241. s selected projects Build All Builds all projects in the workspace This is a full build all Ctrl B are built Build Project Builds the currently selected project This is a full build all files in the project are built Clean Invokes the make clean defined in the makefile When checked the CDT will perform a build whenever a file in Build Automatically project is saved You should turn this feature off for very large projects Create Make Target a target in the Make Targets view Standard Make a specific make target defined in your makefile such as Build Make Target make clean or make install Standard Make only Displays the Properties dialog From that dialog you can display the properties of resources in Info External Tools Builders C C Build managed only File Types Indexer options C C Make Project standard only C C Project Paths standard only Include Paths and Symbols standard only and Project References Properties Related concepts C C compiler Related tasks Building a program amp Copyright IBM Corporation and others 2000 2004 Run Menu actions F C C main cpp Eclipse Platform File Edit Wavigate Search Project Run Window Help land e e A Run Last Launched Ctrl Fi1 Se Debug Last Launched Fil Run History Run s Run Debug History d Debug As k Debug External Tools Name
242. s Select C C Make Project from the list 2 Click the Error Parsers tab 3 In the Error parsers list select error parsers 4 Click OK Related concepts CDT Projects Project file views Related reference Error Parsers C C Properties window Copyright IBM Corporation and others 2000 7004 Selecting a binary parser Selecting the correct binary parser is important to ensure the accuracy of the C C Projects view and the ability to successfully run and debug your programs Windows users should select the PE Windows Parser UNIX and Linux users should select the Elf Parser When you select the correct parser for your development environment and build your project you can view the components of the o file in the C C Projects view and view the contents of the o file in the C C editor You can also easily browse for the executable when defining run debug configurations You can define the properties on a per project basis from the New Project wizard in the C C Projects view or in the Navigator view You can also define project properties in the Preferences window for future standard make projects To select a binary parser 1 To set properties for future Standard Make projects click Window gt Preferences Expand C C click New Make Projects 2 Click the Binary Parser tab 1 Workbench New Make Projects Ant Build Order
243. s Managed Indexer C C Project Properties Standard Indexer Copyright IBM Corporation and others 2000 7004 Searching External Files C C search by default will only search your workspace If you wish to search external files that are included by files in your workspace but don t reside in your workspace you must enable external search markers When a match in an external file is now found it will be linked into your project and you will be able to open the match from the search pane as usual When a project is closed or the workbench is shutdown the links are removed Related concepts C C search Related tasks Searching External Files Related reference Search C C Preferences window C C search page Search dialog box Copyright Corporation and others 2000 2004 Tasks Task topics provide step by step procedural instructions to help you perform required tasks Creating a project Working with C C project files Displaying C C file components in the C C Projects view Converting a C or C nature for a project Creating a C C file Creating a makefile Hiding files by type in the C C Projects view Converting CDT 1 x Projects Adding Convert to a C C Make Project to the New menu Set Discovery Options Writing code Customizing the C C editor Commenting out code Working with Content Assist Using Content Assist Creating and editing code templates Importing and exporting code tem
244. s clear console before building E CiC Open console when building _ Console 7 Brin le to top when building jf t WEM g console to top when building presen oe Code Templates Er Debug Limit console ouput lines 500 Po uS ee GDB 2 Source Code Locations GES walr m Editar Console text color settings o cle Types Output text color gt r Make Targets T New Make Projects Information message text color a ke Search Help Error message text color lt H Install Update H Java El Plug in Development E Run Debug H Team Restore Defaults Apply t Import Export Cancel 3 To display information on the latest build only select the Always clear console before building check box 4 To open the Console view when a project is built select the Open console when building check box 5 To display the console if it is already open when a project is built select the Bring the console to top when building if present check box 6 To change the number of lines the console stores in its history enter a new value in the text field next to Limit console output lines 7 To change the number of spaces displayed by a tab enter the number in the txt field next to Display tab width 8 Click OK Related concepts Build overview Related tasks Defining Build Settings Building Related reference Views Copyright IBM Corporation and ot
245. system that it must pay special attention to the values entered in this option There are clients of this information in the CDT that will query the build system for this information and this is currently the only way to flag these values as special lt option defaultUalue c name Compiler Flags cygmwin compiler category general walueType string id cyqwin compiler general ccflags gt lt opt ion gt Dono ENS TN Tarik le lt option name Optimisation Level category cygwin compiler category general i ouds valueType enumerated id cyqwin compiler general optimizsation lewel gt Xenumerated ptionUValue name None 00 command 00 id cygwin optimization level none gt lt enumerated0pt ionValue gt Xenumerated ptionUValue name Optimise 01 command 01 id cygwin optimization level optimize gt lt enumerated0pt ionValue gt Oh thie 777 IT e opetan lt option name Include Paths category cyqwin compiler category general command I valueType 7 includePath id cygwin compiler general include paths gt c option lt option defaultValue false name Verbose category cyquin compiler category general command vy valueType boolean id cyqwin compiler general werbose gt lt opt ion gt Figure 6 Option display Finally Verbose a Boolean option is displayed as a check
246. t Clear the Use default build order checkbox Select a project in the list Do one of the following o Click Up to move the project up the list o Click Down to move the project down the list To add projects to the build path click Add Project Select the projects to add to the build order list Click OK To remove a project from the Project build order list click Remove Project When building or rebuilding all projects the projects that have been removed from the build order are built last 10 Click Apply Related concepts Build overview Related tasks Defining build settings Building Related reference Make Builder page C C Properties window Copyright IBM Corporation and others 2000 2004 Building Manually Manual builds let you choose the scope of a build as well as options for building or rebuilding projects You can view the output of the make utility in the console Console c Build HellawWarld make k all g c g main cpp g g o hello main o Incremental Builds To incrementally build all open projects you can select Project gt Build All or type CTRL B Build Individual Projects To build individual projects click Project gt Build Project Rebuild Projects To rebuild a project right click on the project and select Rebuild Project Note This will rebuild projects that this project references as well but will not rebuild projects that references this on
247. t Limit To Declarations Definitions C References C All Occurrences Scope Workspace C Selected Resources Working Set choose Customize Cancel Search string Specifies a search string The search functions support the following wildcards e Use to represent any series of characters e Use to represent any single character e Use V to find an asterisk character Case sensitive Searches will return results which match capitalization specified in the search string precisely Search for Specify the types of elements to include in the search for Class Struct Includes classes and structs in your search Searches for global functions or functions in a namespace functions that are not members of a class struct or union Variable Searches for variables that are not members of a class struct or union Union Searches for unions Method Searches for methods that are members of a class struct or union Field Searches for fields that are members of a class struct or union Enumeration Searches for enumerations Enumerator Searches for enumerators Namespace Searches for namespaces Any Element Includes all elements in the search Limit to Specify the types of context to search Function Bescipin Declarations Limits the search to declarations Definitions Limits the search to definitions for functions methods
248. t projects Non c resource object files shared object files 3 Select the file types that you want to hide 4 Click OK The C C Projects view refreshes automatically Related concepts CDT Projects Project file views Related tasks Displaying C C file components in the C C Projects view Hiding files by type in the C C Projects view Related reference Views Copyright IBM Corporation and others 2000 2004 Converting CDT 1 x Projects There are two ways to update CDT 1 x projects to CDT 2 0 after they have been imported either restart eclipse or update them using the Convert to C C Make Project Wizard Note the project must first be imported into your workspace using File gt Import gt Existing Project into Workspace before you can update the project For more information on importing projects see Workbench gt Tasks gt Importing gt Importing Existing Projects Restart Eclipse When Eclipse starts the CDT 1 x project will be detected and you will be prompted to update the project amp Update Managed Builder Project X The project oldProject has been detected in your workspace Its build settings are stored in a Format that is longer supported Would you like Eo convert ehem now 9 Click Yes the project will be updated Convert to C C Make Project Wizard Select File gt New gt Convert to a C C Make Project If that selection is
249. t IBM Corporation and others 2000 2004 C C Indexer Indexer Timeout If the indexer gets stuck on a particular file while indexing there is a timeout watchdog which will terminate the indexing attempt after a certain period iol x E Workbench E Ant External Search Links Ee Build Console v Enable external search markers Code Templates Enable Marker Link Type Br Debug Invisible Editor i File Types Make Targets Indexer Timeout New Make Projects Timeout ms 20000 Help Install Update Java Plug in Development Run Debug Team Restore Defaults Apply Import Export Cancel This be set as follows 1 Click Windows gt Preferences gt C C gt Search 2 Enter the timeout value in milliseconds into the text field 3 Click OK Related concepts C C search C C Indexer C C Indexer Problem Reporting C C Indexer Opening or Closing a project C C Indexer Progress Bar Related tasks Selection Searching for C C elements Enable Disable the C C Indexer C C Indexer Problem Reporting Setting Source Folders Related reference Search C C Preferences window C C search page Search dialog box C C Project Properties Managed Indexer C C Project Properties Standard Indexer amp Copyright IBM Corporation and others 2000 2004 Setting Source Folders Not
250. t Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Managed File Types You can view a list of file types on the File Types page of a C C project s properties window amp Properties for HelloWorld mi Info C C File Types Builders C C Build Use workspace settings C C File Types CiC Indexer Use project settings Error Binary Parsers Project References Filename Description Language 4 asm Assembly Source File Assembly ME C Source File C Remove ALE C Source File C ae C Source File C cpp C Source File C 57 C Source File C Ar C Header File s vin C Header File C hh C Header File C hpp C Header File C hex C Header File C s Assembly Source File Assembly 16 Assembly Source File Assembly algorithm C Header File C bitset C Header File C Restore Defaults Apply Use workspace settings Select this to use the Managed workspace settings Use Project Settings Select this option to use project settings or add or remove specific file types New Add a new file type Remove Remove a listed file type Restore Defaults Returns any changes back to their default setting Apply Applies any changes Related reference C Project Properties Standard Info C Project Properti
251. ted builder higher in the list Down Move the currently selected builder lower in the list Related reference C Project Properties Standard Info C Project Properties Standard File Types C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Parser C Project Properties Standard Discovery Options C Project Properties Standard Source C Project Properties Standard Output C Project Properties Standard Projects C Project Properties Standard Libraries C Project Properties Standard Path Containers C Project Properties Standard Project References C Project Properties Managed Info C Project Properties Managed Builders C Project Properties Managed Build C Project Properties Managed File Types C Project Properties Managed Indexer C Project Properties Managed Error Parser C Project Properties Managed Project References Copyright IBM Corporation and others 2000 2004 C C Project Properties Standard File Types You can view a list of file types on the File Types page of a C C project s properties window C Properties for HelloWorld ioj Info C C File Types Builders C C File Types z C C Incl
252. the C C Indexer C C Indexer Problem Reporting C C Indexer Indexer Timeout Setting Source Folders Related reference Search C C Preferences window C C search page Search dialog box C C Project Properties Managed Indexer C C Project Properties Standard Indexer Copyright IBM Corporation and others 2000 7004 C C Indexer Progress Bar The indexer progress bar shows the progress status of the indexing jobs in the progress views The indexing jobs can be temporarily paused by pressing the stop button on the progress bar This will cause the indexer to wait until the next time the user runs a search job or makes a change to an indexed element by such actions as modifying an existing source file deleting a file creating a new file moving file and so on The indexer at this point will resume with the previously postponed indexing job before moving on to the new one If you wish to cease indexing all together you can cancel an indexing job and disable the indexer through the properties Related concepts C C search C C Indexer C C Indexer Problem Reporting C C Indexer Opening or Closing a project Related tasks Selection Searching for C C elements Enable Disable the C C Indexer C C Indexer Problem Reporting C C Indexer Indexer Timeout Setting Source Folders Related reference Search C C Preferences window C C search page Search dialog box C C Project Propertie
253. the user has not overridden the selection in the Ul the default element will be displayed If no default is specified the first element in the list is assumed to be the default and is displayed to the user 2 10 1 Schema Attribute A unique identifier for the tool that will be used by the build model name A descriptive name that will be displayed to the user in the yes UI as one of the option values to select isDefault Flags this enumerated value as the default to apply to the option if the user has not changed the setting ommand he command that the enumerated value translates to on he command line 2 10 2 Example The option below shows an enumerated option to flag the language dialect for the Gnu preprocessor option nare Source Language valueType enumerated gt lt enumeratedOptionValue name Cc rr command x c isDefault true id source language c lt fenumeratedOptionValue gt lt enumeratedOptionValue command x c gt lt fenumeratedOptionValue gt lt foption gt 3 Ul Representation In addition to controlling the way a project is built the build model also defines how the user interface will appear There are two principle ways a user interacts with the build settings model The first is at project creation time through the New Project wizards the second is through the build settings property page 3 1 New Project Wizard The new project wizard relies
254. ts gt Discovery Options project settings C C File Types Define specific files especially C headers without extensions using the C C File Types global preferences or project property Multiple Architecture Project Support Building from multiple binary formats Choose the appropriate formats using the Binary Parser project option Editor Hyperlink Naviagation Enable the editor hyperlink navigation and then you can use Ctrl click to jump to the declaration of an item on the C C editor Indexer Error Markers Enable C C indexing and indexer error reporting in the C C Indexer properties This helps identify projects missing path configuration information Rename Refactoring Support Use the Outline or the C C Editor Refactor gt Rename context menu to refactor class amp type names methods function amp member names Open Type Use Open Type to open up the declaration of C C classes structures unions typedefs enumerations and namespaces Automatic Refresh Configure the default behavior of the automatic retrieval of shared library and register information in the C C debugger Improved Managed Make You can now set the compiler command for managed projects Improved Standard Make Standard Make now parses response from Make command to populate paths and symbols Support for GNU Now supports some of the GNU extensions to the ANSI specification Improved View and Browsing Features You can now o
255. ts initialized 2 Non static fields the definition corresponds to the fields declaration e Namespace the definition of a namespace is the same as its declaration References By selecting references C C search will return all of the places the selected element is used All Occurrences Selecting All Occurrences in the Limit To section will result in a search for declarations definitions if applicable and references for whatever element or elements have been selected Any Element Selecting Any Element in the Search For section will result in a search for all of the listed elements plus macros and typedefs For more information see e Workbench User Guide Concepts Views Search view e Workbench User Guide Tasks Navigating and finding resources Related concepts C C Indexer CDT Projects Open Declarations Related tasks Searching for C C elements Navigating to C C declarations Related reference C C search page Search dialog box C C perspective icons Copyright IBM Corporation and others 2000 2004 C C Indexer The C C indexer uses the parser to create a database of your source and header files that provides the basis for C C search navigation features and parts of content assist The indexer runs on a background thread and reacts to resource change events such as C C project creation deletion Source files creation deletion File imports Source file content chan
256. ts or enumerations or for options that are not frequently set For these types of options the build model will ignore what it finds in the command attribute 2 7 1 2 Boolean Options An option of type boolean is used to specify an option that is either true or false The option will be displayed to the user as a check box The value of the option is set true by selecting the check box and false by deselecting it If true the command associated with the option will be passed to the tool when it is invoked The default value of the option will be considered when it is displayed in the Ul 2 7 1 3 Enumerated Options Enumerated options are displayed in the Ul in a drop down list box With enumerated options the option definition takes on an organizational role the important information is stored in the enumerated option values Any information specified in defaultValue is ignored since the contents of the enumerated value definitions are used to populate the selection widget The option answers the command of the selected enumerated value so any information in command is also ignored 2 7 1 4 String List Options String list options are displayed in the UI using a list control and a button bar that allows users to add remove and reorder list items Elements of the list are defined and stored in list options values as described in section 2 9 Like enumerated options lists ignore the information in the defaultValue attribute but unlike the
257. ts you to switch perspectives click Yes 10 Define your project properties For more information see Defining project properties Related concepts CDT Projects Project file views Related tasks Working with C C project files Related reference Project properties Views Copyright IBM Corporation and others 2000 2004 Working with C C project files This section explains how to create and manage project files Displaying C C file components in the C C Projects view Converting a C or C nature for a project Creating a C C file Creating a makefile Hiding files by type in the C C Projects view Converting CDT 1 x Projects Adding Convert to a C C Make Project to the New menu Set Discovery Options amp Copyright IBM Corporation and others 2000 2004 Displaying C C file components in the C C Projects view File components are displayed in the C C Projects view and in the Outline view You can display or hide all file components in the C C Projects view To display file components 1 Click Window gt Preferences 2 In the Preferences dialog box select C C from the list 10 xi El Workbench C C Ant Build Order Link view selection to active editor Show File members in Project View Build Console Follow include s when producing the outline view Code Templates H Debug GDB MI Source Code Locations Editor File Types
258. uce from a given input ommand he command that invokes the tool For example gcc for he Gnu C compiler or g for the Gnu C compiler outputFlag An optional flag for tools that allow users to specify a name no or the artifact of the tool For example the GCC compiler and linker tools typically allow the user to specify the name of the output with the o flag whereas the archiver that reates libraries does not Some tools produce files with a special prefix that must be specified For example a librarian on POSIX systems expects the output to be lib a so lib would be the prefix headerExtensions A comma separated list of file extensions that are used for header files by the tool chain 2 3 2 Example The tool shown in the example below will appear in the UI with the label Compiler It will be used to build any file in the project with a cc or cpp extension and will produce a file with an o extension When the makefile is generated a rule will be generated with the command g lt gt o lt gt lt target gt tool sources cc cpp c name Compiler outputFlag o outputs o command o headerPrefix h hpp H natureFilter ccnature id executable compiler lt optionCategory gt lt optionCategory gt option id category flags comp flags gt lt option gt lt tool gt ES lt target gt 2 4 Option Category A tool can have a large numb
259. ude Paths amp Symbc Use workspace settings C C Indexer Use project settings C C Make Project C C Project Paths Project References asm Assembly Source File Assembly He C Source File c KE C Source File C ECC C Source File C cpp C Source File C ees C Source File C at C Header File C un C Header File C hh C Header File C hpp C Header File C nes C Header File C 5 Assembly Source File Assembly 16 Assembly Source File Assembly algorithm C Header File C bitset C Header File C deque C Header File C exception Header File C fstream C Header File C functional Header File C iomanip C Header File C inc C Header File TER gt j Restore Defaults Apply cm Use workspace settings Select this to use the Standard workspace settings Use Project Settings Select this option to use project settings or add or remove specific file types New Add a new file type Remove Remove a listed file type Restore Defaults Returns any changes back to their default setting Apply Applies any changes Related reference C Project Properties Standard Info C Project Properties Standard Builders C Project Properties Standard Include Paths and Symbols C Project Properties Standard Indexer C Project Properties Standard Make Builder C Project Properties Standard Error Parser C Project Properties Standard Binary Pa
260. ug in Search Search string any string any character Case sensitive Limit To Declarations Definitions Search For v Class Struct Function variable unian Method Field Enumeration Enumerator Namespace Any Element C References C All Occurrences Scope Workspace C Selected Resources Working Set choose Customize Cancel 1 Enter the search string in the Search String field optional mark it case sensitive Note that previous search queries from the same work session are remembered and can be accessed via the drop down list Select the Search For element Select the Limit To Select the Scope Press Search oR wh Results are displayed in the Search view Selecting an element in the Editor view 1 Select the desired element in the editor 2 Right click and select All Declarations or All References and the scope you wish to search Results are displayed in the Search view Selecting an element in C C Projects or Outline View 1 Select the desired element in the tree 2 Right click and select All Declarations or All References and the scope you wish to search Results are displayed in the Search view For more information see e Workbench User Guide gt Concepts gt Views gt Search view e Workbench User Guide gt Concepts gt Workbench gt Working Set e Workbench User Guide gt Tasks gt Navigating and
261. ur project Debugging a program Working with breakpoints and watchpoints Adding breakpoints Adding watchpoints Removing breakpoints and watchpoints Enabling and disabling breakpoints and watchpoints Controlling debug execution Stepping into assembler functions Working with variables Adding expressions Working with registers Working with memory Copyright IBM Corporation and others 2000 2004 Debugging a program You must create a debug launch configuration the first time you debug your program To create a debug configuration In C C Projects view select a project Click Run gt Debug In the Debug dialog box select a debug configuration type from the Configurations list Click New In the Name box type a descriptive name for this debug configuration In the Project box type the name of the project containing the application you want to debug In the C C Application box type the name of the executable that you want to run Click the Debugger tab Select Run program in debugger Select the Stop at main on startup checkbox Click Debug odooouoonrom o The debug perspective is opened and the application window opens on top The C C editor window is repositioned in the perspective For more information e specify the execution arguments an application uses and the working directory for a run configuration see Specifying execution arguments e To set the environme
262. ute Options that define simple string values will pass the value to the tool exactly as it is defined in the attribute For Boolean options any value but the string t rue will be treated as false List options treat all the defined list option values as default and enumerated options search through the defined enumerated values for the default 2 7 3 Option Commands The values stored in the options are passed to build tools with unique flags depending on the compiler and the option For example an option defining the paths a linker should search for libraries might contain a large number of search paths but each path is passed to the linker with a L flag The command attribute is used to hold the actual flag to pass along with the option value The build model handles the value it finds associated with the command attribute differently depending on the type of value the option is managing based on the following heuristic For string options the command is ignored since the contents of the option are treated as the command For enumerated options the command associated with the selected enumerated value is used not the command defined in the option For Boolean options the command is used if the option value is set to true otherwise it is ignored For list options the command is applied to each element of the list Option Value Type Uses Default Value Uses Command UI Element Yes List and button bar boolean enumerate
263. variables and fields References Limits the search to references All Occurrences Includes declarations definitions and references in the search Scope Choose the scope of the search Workspace all elements Searches in the full workspace Working sets can be created and used from within the search dialog Related concepts Coding aids C C search Related tasks Searching for C C elements Customizing the C C editor Related reference C C editor preferences Search action Search view Copyright Red Hat 2003 2004 Copyright IBM Corporation and others 2000 2004
264. wizard on our host platform so we have to define the operating systems that the target should be visible on Locate the osList property and click it to edit the value Enter win32 if you are running the tutorial on Windows 1inux if you are running on one of the Linux distributions or solaris if you are running on a version of Solaris 5 5 Adding a Configuration We have now added a basic target definition We now want to define a default configuration Normally you would consider defining both a release and debug configuration but we want to keep this example simple so we will restrict ourselves to a single configuration 1 Right click on Example Executable in the All Extensions list From the context menu select New gt configuration Click on the new configuration to bring up its properties in the property browser 2 Click on the name property and edit the value to be Test Configuration 5 6 Adding a Tool We could now run the new project wizard and create a new managed project based on this target but before we do that let s define a tool for the target Right click on Example Executable to get the context menu and select New tool Give the tool the name Compiler Tools declare which file extensions they operate on and optionally the file extensions they produce Our imaginary compiler only works on files with a c or C extension Locate the sources property and set its contents to be a comm
265. ws Related tasks Creating or editing a run configuration Related reference Run and Debug dialog box Copyright IBM Corporation and others 2000 2004 Setting environment variables You can set the environment variables and values to use when an application runs To set environment variables 1 2 3 4 5 Create manage and run configurations In the C C Projects view select a project Click Run Run or Run Debug In the Configurations box expand C C Local Select a run or debug configuration Click the Environment tab Configurations Mame Helloworld 1 36 C C Local ze EZ Java Applet Main 69 Arguments Environment s Debugger Source Common 3 Java Application Ju JUnit JE unit Plug in Test Run time Workbench 6 Do one of the following To create a new environment variable click New o To import an environment variable click Import o To edit an existing environment variable select an item from the list and click Edit o To remove an existing environment variable select an item from the list and click Remove 7 the box 8 Type a value the Value box 9 Click Run or do the following as required o To specify the execution arguments that an application uses and to specify the working directory for a run configuration see Specifying execution arguments
266. xt as instructed in the status bar Ctrl Shift J Editor only Add Bookmark Add a bookmark to the current text selection or selected element Add Task Add a user defined task to the current text selection Alt Enter or selected element Shift ShitRight Shifts text Right Editorony text Shifts text Right Editorony Editor only Shifts text Left Editor only aa Next Problem Moves to the next problem encountered Previous Problem Navigates to the previous problem encountered Opens context assist dialog at the current cursor position to bring up Java code assist proposals and templates See the Templates preference page for available templates Window gt Preferences gt C C gt Code Templates and go to the Editor preference page Window gt Preferences gt C C gt C C Editor gt Content Assist for configuring the behaviour of content assist Incremental Find Previous Content Assist Ctrl Space Toggles line delimeters to e CRLF Windows Convert Line Delimiters to e LF UNIX MacOS X e CR Classic MacOS Toggles the encoding of the currently shown text Encoding pile 9 y Note Other Edit options are used with the JDT Refer to the Java Development User Guide for details amp Copyright IBM Corporation and others 2000 2004 Navigate Menu actions E Resource main cpp Eclipse Platform File Edit Navigate Search Pro
267. ype selection dialog shows all types existing in the workspace Open Resource This command displays a dialog that lets you select ie Ctrl Shift R any resource in the workspace to open it in an editor Show In This sub menu is used to find and select the currently selected resource in another view If an editor is active these commands are used to select the resource currently being edited in another view Ctrl Shift T Ctrl Shift W Next The next definition is based on where the focus is For example during a search this entry becomes Next Ctrl Match The previous definition is based on where the focus is For example during a search this entry becomes Ctrl Previous Match Previous Go to Last Edit Location Moves the cursor to the line that contains the last edit Ctrl Q Editor only Go to Line Open a dialog where you can specify the line number Ctrl L to which to move the cursor Editor only Back Moves the focus to the previous file Editor only the focus to the previous file Editor Moves the focus to the previous file Editor only CQ memi Returns the focus from the previous file Editor only S Note Other Navigate options are used with the JDT Refer to the Java Development User Guide for details Copyright IBM Corporation and others 2000 2004 Search Menu actions Search menu commands open the search dialog There are specialized tabs on the g
Download Pdf Manuals
Related Search
Related Contents
HK-EMS USER MANUAL Samsung Navibot Light VR10BTBATBB User Manual (Windows 7) Epson Perfection 3200 PHOTO Product Support Bulletin BPA (Bisphenol A) ELISA kit 平成24年8月31日 消費生活用製品の重大製品事故に係る AP ベアリングセパレーター 50~70mm 取扱説明書 Metz 50 AF-1 Digital Manual GRADE 150.indd the UV-60&80 Manual Copyright © All rights reserved.
Failed to retrieve file