2 messages in org.eclipse.cdt-dev[cdt-dev] Update of the CDT FAQ
FromSent OnAttachments
David DaoustFeb 11, 2004 2:01 pm 
Recoskie, ChrisFeb 12, 2004 10:49 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[cdt-dev] Update of the CDT FAQActions
From:David Daoust (ddao@ca.ibm.com)
Date:Feb 11, 2004 2:01:56 pm
List:org.eclipse.cdt-dev

As mentioned on todays' conference call -- I am updating the CDT FAQ.

I have done a first pass through it, and thought that I would send it out to the list to get some input on it.  It is NOT complete and it has some "notes to self" scattered throughout..

In particular, I am looking for additional "questions" and some help with the answers.

If you have any comments, please e-mail the group (or just me, if you prefer).

        - Dave

-- David Daoust IBM Rational Software, Ottawa, Ontario, Canada Title: cdt user FAQ

CDT FAQ frequently asked question and answers

CDT User FAQ

The following is the official CDT FAQ. This document is, very much, a
work in progress. 

Author : David Daoust Revision Date : 02/05/2004 - Version: 1.36 Change History : 1.0 - 10/07/2002 Document Creation + a whole lot of changes : 1.36 - 02/05/2004 Updated with information from newsgroups,
IBM reviewers

Table of contents:

General:

What is the CDT? How is the CDT licensed? How is the CDT Project organized? How do I find out about future releases of the CDT? What is the default configuration supported by the CDT? Which operating systems does the CDT support? Why isn't the XXX operating system supported by CDT? How do I ask questions? How do I report a bug or request a feature? What is this .log file I hear so much about? How do I update this FAQ Where do I find more information about CDT

Download & Installation:

Which CDT build should I download? How do I download and install the CDT I can't find the CDT download for XXX? How do I uninstall CDT?

C/C++ Project Creation:

Creating a simple C++ Project -- "Hello World" on a Windows Platform How do I create a new project using a directory full of existing source? How do I create a new project using CVS? How do I Import existing code into an existing project?

Editing C/C++ Projects:

I'd like to use the code assist functionality, but it doesn't seem to work
for me. I don't get anything showing up when I select CTRL+SPACE in a C/C++ source
file. Search is broken. Overview problems? Every now and then I get the message "Unable to find full path for
"c++filt"" a few hundred times. How can I add another extension to CDT so that files other than c/cpp/cc/h files are recognized as source files? My compiler needs the file extension to be "xyz", and when I open xyz files there is no syntax highlighting.

Compilers and other 3rd party tools:

I just installed Eclipse and the CDT. However, CDT does not recognize the existing toolchain [ie Visual Studio, Borland, Watcom, Cygwin, MinGW, GCC, etc]. How do I make the CDT recognize these tools? How do I add support for my toolchain via the managed build feature. Are there C++ libraries included in the CDT (or elsewhere in Eclipse)?

Building C/C++ Projects:

When do I use the standard make feature? When do I use the managed make feature? Building a simple C++ Project -- "Hello World" on a Windows Platform Can I see the raw compiler output? Where is this information placed? I get the error Whatever it is that means we cannot spawn make I keep seeing references to cygwin and mingw,  what are they for? My Compiler errors seem to be truncated or split.  What is going on? What causes the message     make (e=2): The system cannot find the file specified?

Debugging C/C++ Projects:

I'm missing some basic C/C++ debugging functionality, where is it hidden? Is it possible to see global variables? The Variables view shows only local
variables. Can I debug remote targets? Since the debugger is gdb, can I simply access the gdb console? Can I see/log all of the commands which are being driven to gdb? Why can't I see the source in the debugger? Can I debug Java and C++ at the same time? Can I set a breakpoint in a DLL? When I want to debug my "Hello World" program, I have this error : Failed Launching CDI Debugger : Error creating session: gdb: unrecognized option '-i'. Why is my executable not listed in the debug dialog? When I launch debug, I get two suspended threads and a command window that doesn't show up anything. If I do Run/Resume, I get an error message: Resume failed. Reason: Exceptions occurred attempting to resume. Details: Target request failed: Target is not responding (timed out)

What is wrong? Is there any way of using the dbx debugger from the CDT?

Miscellaneous Troubleshooting

CDT tells me that I keep running out of memory, but I have XX GB of memory. What is wrong? Whenever I build the project, the eclipse hangs (gets "stuck"). I see a process named: "c++ filt" to restart it.  Why?

Working ON the CDT

How do I get access to the CDT source code? How do I modify the CDT source code? How do I run with my changes? How do I submit the changes back to the CDT community? How do I distribute my changes to my customers? How do I generate JavaDocs? What are some areas that are not complete

General

top

What is the CDT? The CDT (C/C++ Development Tools) Project is working towards providing a fully functional C and C++ Integrated Development Environment (IDE) for the Eclipse platform.  There are a number of groups contributing to the CDT; We strongly encourage interested parties to extend our work, thereby making the Eclipse CDT project a richer set of freely available resources. We are looking for contributions from the open source community in the areas of test, development, documentation, and general users who can help us ensure that the C/C++ tools work well on all the Eclipse platforms.    Our current release function includes: C/C++ Editor (basic functionality, syntax highlighting, code completion etc.) C/C++ Debugger (APIs & Default implementation, using GDB) C/C++ Launcher (APIs & Default implementation, launches and external application) Parser Search Engine Content Assist Provider Makefile generator

Default implementations of all interfaces and extension points will be supplied for various platforms.

The CDT is fully open-source and implemented purely in java as a set of
plugins to the Eclipse platform. To learn more visit the CDT Home Page.

How is the CDT licensed? The CDT consists of software produced by the CDT team combined with third
party software developed from other Open Source Projects. The software produced by the CDT team is licensed
under the Common Public License. The software designed by third parties is made available under their respective licenses. Refer to
the about.html file in the root directory of every CDT plugin for specific licensing information.

How is the CDT Project organized? Visit

CDT Project Structure to find out more about the organization of CDT (History, participants, and project structure).

How do I find out about future releases of the CDT? The official CDT Development plans are here:

Plans -- this is the page that contains all the new plans and meeting minutes, and

CDT 2.0 Plan - This plan is a description of the ongoing development on CDT 2.0.  It is subject to change.

If you wish to contribute to the development of the CDT, we welcome the opportunity to work with you. The plans will be updated to reflect the commitments made by contributors to this projects.  See Working on the CDT for information on how to get started.

Release Milestones (which represent planned availability dates for Stable
CDT builds) are noted in the CDT Plan Documents which can be found on the

CDT Overview Page. To see the currently available CDT builds, visit the

CDT Download Page.

What is the default configuration supported by the CDT? This is a bit of a moving target, but currently the compiler supported (from an
error parsing point of view) is gcc, the debugger interface will work with gdb 5.2.1 and the default build
command is GNU "make".

Which operating systems does the CDT support?

The CDT Framework is platform independent. It will run where Eclipse will
run. However, the default implementations may depend on external applications. To follow in the Eclipse spirit of open source, the default implementations
rely upon freely available open source tools, such as the GNU Tools: GDB and
Make. Therefore, the dependencies on GDB for debugging, or Make for building, will require that these applications are available for the platform that the user wishes to use. References to some of the known implementations for
each platform will be indicated in the sections of this FAQ that include instructions for
installation, project creation and building the CDT on the various platforms.

Which platforms are fully supported will ultimately depend on the needs of
the community, as expressed by the participation in developing, and testing for each
platform.

The core plugins are written in Java with no native code and thus may be ported to any platform supported by Eclipse. However, some default implementations may require that other software or tools, licensed under GNU, may be required.

In general there is some version of linux and some version of windows used by the developers on the CDT.  For an exact list of supported platforms see the <a href="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/cdt-home/downloads/main.html?cvsroot=Tools_Project">Downloads
page Target Operating Environments The objective is to support the CDT on all target operating environments listed in the

Eclipse 3.0 Project Plan. Eclipse SDK 3.0 is tested and validated on the following reference platforms (this list is updated over the course of the release cycle):

Eclipse Reference Platforms

Operating system Processor architecture Window system Java 2 Platform

Microsoft Windows XP Intel x86 Win32

* Sun Java 2 SDK, Standard Edition, version 1.4.2_03 for Microsoft Windows

Microsoft Windows XP Intel x86 Win32 IBM 32-bit SDK for Windows, Java 2 Technology Edition, Version 1.4.1

* Red Hat Enterprise Linux WS 3 Intel x86 GTK

* Sun Java 2 SDK, Standard Edition, 1.4.2_03 for Linux x86

* Red Hat Enterprise Linux WS 3 Intel x86 GTK IBM 32-bit SDK for Linux on Intel architecture, Java 2 Technology Edition, Version 1.4.1

SuSE Linux 8.2 Intel x86 GTK

* Sun Java 2 SDK, Standard Edition, 1.4.2_03 for Linux x86

SuSE Linux 8.2 Intel x86 GTK IBM 32-bit SDK for Linux on Intel architecture, Java 2 Technology Edition, Version 1.4.1

Sun Solaris 8 SPARC Motif

* Sun Java 2 SDK, Standard Edition, 1.4.2_03 for Solaris SPARC

HP HP-UX 11i hp9000 PA-RISC Motif

* HP-UX SDK for the Java 2 platform, version 1.4.2.00 for hp9000 PA-RISC

* IBM AIX 5L Version 5.2 PowerPC Motif IBM 32-bit SDK for AIX, Java 2 Technology Edition, Version 1.4.1

* Apple Mac OS X 10.3 PowerPC Carbon Java 2 Standard Edition 1.4.1 for Mac OS X

QNX Neutrino RTOS [version TBD] Intel x86 Photon IBM J9 VM for QNX [version TBD]

* Although untested, Eclipse should work fine on other OSes that support the same window system. For Win32: Windows 98, ME, NT, 2000, and Server 2003; SWT HTML viewer requires Internet Explorer 5 (or higher). For GTK on other Linux systems: version 2.2.1 of the GTK+ widget toolkit and associated librares (GLib, Pango); SWT HTML viewer requires Mozilla 1.4GTK2. For Motif on other Linux systems: Open Motif 2.1 (included); SWT HTML viewer requires Mozilla 1.4GTK2.

Why isn't the XXX operating system supported by CDT?

"Supported" has a particular meaning to us. It means that on that platform we
have a good level of confidence that CDT works correctly and that its function is appropriate and
complete. That means

someone has ensured that the function addresses the important use cases the function is exercised by regular execution of a test plan identified problems are tracked to resolution there is a recipient for user feedback code patches are developed as necessary to correct or extend CDT on that
platform

To make this all happen a platform has an Owner - someone who accepts the
responsibility to make sure those things all happen.

The Framework supports all the platforms that Eclipse does. The CDT team is responsible for ensuring that this remains true for the
framework. Specific default implementations will work only on platforms where the
required applications are available. The following list is derived from the initial CDT meeting in July 2002. The
following companies have agreed to provide support for the associated platforms:

Platform Company QNX NeutrinoQNX Software Systems Ltd. LinuxIBM, Red Hat WindowsIBM, MontaVista with initial support from QNX

If you have a favorite platform we highly encourage you to get involved and volunteer to own a feature that does not currently have an implementation
that works on your platform of choice.   See Working on the CDT for more information.

How do I ask questions?

CDT related questions that are not answered in this FAQ or the documentation
should be posted to the CDT newsgroup. You will need a password. You can also use this simple web interface to browse the newsgroup.

General Questions about the Eclipse SDK which includes the Eclipse Platform , JDT (Java Development Tools), or PDE (Plugin Development Environment) should be posted to the Eclipse newsgroup.

Keep in mind that these newsgroups are public, so do not include any
confidential information in your questions. You should also read BROKEN LINK How to ask questions the smart way by Eric Raymond before participating in the newsgroups. NOTE: Please submit bugs to bugzilla, not to the newsgroups. See the How do I report a bug or request a feature? section of this
document.

People will still come into a newsgroup asking questions that have been answered before and often will not provide any information about what versions they have installed, and what the problem is.

Here are a sample of information that is helpful.

OS-Version? Eclipse Version? CDT Version? Standard and/or Managed Make Plugin? Which compiler did you install? (Cygwin/MinGW/...any other compiler)? What did you exactly do when installing? Did you set anything to the PATH-variable? What did you see happen? What did you expect to see? What happens if you try the same thing from the command line?

How do I report a bug or request a feature?

The CDT Project (like the Eclipse Project) uses bugzilla as its bug and feature tracking system. Entering a bug\feature report is as simple as filling in a web form on the eclipse bugzilla page. The first time you enter a bug you will need to create a new bugzilla account for yourself by providing an email address and choosing a password.

Before entering a bug report, you should search bugzilla to see if someone else has already entered a bug report similar to yours. If you find a bug report that
outlines the problem you are seeing, you can simply annotate it with your comments to let the developers know
that you have also hit the bug. Also you can add yourself to the CC list of the bug so that you will
notified when the status of the bug changes or someone adds comments.

Once you have searched bugzilla and not found anything, you can go ahead and enter a new bug report. Please read the bug writing guidelines located on the eclipse bug reporting page.

To make your bug report more helpful include the following in your bug
reports:

Environmental settings: The build level of Eclipse that you are using. For example, "Eclipse 3.0M6" The build level of CDT that you are using. For example, "CDT build 2.0.0.0026" Your computer's specifications (OS version + patch level, memory, other
pertinent info) The contents of your .log file (or lack thereof). This is especially important if you get a dialog that reports an internal error. See What is this .log file I hear so much about? for information on on finding your .log file. The Java runtime or development kit you are using to run eclipse (use java -version or java -fullversion)

Problem Description: A description of what you were doing, A description of what behavior that you observed, and An explanation of how the observed behavior differs from the expected behavior

What is this .log file I hear so much about?

The .log file is used by the Eclipse Platform to log runtime errors. It is
invaluable when debugging both problems with plugins not starting, as well as any exceptions they may throw
once loaded. A .log file should always be included when opening a bug against the CDT or Eclipse (or
if there is no .log file, that fact should be mentioned in the bug).

The .log file is located in the workspace/.metadata directory (or sometimes
just in the .metadata directory).

How do I update this FAQ?

Where do I find more information about the CDT?

Tutorial

Online help

CDT Web site

This faq

newsgroup

mailing list

 

Download and Installation

top

Which CDT build should I download?

Check the

CDT Download Page for information on which CDT Build to use. CDT 1.0 CDT 1.1 CDT 1.2 The CDT 1.2 stream is now in maintenance mode. A new release, 1.2.1 is expected in the first quarter of 2004. The 1.2 stream runs against versions 2.1.x of Eclipse. It does not run against Eclipse 3.0 builds. CDT 1.2 Note: For CDT 1.2, the standard make project type and the new managed make project type have been separated out from the CDT "Platform".  When using the update site, please install the CDT feature as well as the Standard Build feature and optionally the Managed Make feature, in that order, or optionally selecting them and installing them at the same time (Process All). Other release notes for CDT 1.2 are available

here.

CDT 2.0 The CDT 2.0 stream is currently under development. The objective of this stream is to keep up with the Eclipse 3.0 development and is targeted at release in sync with Eclipse 3.0, i.e. June 2004.

How do I download the CDT?

To access the Update Manager, select Software Updates->Update Manager from the Help menu. To access an update site, select New->Site Bookmark from the context menu in the Feature Updates view. In the New Site Bookmark dialog, enter a name for the site (any name) and enter the URL for the update site. You can then expand the site bookmark in the Feature Updates view to reveal the available downloads.

Describe zip and update site

I can't find the CDT download for the XXX operating system?

The CDT is supported on the platforms specified on the download page. The
downloads are structured and named to indicate, which OS and windowing system it runs on. If you do not see your OS/windowing
system combination please contact us. We are always looking for volunteers to test and support platforms.

Much of the CDT default functionality uses applications that are available on
most operating systems. The CDT leverages some default system tools such as gdb(debugging), make(building). These tools are available for many platforms and if they exist on your
system, there is a good chance that the default functionality will work.  See Compilers and other 3rd party tools for more information

The caveat is that the operation of the CDT on some operating systems has not
been fully tested and we cannot commit time to fixing platform specific problems found on these
platforms. However, code submissions from developers wanting to improve the CDT will
always be gratefully accepted.  See Working ON the CDT for more information.

How do I uninstall CDT?

We do not currently ship an uninstaller. You can uninstall the CDT manually:

Shutdown the eclipse shell that is running CDT

Remove the CDT plugins

Navigate to the directory where the CDT plugins are installed (typically
eclipse/plugins) Remove the following plugins:

org.eclipse.cdt.*

Remove the CDT metadata

Navigate to the workspace/.metadata/.plugins directory Remove the following directories (if they exist):

org.eclipse.cdt.*

Restart Eclipse

C/C++ Project Creation

top

Creating a simple C++ Project -- "Hello World on a Windows Platform" See Toolchain installation .... Should this be a managed build example? This section will use an example to create the familiar "Hello World!" C++
program. First, ensure that you have the CDT installed within Eclipse, as described
above. Open a C/C++ Perspective and complete the following steps:

In the C/C++ Projects View right click and select "New Project ..." Select "C++" in the left pane and the select "Standard Make C++
Project" Enter a name for the new project and select Finish. Note: you can determine the "Build Settings" from this dialog, but we will do so later, in the build section. In the C/C++ Projects View right click and select "New" > "Simple" >
"File". Name your file hello.cpp Repeat the previous step and name the second new file "makefile". Copy the following text into the "hello.cpp" file:

#include <iostream.h> #include <stdlib.h>

int main() { char buff[128];

cout << "Hello World!\n"; cin >> buff; return (0); } Now, save the file. Copy the following text into the "makefile" file: Remember that makefiles require indented lines be a <tab> character and
not spaces

objects = hello.o

hello : $(objects) gcc -o hello $(objects) -L C:/MinGW/lib/gcc-lib/mingw32/2.95.3-5/ -lstdc++

$(objects) : hello.cpp gcc -c hello.cpp

all : ${MAKE} hello

.PHONY : clean clean : -del hello.exe $(objects)

Now, save the file. Note: the entry "C:/MinGW/lib/gcc-lib/mingw32/2.95.3-5/ " will depend entirely on the, your platform, installation location
and which GNU tools you have installed Read the make manual at :

How do I create a new project using a directory full of existing source?

If the source is accessible to the user from thier desktop using the command line then it is possible to simply make the root directories containing that source as Eclipse projects. This is accomplished by invoking the New Project Wizard, selecting C or C++ and then Standard Make Project as the project type. On the next page, enter a name for the project, the deselect the "Use Default Location" checkbox. This will let you Browse to the root folder of the source tree. After setting other information and clicking on Finish, the project will be created in the root of the source folder you have selected.

The resource for the project are maintained in the remote location specified, not in the workspace folder for eclipse. Meta data for the project, such as the index for the project and the "link" to the project, is stored in the metadata directory in the workspace folder.

How do I create a new project using CVS?

If the existing source tree is managed in CVS, it is possible to use the CVS Repository perspective to "Checkout As Project" any folder in the repository. The first time this is done, a Simple Project is created for the folder. To access the features of the CDT for this project, the project must be converted to a C or C++ project using the "Convert to a C or C++ Project" project type in the New Wizard.

This does a CVS checkout of the project into the project's location (usually
in the workspace).

How do I Import existing code into an existing project?

Another approach would be to create the C/C++ Project and then do an "Import"->"File System". This will make a copy of the files from the selected location into the selected folder in the project. With the copy, this approach is more wasteful and detaches the source from any control mechanism that existed in the originaly file location (e.g. a ClearCase view)

Editing C/C++ Projects

top

I'd like to use the code assist functionality, but it doesn't seem to work for me. I don't get anything showing up when I select CTRL+SPACE in a C/C++ source file.

Content Assist is a work in Progress. For CDT2.0 you should be able to ask for code completion anywhere in your source file. If you fail to find a completion you expect to find, most probably this is because of a failure in parsing your source file. In this case, check that you have added the correct set of include paths to the project containing your source file.

For example in the following code:

int main() {     pr } You should not expect "pr" to provide "printf" as a completion unless:

You have an #include <stdio.h>  in the file the include path to stdio.h is available in the project any macro's necessary to read stdio.h are set (often a missing macro will cause a system header to encounter a #error in the header file -- for example on windows using cygwin, the defining the symbol __i386__ will allow stdio.h to be understood)

As we improve and further develop the CDT, this function will get better and better.

Search is broken!

Overview problems?

Every now and then I get the subject message a few hundred times. In the middle of these message lines are a few like this: Unable to find full path for "c++filt"

How can I add another extension to CDT so that files other than c/cpp/cc/h files are recognized as source files? My compiler needs the file extension to be "xyz", and when I open xyz files there is no syntax highlighting.

Go to     Preferences -> Workbench -> Editors -> File Associations and add a new File Association xyz

Compilers and other 3rd party tools

top

. make gcc gdb $path binary parser

There are several tools that can help you run GNU Tools on Windows. Cygwin MinGW. Note: MinGW also works on top of a CygWin installation. Both of these tools offer a selection of GNU tools such as gcc, gdb and make.

Note: The CDT requires version 5.2.1 of the GDB. If you are using Cygwin the default version they currently install is too old. You need gdb 5.2.1, which should be in the gdb package dated 20020718-1

For example, on Windows you can install the Cygwin toolkit which is a Unix environment for Windows and includes automake and gdb. Note: The CDT currently uses GDB version 5.2.1 as the default. If you are using
Cygwin the default version they currently install is too old. You need gdb 5.2.1, which should be in the gdb package dated 20020718-1

I just installed Eclipse and the CDT. However, CDT does not recognize the existing toolchain [ie Visual Studio, Borland, Watcom, Cygwin, MinGW, GCC, etc]. How do I get the CDT to recognize these tools?    MANAGED BUILD

The current CDT doesn't integrate with a specific toolchain, but rather integrates with a build command, such as make, nmake, jam ant etc and this build command drives the toolchain. The default build command is make, but can be configured via the project properties:

Select a project in the navigator pane and open its properties Clear the "use default" check box and type in the desired build command. Note that you must provide a real executable for the build command, batch files won't work.

How do I add support for my toolchain via the managed build feature?

Are there C++ libraries included in the CDT (or elsewhere in Eclipse)?

No. CDT is only the IDE part of Eclipse. It doesn't provide any compiler toolchain nor C++ libraries, as these are part of the compilers and the operating system etc.

Building C/C++ Projects

top

When do I use the standard make feature

When do I use the managed make feature

Building a simple C++ Project -- "Hello World" on a Windows Platform

The following example uses an installation of MinGW, installed into the directory C:\MinGW. If your installation has the GNU tools
and libraries in a different location you will have to modify the example "makefile" to look for the
libraries in the correct location.

Follow the instructions, on the respective web site, to install your GNU
tools. In the C/C++ Projects View, select your new C/C++ project, right click and
select Properties In the properties dialog select "C/C++ Project". Then select the "Build Settings" tab. Deselect the "Use Default" checkbox Enter the following in the "Build Command" text box make -f makefile Now you are ready to build your first CDT C/C++ project. In the C/C++ Projects View, select your new C/C++ project, right click and
select "Rebuild Project" You will have two additional files. "hello.o" and "hello.exe" Double click on "hello.exe" or right click and select "Open With" >
"Default Editor" to launch your simple program.

Can I see the raw compiler output? Where is this information placed?

The C-Build view is a console which shows all of the activity which occurs
once a project's build command is executed.

I get the error Whatever it is that means we cannot spawn make

Cygwin/MinGW?

My Compiler errors seem to be truncated or split. What is going on? > Hi all, > I have anoter question regarding the compiler errors. It seems that they

> are not shown complete in the Tasks window. > If I have a look to the C-Bulid window, the complete description is > given. Is this the intent? > And second, does anybody know a good ressource where I can read about > the compiler errors?

When using GCC toolchain, you need to add to each compile/link line the following (either in Makefile, add this to CFLAGS/CXXFLAGS/LDFLAGS, or when using managed builds, add this in each configuration to the misc-sections):

-fmessage-length=0

This will keep the compiler and linker to break lines at a default value, which in fact, shortens the task/problem report entries.

What causes the message     make (e=2): The system cannot find the file specified?

gcc -c hello.c

> > process begin: CreateProcess((null), gcc -c hello.c, ...) failed. > > make (e=2): The system cannot find the file specified.       Actually looking at this it seems you mingw32-make did not fine > "gcc", You will have to also set you path

Debugging C/C++ Projects

top

I'm missing some basic C/C++ debugging functionality, where is it hidden?

You have to customize your debug perspective to see all C/C++ actions. In
the Debug perspective open "Window"-->"Customize perspective"-->"Other" and check the "C/C++ Debug" box. In the latest version it is checked by default. To customize your views open "Window"-->"Preferences"-->"Debug"-->"Debug Action groups" and check/uncheck the "C/C++ Debug" and "Java Debug" boxes.

Is it possible to see global variables? The Variables view shows only local variables.

The "Variables" view displays only local variables and arguments for the selected stack frame. You can use the "Add _expression_ (C/C++)" option to add a global variable to the "Expressions" view.

Can I debug remote targets?

Yes; when you enter the debug window you can select GdbServer as debugger.
Then the window information changes and you can enter the TCP-IP address and port of your target debug server or select the serial line.

Since the debugger is gdb, can I simply access the gdb console?

Yes, partially. The console can be flipped into gdb mode (see the "Show
Debugger Console" button in the debugger view which does this) and you can type in commands at that point. Doing this can possibly de-synchronize the IDE with gdb, so you should be careful to what extent you drive the debugger using
this interface.

Can I see/log all of the commands which are being driven to gdb?

Yes, you can turn on tracing for the debug plugin and it will show you all of the information about what commands are being sent to gdb. To run with tracing:

Create a file (for example, .options) Add the following line to it:         org.eclipse.cdt.debug.mi.core/debug=true Start Eclipse with:         -debug "file:<full path>/.options"

Why can't I see the source in the debugger? I use some classes in standard c++ library and I'd like to view the source of
it in debugging mode, just like viewing the source of my own cpp files when I
stepped into some method.   I've tried to add the path of gcc source (extracted
from gcc tar ball) into the "Additional Source Locations" of the Source Tab in
the debugging configuration for project. Could anybody tell me how to configure
CDT to do this? Check: - if your library contains the debug information, - if the library symbols are loaded when you try to step into a library function (use the Shared Libraries view or set the "Load shared library symbols automatically" options of the launch configuration), If your library is build in the different location you should use the "Associate with" option of the "Add Directory Source Location" dialog.

Can I debug Java and C++ at the same time?

Can I set a breakpoint in a DLL?

A breakpoint in DLL can be set if the symbol information of DLL is loaded
in gdb. On Windows this happens when DLL is loaded. The CDT uses the "stop-on-solib-events" command of gdb to catch the moment when DLL is loaded and tries to plant the breakpoints that belong the project or the reference projects. This all is transparent for user. As far as I know (but I am not 100% sure) this option ("stop-on-solib-events") is not supported by gdb on Windows. What you can do is to stop after your DLL is loaded and then set a breakpoint in it.

When I want to debug my "Hello World" program, I have this error : "Failed Launching CDI Debugger : Error creating session: gdb: unrecognized option '-i'"

Why is my executable not listed in the debug dialog?

Problem is that all the files including exe are not getting proper icon (All icons are text editor icons). Also when we try to debug the exe is not listed in the dialog so that we can select the exe from the list.

When I launch debug, I get two suspended threads and a command window that doesn't show up anything. If I do Run/Resume, I get an error message:

Resume failed. Reason: Exceptions occurred attempting to resume. Details: Target request failed: Target is not responding (timed out) What is wrong?

Your version  of gdb (2003-09-02-cvs cygwin-special?) had problems with "data-list-changed-registers". Disabling the updating the Registers view option (Windows->Preferences->Debug->Registers view) and unchecking the "Auto-Refresh by default" option will take  care of the problem.

Is there any way of using the dbx debugger from the CDT?

Miscellaneous Troubleshooting

top

CDT tells me that I keep running out of memory, but I have XX GB of memory. What is wrong?

You should try starting Eclipse using the -vmargs -Xmx512m parameter after the -vm argument. This will increase the Java heap size to 512MB. E.g.    ./eclipse <other eclipse arguments> -vm ~/jdk/bin/java -vmargs -Xmx512m

Whenever I build the project, the eclipse hangs (gets "stuck"). I see a process named: "c++ filt" to restart it.  Why?

There was a bug in the old version of c++filt that did not flush its output when it finishes (this same problem happens with addr2line). CDT is waiting for the answer from c++filt.  You need get a new version of c++filt to fix the problem.

Working ON the CDT

top

How do I get access to the CDT source code?

This document describes the process of building, running and debugging the CDT within Eclipse. The specific information such as screen shots or the detailed steps for some action, may differ from your experience depending on what Eclipse build you are using. We will try to keep this document up-to-date with the behaviour of the latest builds. THIS IS REALLY REALLY OLD To build the CDT inside Eclipse you will need a build of eclipse from the Eclipse Download Page. We recommend that you choose version 2.0.1 or a recent Stable Build. In addition, you will need a Java Runtime Environment (JRE) of at least Version 1.3 or greater. Once you have Eclipse properly installed, the CDT CVS Respository can be accessed and the CDT plugins checked-out and built. Note: The exact steps may vary depending on what Eclipse build you use.

Open the "CVS Repository Exploring" Perspective Right-Click in the "CVS Repositories" view and select "New -> Anonymous Repository Location to dev.eclipse.org..." From the "Add CVS Repository" dialog, perform the following:

Change the value of Repository path to /home/tools The rest of the default values should be fine but just to make sure, you can verify:

Host: dev.eclipse.org

User: anonymous

Password: you can leave this blank

Connection Type: pserver

Use Default Port: selected

Validate Connection on Finish: selected

Select "Finish" (this should create a new repository in the CVS Repositories View called :pserver:anonymous@xxxxxxxxxxxxxxx:/home/tools)

Expand the interactor for your new repository Expand the interactor for HEAD Hold down the <Ctrl> key and select all the plugins you wish to build. The complete list for the CDT are those that match org.eclipse.cdt.* , however you may wish to select only a subset. Of course you may have to return to this step if you have checked out a subset and are missing some dependencies. Currently the following list are the plugins that must be checked out.

org.eclipse.cdt org.eclipse.cdt.core org.eclipse.cdt.core.${os} org.eclipse.cdt.debug.core org.eclipse.cdt.debug.mi.core org.eclipse.cdt.debug.mi.ui org.eclipse.cdt.debug.ui org.eclipse.cdt.launch org.eclipse.cdt.ui org.eclipse.cdt-feature org.eclipse.cdt.${platformID}-feature Optional: The "org.eclipse.cdt.*.tests" packages can also be checked out. In which case you will also need to import the org.junit package (and others ?) in the next step. Additional instructions regarding testing will be coming soon.

Once you have selected your plugins, right-click on the selected list and choose "Check Out as Project". This should start checking out all the selected plugins and subsequently build them. You will have build errors until you complete the next step. The Eclipse CDT projects are organized for team development. As a result the classpath is not stored with the project. You must add the required plugins as External Packages and/or Fragments.   Click on the "File" menu Select "Import > External Plugins & Fragments" Select "Choose from Plug-ins in the Runtime Workbench" Enter your eclipse installation directory in the text field labeled "Plug-in Location" (i.e. C:\eclipse) Select "Plugins from the Runtime Workbench" Select the following from the list:

org.eclipse.ant org.apache.lucene org.apache.xerces org.eclipse.ant.core org.eclipse.compare org.eclipse.core.boot org.eclipse.core.resources org.eclipse.core.runtime org.eclipse.debug.core org.eclipse.debug.ui org.eclipse.help org.eclipse.help.ui org.eclipse.pde.core org.eclipse.platform org.eclipse.search org.eclipse.swt org.eclipse.team.core org.eclipse.ui org.eclipse.update.core org.junit (optional for running JUnit tests) Platform specific projects, will be added through the next step

Select "Add Required Plugins" (Sometimes "Add Required ..." does not add all required plugins ... if this happens select "Add All") Press "Finish"

If build errors occur indicating that org.eclipse.* plugins cannot be found, ensure that your Eclipse and VM installation are setup correctly.

You can also select each plugin and right-click then choose "Update Classpath", but this should not be necessary.

How do I modify the code

How do I run with my changes?

After successfully building the CDT inside Eclipse, one typically wants to run an instance of Eclipse with the freshly built plugins (perhaps after making some changes to the source code). This is very easy to do in the PDE. Here are the steps:

Open the "Plug-in Development" perspective (you may have to goto "Others" to find it). Select the menu action Run -> Run As... -> Run-time workbench.

How do I submit the changes back to the CDT community?

How do I distribute my changes to my customers?

In order to build a distribution zip and/or sources for the CDT the following steps must be completed.

Browse to the org.eclipse.cdt package directory Edit the "about.mappings" file to indicate the build number This example uses the format: yyyymmdd #e.g. "0=<year><month><date>" 0=20020926

Browse to the org.eclipse.cdt-feature package directory Open the "feature.xml" file Select the "Package" button from the Overview Page From the dialog that is presented select the following IN ORDER. Notice the numbers that appear beside the selected items. They should be as follows:

clean init build.jars build.update.jar build.zips zip.distribution

When the build is complete look in the appropriate feature directory and you will find a binary distribution zip file or a sources zip file (if you ran the source feature) e.g. org.eclipse.cdt_20020926_1.0.0.bin.dist.zip ... zipped features and plugins org.eclipse.cdt_20020926_1.0.0.src.zip ... zipped sources

Repeat the steps 1 thru 6 using the org.eclipse.cdt.${platformID}-feature

The CDT has been structured to be created in two aprts. The first is the platform independent org.eclipse.cdt-feature and the org.eclipse.cdt.${platformID}-feature, which contains platform specific fragments required by the install.

How do I generate JavaDocs?

The following steps can be used to create JavaDocs for any CDT project.

Check out the project (i.e. org.eclipse.cdt.debug.core) from dev.eclipse.org with cvsroot /home/tools Ensure that you have JavaDoc installed and configured (go to
preferences->Java->Javadoc and set the location for the javadoc command Select the project in the package explorer, right-click Export, select Javadoc and follow the wizard instructions. It will generate the Javadoc html in a doc directory for that plugin

The result will be a complete JavaDoc hierarchy of all the public APIs for
the selected plugin.

What are some areas that are not complete Source code formating integration with profiler refactoring Full DOM read/write

Last Modified on Wednesday Feb 4, 2004

=