Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "CDT/User/NewIn80"

< CDT
(Pin & Clone)
(Toggle Function Definition)
Line 1: Line 1:
== Build ==
+
== Build ==
  
=== Console ===
+
=== Console ===
  
* The "C-Build console" is now named "CDT Build Console"
+
*The "C-Build console" is now named "CDT Build Console"  
* It is now possible to open the CDT Build Console before performing a build. See [http://bugs.eclipse.org/320765 bug 320765]. Note that operations on the console will require the user to first select a project. The below screenshot shows the new access to the CDT Build Console.
+
*It is now possible to open the CDT Build Console before performing a build. See [http://bugs.eclipse.org/320765 bug 320765]. Note that operations on the console will require the user to first select a project. The below screenshot shows the new access to the CDT Build Console.
[[Image:CDTConsoleStart.jpg]]
+
* "CDT Global Build Console" got introduced. This console combines output from all referenced projects being built in one view. See [http://bugs.eclipse.org/309113 bug 309113].
+
[[Image:CDTGlobalBuildConsole.jpg]]
+
  
* Differentiate color highlighting in build output for error, warning and info problem markers. See [http://bugs.eclipse.org/307211 bug 307211].
+
[[Image:CDTConsoleStart.jpg]]  
  
[[Image:bug_307211.png]]
+
*"CDT Global Build Console" got introduced. This console combines output from all referenced projects being built in one view. See [http://bugs.eclipse.org/309113 bug 309113].
  
=== Error Parsers ===
+
[[Image:CDTGlobalBuildConsole.jpg]]  
* Added ability to reset individual error parsers in preferences. Also icons to indicate status, such as "user", "extension" icons and "wrench" overlay for customized parsers, [https://bugs.eclipse.org/bugs/show_bug.cgi?id=302720 bug 302720].
+
[[Image:bug-302720-ResetErrorParser.png]]
+
  
=== Make Targets ===
+
*Differentiate color highlighting in build output for error, warning and info problem markers. See [http://bugs.eclipse.org/307211 bug 307211].
* Rebuild Last Target F9 got a new option in preferences - to rebuild last target from a whole project including subfolders. This preference is the default now. [https://bugs.eclipse.org/bugs/show_bug.cgi?id=333113 bug 333113].
+
[[Image:bug-333113-LastMakeTarget.png]]
+
  
* Source folders are shown in collapsed form now in Make Targets View, similarly as they are shown in Project Explorer. [https://bugs.eclipse.org/bugs/show_bug.cgi?id=339015 bug 339015].
+
[[Image:Bug 307211.png]]  
[[Image:bug-339015-MakeTargetView-SrcRoots.png]]
+
  
=== Managed Build ===
+
=== Error Parsers  ===
* By default, there will be a space added after "-o" option and its value in compiler/linker commands in the generated makefiles. That stands for other applicable options as well. See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=232373 bug 232373].
+
g++  -o "Hello.exe"  ./src/Hello.o
+
  
=== Scanner Discovery ===
+
*Added ability to reset individual error parsers in preferences. Also icons to indicate status, such as "user", "extension" icons and "wrench" overlay for customized parsers, [https://bugs.eclipse.org/bugs/show_bug.cgi?id=302720 bug 302720].
* It is possible now to clear old built-in include paths and symbols left after compiler upgrade in Paths&Symbols in project properties. The "Clean" button was introduced on "Scanner Discovery" page. See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=206372 bug 206372].
+
* You can now inspect the output of command to collect built-in compiler include paths and symbols, [https://bugs.eclipse.org/bugs/show_bug.cgi?id=342069 bug 342069].
+
[[Image:DiscoveryTab.png]]
+
  
== Debug ==
+
[[Image:Bug-302720-ResetErrorParser.png]]
  
=== Project-less debugging ===
+
=== Make Targets  ===
  
CDT can now be used to debug any binary, without needing to specify or even create a project in Eclipse. This is supported for all types of debugging (local, remote, attach, and post-mortem sessions).  
+
*Rebuild Last Target F9 got a new option in preferences - to rebuild last target from a whole project including subfolders. This preference is the default now. [https://bugs.eclipse.org/bugs/show_bug.cgi?id=333113 bug 333113].
  
Furthermore, for an attach session (local or remote), there is even no need to specify the binary; for a local attach, GDB can find the binary automatically, while for a remote attach, CDT will prompt for it when it needs it.
+
[[Image:Bug-333113-LastMakeTarget.png]]
  
[[Image:Noprojectdebug.png]]
+
*Source folders are shown in collapsed form now in Make Targets View, similarly as they are shown in Project Explorer. [https://bugs.eclipse.org/bugs/show_bug.cgi?id=339015 bug 339015].
  
This feature was completed April 26th, 2011 as part of [http://bugs.eclipse.org/343861 Bug 343861]
+
[[Image:Bug-339015-MakeTargetView-SrcRoots.png]]  
  
=== Support for full pretty-printing of complex structures ===
+
=== Managed Build  ===
  
With the proper setup of GDB, DSF-GDB will now print complex structures such as Maps, Lists and Vectors, in a user-friendly fashion, within the Variables and Expressions views, as well as the advanced Debug hover of the Editor. See below on how to setup GDB for this feature to work.
+
*By default, there will be a space added after "-o" option and its value in compiler/linker commands in the generated makefiles. That stands for other applicable options as well. See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=232373 bug 232373].
  
 +
g++  -o "Hello.exe"  ./src/Hello.o
  
'''Without pretty-printing:'''
+
=== Scanner Discovery  ===
  
[[Image:NoPrettyPrint.png]]
+
*It is possible now to clear old built-in include paths and symbols left after compiler upgrade in Paths&amp;Symbols in project properties. The "Clean" button was introduced on "Scanner Discovery" page. See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=206372 bug 206372].
 +
*You can now inspect the output of command to collect built-in compiler include paths and symbols, [https://bugs.eclipse.org/bugs/show_bug.cgi?id=342069 bug 342069].
  
 +
[[Image:DiscoveryTab.png]]
  
'''With pretty-printing:'''
+
== Debug  ==
  
[[Image:FullPrettyPrint.png]]
+
=== Project-less debugging  ===
  
 +
CDT can now be used to debug any binary, without needing to specify or even create a project in Eclipse. This is supported for all types of debugging (local, remote, attach, and post-mortem sessions).
  
This feature has been contributed by Jens Elmenthaler to CDT 8.0 as of November 4th, 2010, as part of [http://bugs.eclipse.org/302121 Bug 302121]
+
Furthermore, for an attach session (local or remote), there is even no need to specify the binary; for a local attach, GDB can find the binary automatically, while for a remote attach, CDT will prompt for it when it needs it.  
  
 +
[[Image:Noprojectdebug.png]]
  
'''Configuring GDB for pretty-printing:'''
+
This feature was completed April 26th, 2011 as part of [http://bugs.eclipse.org/343861 Bug 343861]
  
* You will need to have python installed on your machine
+
=== Support for full pretty-printing of complex structures  ===
 +
 
 +
With the proper setup of GDB, DSF-GDB will now print complex structures such as Maps, Lists and Vectors, in a user-friendly fashion, within the Variables and Expressions views, as well as the advanced Debug hover of the Editor. See below on how to setup GDB for this feature to work.
 +
 
 +
<br> '''Without pretty-printing:'''
 +
 
 +
[[Image:NoPrettyPrint.png]]
 +
 
 +
<br> '''With pretty-printing:'''
 +
 
 +
[[Image:FullPrettyPrint.png]]
 +
 
 +
<br> This feature has been contributed by Jens Elmenthaler to CDT 8.0 as of November 4th, 2010, as part of [http://bugs.eclipse.org/302121 Bug 302121]
 +
 
 +
<br> '''Configuring GDB for pretty-printing:'''
 +
 
 +
*You will need to have python installed on your machine
 +
 
 +
*If you want to pretty-print STL structures, you will need the Python pretty-printers for STL. Check-out the latest Python libstdc++ printers to a place on your machine. (Note that you can create your own pretty-printers for any complex-structure). In a local directory, do:
  
* If you want to pretty-print STL structures, you will need the Python pretty-printers for STL.  Check-out the latest Python libstdc++ printers to a place on your machine. (Note that you can create your own pretty-printers for any complex-structure).  In a local directory, do:
 
 
     svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
 
     svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
  
* You will need to create a gdbinit file to tell GDB where the pretty-printers are. Create a gdbinit file with the following 6 lines. The path needs to match where the python module above was checked-out. So if checked out to: /home/marc/gdb_printers/, the path would be as written in the example:
+
*You will need to create a gdbinit file to tell GDB where the pretty-printers are. Create a gdbinit file with the following 6 lines. The path needs to match where the python module above was checked-out. So if checked out to: /home/marc/gdb_printers/, the path would be as written in the example:
  
 
   python
 
   python
  import sys
+
import sys
  sys.path.insert(0, '/home/marc/gdb_printers/python')
+
sys.path.insert(0, '/home/marc/gdb_printers/python')
  from libstdcxx.v6.printers import register_libstdcxx_printers
+
from libstdcxx.v6.printers import register_libstdcxx_printers
  register_libstdcxx_printers (None)
+
register_libstdcxx_printers (None)
  end
+
end
  
* You will need GDB 7.0 or later. GDB 7.2 is recommended because it has some bug fixes for the pretty-printing.
+
*You will need GDB 7.0 or later. GDB 7.2 is recommended because it has some bug fixes for the pretty-printing.
  
* In your DSF-GDB launch, make sure you use the right GDB and the right gdbinit file
+
*In your DSF-GDB launch, make sure you use the right GDB and the right gdbinit file
  
=== Support for pending breakpoints ===
+
=== Support for pending breakpoints ===
  
When a breakpoint is set in a dynamically-linked library that was not loaded yet, the breakpoint will now work, once the library is loaded. See [http://bugs.eclipse.org/248595 bug 248595]. This feature is currently only supported when using GDB 6.8 or later.
+
When a breakpoint is set in a dynamically-linked library that was not loaded yet, the breakpoint will now work, once the library is loaded. See [http://bugs.eclipse.org/248595 bug 248595]. This feature is currently only supported when using GDB 6.8 or later.  
  
=== Showing cores in Debug view labels ===
+
=== Showing cores in Debug view labels ===
  
By using the enhancements of GDB 7.1, DSF-GDB now shows the core on which each thread runs as an extra part of the Debug View label. The list of all cores on which a process is located is also added as a label. The below image shows the new feature.
+
By using the enhancements of GDB 7.1, DSF-GDB now shows the core on which each thread runs as an extra part of the Debug View label. The list of all cores on which a process is located is also added as a label. The below image shows the new feature.  
  
[[Image:CoreLabels.png]]
+
[[Image:CoreLabels.png]]  
  
This feature has been implemented for CDT 8.0 as of July 6th, 2010, as part of [http://bugs.eclipse.org/318230 Bug 318230]. The feature will be enabled automatically as long as GDB 7.1 or greater is used.
+
This feature has been implemented for CDT 8.0 as of July 6th, 2010, as part of [http://bugs.eclipse.org/318230 Bug 318230]. The feature will be enabled automatically as long as GDB 7.1 or greater is used.  
  
=== Showing cores and owner in attach prompter ===
+
=== Showing cores and owner in attach prompter ===
  
DSF-GDB now shows the owner of a process as an extra part of the process prompt for an attach session. The owner id will be shown starting with GDB 7.0.   For a Remote attach session (using gdbserver --multi), the cores on which a process is located will also be shown. Showing the cores starts with GDB 7.1. The below image shows the new feature.
+
DSF-GDB now shows the owner of a process as an extra part of the process prompt for an attach session. The owner id will be shown starting with GDB 7.0. For a Remote attach session (using gdbserver --multi), the cores on which a process is located will also be shown. Showing the cores starts with GDB 7.1. The below image shows the new feature.  
  
[[Image:UserAndCores.jpg]]
+
[[Image:UserAndCores.jpg]]  
  
This feature has been implemented for CDT 8.0 as of July 30th, 2010, as part of [http://bugs.eclipse.org/318230#21 Bug 318230 comment 21]. The feature will be enabled automatically as long as the proper version of GDB is used.
+
This feature has been implemented for CDT 8.0 as of July 30th, 2010, as part of [http://bugs.eclipse.org/318230#21 Bug 318230 comment 21]. The feature will be enabled automatically as long as the proper version of GDB is used.  
  
=== Pin & Clone  ===
+
=== Pin &amp; Clone  ===
  
Variables, Expressions, Registers, Disassembly, and Memory Browser now supports opening multiple instances, and pin the view input to the selected debug context(s) in the Debug view. This can be used, for example, to easily compare the data of different threads.  
+
Variables, Expressions, Registers, Disassembly, and Memory Browser now supports opening multiple instances, and pin the view input to the selected debug context(s) in the Debug view. This can be used, for example, to easily compare the data of different threads.  
  
 
[[Image:PinCloneDebug.png]]  
 
[[Image:PinCloneDebug.png]]  
  
This feature has been implemented for CDT 8.0 as of Feb 15th, 2011, as part of [http://bugs.eclipse.org/bugs/show_bug.cgi?id=327263 Bug 327263], [http://bugs.eclipse.org/bugs/show_bug.cgi?id=331781 Bug 331781], and [http://bugs.eclipse.org/bugs/show_bug.cgi?id=334566 Bug 334566].
+
This feature has been implemented for CDT 8.0 as of Feb 15th, 2011, as part of [http://bugs.eclipse.org/bugs/show_bug.cgi?id=327263 Bug 327263], [http://bugs.eclipse.org/bugs/show_bug.cgi?id=331781 Bug 331781], and [http://bugs.eclipse.org/bugs/show_bug.cgi?id=334566 Bug 334566].  
  
=== Multi-process Debugging ===
+
=== Multi-process Debugging ===
  
CDT now supports debugging multiple processes in a single debug session. It allows to attach/detach and start/stop processes repeatedly and easily.
+
CDT now supports debugging multiple processes in a single debug session. It allows to attach/detach and start/stop processes repeatedly and easily.  
  
Requirements:
+
Requirements:  
* GDB 7.2 or greater
+
* Currently, only Non-Stop debugging sessions support multiple processes.
+
* Note that this feature was developed and tested on Linux systems, and may not work on Windows.
+
  
To use multi-process debugging, simply launch an application as you normally would, locally or remotely, using gdbserver, and make sure to select Non-stop mode in the Debugger tab. Then, use the Debug View's "Connect" button to trigger a dialog with allows you to either attach to a running process, or to create a new process using the "New..." button.  Currently, the "New..." button is only supported for Local debug sessions.
+
*GDB 7.2 or greater
 +
*Currently, only Non-Stop debugging sessions support multiple processes.  
 +
*Note that this feature was developed and tested on Linux systems, and may not work on Windows.
  
[[Image:MultiAttachDialog.png]]
+
To use multi-process debugging, simply launch an application as you normally would, locally or remotely, using gdbserver, and make sure to select Non-stop mode in the Debugger tab. Then, use the Debug View's "Connect" button to trigger a dialog with allows you to either attach to a running process, or to create a new process using the "New..." button. Currently, the "New..." button is only supported for Local debug sessions.  
  
 +
[[Image:MultiAttachDialog.png]]
  
 +
<br>
  
You will then have the newly selected process added to your debug session, where you can control it and examine it. You can use the "Disconnect" button to remove processes from your debug session, or you can use the "Connect" button to add new ones.  
+
You will then have the newly selected process added to your debug session, where you can control it and examine it. You can use the "Disconnect" button to remove processes from your debug session, or you can use the "Connect" button to add new ones.  
  
[[Image:MultiProducerConsumer.png]]
+
[[Image:MultiProducerConsumer.png]]  
  
 +
<br>
  
 +
An option to automatically attach to a forked process is also available. This means that whenever any process you are currently debugging forks a new process, that new process will be added to your debug session.
  
An option to automatically attach to a forked process is also available.  This means that whenever any process you are currently debugging forks a new process, that new process will be added to your debug session.
+
<br> [[Image:AutoAttachOption.png]]
  
 +
=== C/C++ Remote Application launch  ===
  
[[Image:AutoAttachOption.png]]
+
The optional "C/C++ Remote Application" launch configuration type has been made permanent for CDT.  
  
=== C/C++ Remote Application launch ===
+
[[Image:Debugconfig.jpg]]
  
The optional "C/C++ Remote Application" launch configuration type has been made permanent for CDT.
+
The "GDB (DSF) Remote System Process" launch delegate has been renamed to "GDB (DSF) Manual Remote Debugging" and has been moved from "C/C++ Application" to "C/C++ Remote Application". As was the case for CDT 7.0, the optional RSE Remote Launch delegate of org.eclipse.cdt.launch.remote, is still part of "C/C++ Remote Application".  
  
[[Image:Debugconfig.jpg]]
+
This optional remote launch now provides a new DSF-GDB-based launch delegate called "GDB (DSF) Automatic Remote Debugging". This launch is very similar to the existing "GDB (DSF) Manual Remote Debugging" delegate, except that the automatic one will automatically download the application to the remote target and start gdbserver with the application.  
  
The "GDB (DSF) Remote System Process" launch delegate has been renamed to "GDB (DSF) Manual Remote Debugging" and has been moved from "C/C++ Application" to "C/C++ Remote Application".  As was the case for CDT 7.0, the optional RSE Remote Launch delegate of org.eclipse.cdt.launch.remote, is still part of "C/C++ Remote Application".
+
[[Image:RemoteDelegates.jpg]]
  
This optional remote launch now provides a new DSF-GDB-based launch delegate called "GDB (DSF) Automatic Remote Debugging". This launch is very similar to the existing "GDB (DSF) Manual Remote Debugging" delegate, except that the automatic one will automatically download the application to the remote target and start gdbserver with the application.
+
By default, the user will be shown the "GDB (DSF) Manual Remote Debugging". However, if the optional feature of Remote Launch is installed, the default will automatically become the more feature-rich "GDB (DSF) Automatic Remote Debugging".  
  
[[Image:RemoteDelegates.jpg]]
+
Finally, the run-mode RSE Remote Launch delegate no longer shows the Debugger or Source tabs, since they were not relevant, in run-mode.  
  
By default, the user will be shown the "GDB (DSF) Manual Remote Debugging".  However, if the optional feature of Remote Launch is installed, the default will automatically become the more feature-rich "GDB (DSF) Automatic Remote Debugging".
+
=== New set of preferences  ===
  
Finally, the run-mode RSE Remote Launch delegate no longer shows the Debugger or Source tabs, since they were not relevant, in run-mode.
+
A set of new preferences have been added to ''Preferences-&gt;C/C++-&gt;Debug-&gt;GDB'' to allow users to have a better debugging experience. These new preference are:
  
=== New set of preferences ===
+
*Default GDB path and initialization file: default path for the location of GDB as well as for the GDB initialization file.
 +
*Default behavior for ''Stop on startup'': default behavior to stop the execution on startup, and on what symbol.
 +
*Default Non-stop mode: default behavior to automatically enable non-stop mode or not. Non-stop mode allows to control the execution of threads and processes independently.
 +
*Default limit for GDB Traces: limits the amount of traces printed on the ''gdb traces'' console
 +
*Default enabling of pretty-printing: assuming a pretty-printing enabled GDB, automatically enabled pretty-printing in CDT
 +
*Default child limit for pretty-printing: default to control the amount of children automatically shown by a pretty-printer
  
A set of new preferences have been added to ''Preferences->C/C++->Debug->GDB'' to allow users to have a better debugging experience. These new preference are:
+
<br> [[Image:DefaultGdbPreference.png]]
  
* Default GDB path and initialization file: default path for the location of GDB as well as for the GDB initialization file.
+
<br> The values of most of these preferences will be used to populate the corresponding entries of the Debugger tab, whenever a new launch is created.
* Default behavior for ''Stop on startup'': default behavior to stop the execution on startup, and on what symbol.
+
* Default Non-stop mode: default behavior to automatically enable non-stop mode or not.  Non-stop mode allows to control the execution of threads and processes independently.
+
* Default limit for GDB Traces: limits the amount of traces printed on the ''gdb traces'' console
+
* Default enabling of pretty-printing: assuming a pretty-printing enabled GDB, automatically enabled pretty-printing in CDT
+
* Default child limit for pretty-printing: default to control the amount of children automatically shown by a pretty-printer
+
  
 +
<br> [[Image:LaunchDefaultGdb.png]]
  
[[Image:DefaultGdbPreference.png]]
+
<br> This feature has been implemented for CDT 8.0 as as part of [http://bugs.eclipse.org/120162 Bug 120162], [http://bugs.eclipse.org/347245 Bug 347245] and [http://bugs.eclipse.org/335895 Bug 335895].
  
 +
=== Non-stop attach does not interrupt the process  ===
  
The values of most of these preferences will be used to populate the corresponding entries of the Debugger tab, whenever a new launch is created.
+
As part of [http://bugs.eclipse.org/333284 Bug 333284] attaching to a process in non-stop mode will no longer interrupt the process.  
  
 +
=== Extra node for debugged process no longer shown  ===
  
[[Image:LaunchDefaultGdb.png]] 
+
The debugged process extra launch node has been removed from the Debug view. This node was felt to waste space, especially when dealing with multi-process debugging as we would have needed many of them. The Debug view already shows the debugged process as a container of threads, right below the launch node.  
  
 +
[[Image:WithInferior.png]]
  
This feature has been implemented for CDT 8.0 as as part of [http://bugs.eclipse.org/120162 Bug 120162], [http://bugs.eclipse.org/347245 Bug 347245] and [http://bugs.eclipse.org/335895 Bug 335895].
+
== Editor  ==
  
=== Non-stop attach does not interrupt the process ===
+
=== Override Markers  ===
  
As part of [http://bugs.eclipse.org/333284 Bug 333284] attaching to a process in non-stop mode will no longer interrupt the process.
+
In C++ files, method declarations and definitions are annotated on the vertical bar using three types of symbols:  
  
=== Extra node for debugged process no longer shown ===
+
*Override (''green triangle'') indicating that a virtual method in one of base classes is overridden,
 +
*Implement (''empty blue triangle'') indicating that a pure virtual (abstract) method in one of base classes is overridden,
 +
*Shadow (''dark blue triangle'') indicating that a method in one of base classes ''with the same paremeter set'' is shadowed.
  
The debugged process extra launch node has been removed from the Debug view.  This node was felt to waste space, especially when dealing with multi-process debugging as we would have needed many of them.  The Debug view already shows the debugged process as a container of threads, right below the launch node.
+
[[Image:CDTOverrideMarkers.png]]
  
[[Image:WithInferior.png]]
+
As in JDT, the annotations have the action which allows to go to the declaration in base.  
  
== Editor ==
+
In case of multiple inheritance, the messages also contain the name of ''direct'' base class of the overriding method's class if the overrided method's class is further up the inheritance hierarchy.
  
=== Override Markers ===
+
Contrary to JDT, several messages are sometimes generated on one marker (e.g. when the same method is overridden through several base classes).  
In C++ files, method declarations and definitions are annotated on the vertical bar using three types of symbols:
+
* Override (''green triangle'') indicating that a virtual method in one of base classes is overridden,
+
* Implement (''empty blue triangle'') indicating that a pure virtual (abstract) method in one of base classes is overridden,
+
* Shadow (''dark blue triangle'') indicating that a method in one of base classes ''with the same paremeter set'' is shadowed.
+
  
[[Image:CDTOverrideMarkers.png]]
+
=== Selection Expansion  ===
  
As in JDT, the annotations have the action which allows to go to the declaration in base.
+
The C++ editor now allows to expand the selection to enclosing, next and previous nodes of the AST, as well as restore the hierarchy.  
  
In case of multiple inheritance, the messages also contain the name of ''direct'' base class of the overriding method's class if the overrided method's class is further up the inheritance hierarchy.
+
[[Image:CDTExpandSelection.png]]
  
Contrary to JDT, several messages are sometimes generated on one marker (e.g. when the same method is overridden through several base classes).
+
The behaviour is strictly analogous to JDT and the actions are located in "Edit -&gt; Expand Selection To" menu.  
  
=== Selection Expansion ===
+
=== Camel Case Completion  ===
  
The C++ editor now allows to expand the selection to enclosing, next and previous nodes of the AST, as well as restore the hierarchy.
+
The C/C++ now supports camel case completion similar to the one of the JDT. The following additional features are available:
  
[[Image:CDTExpandSelection.png]]
+
*underscore notation (I): <code>FB</code> matches <code>FooBar</code> as well as <code>FOO_BAR</code> or <code>Foo_Bar</code>
 +
*underscore notation (II): you can also type the underscore in the text, in which case matches are explicitly required to contain the underscore. <code>F_B</code> matches <code>FOO_BAR</code>, but not <code>FooBar</code>.
 +
*you don't need to specify all segments: It is OK to omit segments (not the first, however): <code>OTh</code> matches <code>OneTwoThree</code>, even though no characters for <code>Two</code> are specified.
 +
*a segment in the matching name can consist of only upper case letters: <code>IOT</code> matches <code>IONETWO</code>.
  
The behaviour is strictly analogous to JDT and the actions are located in "Edit -> Expand Selection To" menu.
+
[[Image:CDTCamelCaseCompletionDemo.png]]
  
=== Camel Case Completion ===
+
=== Configurable Name Style  ===
  
The C/C++ now supports camel case completion similar to the one of the JDT. The following additional features are available:
+
User-configurable name styles for constants, variables, class fields, getters and setters, and for header, source and test files.  
* underscore notation (I): <code>FB</code> matches <code>FooBar</code> as well as <code>FOO_BAR</code> or <code>Foo_Bar</code>
+
* underscore notation (II): you can also type the underscore in the text, in which case matches are explicitly required to contain the underscore. <code>F_B</code> matches <code>FOO_BAR</code>, but not <code>FooBar</code>.
+
* you don't need to specify all segments: It is OK to omit segments (not the first, however): <code>OTh</code> matches <code>OneTwoThree</code>, even though no characters for <code>Two</code> are specified.
+
* a segment in the matching name can consist of only upper case letters: <code>IOT</code> matches <code>IONETWO</code>.
+
  
[[Image:CDTCamelCaseCompletionDemo.png‎]]
+
[[Image:NameStyle.png]]  
  
=== Configurable Name Style ===
+
=== New Code Formatting Options  ===
  
User-configurable name styles for constants, variables, class fields, getters and setters, and for header, source and test files.
+
New options for formatting of constructor initializer lists, stream output expressions, and inline comments. Numerous improvements to the code formatter.  
  
[[Image:NameStyle.png]]
+
[[Image:CodeStyle.png]]  
  
=== New Code Formatting Options ===
+
=== New Code Templates  ===
  
New options for formatting of constructor initializer lists, stream output expressions, and inline comments. Numerous improvements to the code formatter.
+
New code templates for namespace and class declarations and for C++ test files.  
  
[[Image:CodeStyle.png]]
+
[[Image:CodeTemplates.png]]  
  
=== New Code Templates ===
+
== Refactoring  ==
  
New code templates for namespace and class declarations and for C++ test files.
+
=== Rename Refactoring as Quick Fix  ===
  
[[Image:CodeTemplates.png]]
+
''Rename in workspace'' option in quick fix.  
  
== Refactoring ==
+
[[Image:RenameInWorkspace.png]]
  
=== Rename Refactoring as Quick Fix ===
+
=== Lightweight Rename Refactoring ===
  
''Rename in workspace'' option in quick fix.
+
JDT-style rename refactoring.  
  
[[Image:RenameInWorkspace.png]]
+
[[Image:RenameRefactoring.png]]  
  
=== Lightweight Rename Refactoring ===
+
=== Toggle Function Definition ===
  
JDT-style rename refactoring.
+
Toggle Function Definition moves a function definition inside an C/C++ source editor from one
 +
position to another and preserves correctness.
  
[[Image:RenameRefactoring.png]]
+
[[Image:cdt_t_toggle_member.png]]
  
== Codan ==
+
== Codan ==
  
=== Error Markers for Unresolved Symbols ===
+
=== Error Markers for Unresolved Symbols ===
  
Codan now has a checker which generates Problems on instances of ProblemBindings in AST, generated by the Parser. This allows to reveal many errors while typing.
+
Codan now has a checker which generates Problems on instances of ProblemBindings in AST, generated by the Parser. This allows to reveal many errors while typing.  
  
Quick fixes are provided for a subset of problems. As for now, the available fixes are:
+
Quick fixes are provided for a subset of problems. As for now, the available fixes are:  
* Name resolution problem:
+
** Create Local Variable
+
** Create Field
+
** Create Parameter
+
  
[[Image:CDTNameResolutionFix.png]]
+
*Name resolution problem:  
 +
**Create Local Variable
 +
**Create Field
 +
**Create Parameter
  
== API Changes and Migration to CDT 8.0 ==
+
[[Image:CDTNameResolutionFix.png]]
The changes affecting compatibility are listed here. Keep in mind that this list likely does not list all the issues, only some of them.
+
  
 +
== API Changes and Migration to CDT 8.0  ==
  
=== General ===
+
The changes affecting compatibility are listed here. Keep in mind that this list likely does not list all the issues, only some of them.
  
# Deprecated class org.eclipse.core.runtime.PluginVersionIdentifier has been changed to use org.osgi.framework.Version.  See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=318581 bug 318581]
+
<br>
#*  Affected packages: org.eclipse.cdt.managedbuilder.*.
+
# ''Use default'' check box was removed from the New C++ Class dialog. Few protected members related to that check box were removed from org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage class.
+
  
 +
=== General  ===
  
 +
#Deprecated class org.eclipse.core.runtime.PluginVersionIdentifier has been changed to use org.osgi.framework.Version. See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=318581 bug 318581]
 +
#*Affected packages: org.eclipse.cdt.managedbuilder.*.
 +
#''Use default'' check box was removed from the New C++ Class dialog. Few protected members related to that check box were removed from org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage class.
  
=== DSF-GDB ===
+
<br>
 +
 
 +
=== DSF-GDB ===
 +
 
 +
#The interface org.eclipse.cdt.dsf.mi.service.command.output.MIListThreadGroupsInfo.IThreadGroupInfo has four new methods. See [http://bugs.eclipse.org/318230#c21 bug 318230 comment 21]
 +
#*String getUser()
 +
#*String getType()
 +
#*String getCores()
 +
#*String getExecutable()
 +
#The interface org.eclipse.cdt.dsf.gdb.service.command.IGDBControl has a new method: List&lt;String&gt; getFeatures(). See [http://bugs.eclipse.org/322658 bug 322658]
 +
#The interface org.eclipse.cdt.dsf.gdb.service.command.IGDBControl no longer has the three methods: start(...), restart(...) and canRestart(...). Those methods are moved to org.eclipse.cdt.dsf.gdb.service.IGDBProcesses and have a new signature.
 +
#org.eclipse.cdt.dsf.gdb.service.command.GDBControl and org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_0 no longer implement the five methods: start(...), restart(...), canRestart(...), startOrRestart(...), useContinueCommand(...) which are now implemented in org.eclipse.cdt.dsf.gdb.service.command.GDBProcesses and org.eclipse.cdt.dsf.gdb.service.command.GDBProcesses_7_0
 +
#All the constructors of class org.eclipse.cdt.dsf.mi.service.command.commands.MIBreakInsert now take an extra parameter at the end of the parameter list: boolean allowPending. When this parameter is set to true, -break-insert will be used with the -f option, which asks GDB to make the breakpoint pending if the installation fails. This flag can only be enabled for GDB &gt;= 6.8. See [http://bugs.eclipse.org/248595 bug 248595]
 +
#The interface org.eclipse.cdt.dsf.debug.service.IProcesses.IMIProcesses has a new method: IMIContainerDMContext createContainerContextFromGroupId(...). See [http://bugs.eclipse.org/317500 bug 317500]
 +
#The file of constants org.eclipse.cdt.dsf.gdb.internal.ui.preferences.IGdbDebugPreferenceConstants has been removed. It was deprecated and had already been replaced by org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants
 +
#The interface org.eclipse.cdt.dsf.mi.service.IMIRunControl has a new method: IRunMode getRunMode(). See [http://bugs.eclipse.org/334463 bug 334463]
 +
#FinalLaunchSequence has dramatically changed.
 +
#GdbLaunch#addInferiorProcess() is removed.
 +
#GDBControl.InferiorInputOutputInitStep is removed.
 +
#GDBControl_7_0.InferiorInputOutputInitStep is removed.
 +
#The interface IMIRunControl has the new method isTargetAcceptingCommands() as part of [http://bugs.eclipse.org/339047 Bug 339047]
 +
#IGDBControl, GDBControl and GDBControl_7_0, no longer have the three methods: initInferiorInputOutput(), createInferiorProcess() and getInferiorProcess() as part of [http://bugs.eclipse.org/237308 Bug 237308]
 +
#MIInferiorProcess's constructors have changed, and many of its public methods are removed (getState(), getPid(), setPid(), etc) as part of [http://bugs.eclipse.org/237308 Bug 237308]
 +
#CommandFactory#createMIInferiorTTYSet() has changed signature as part of [http://bugs.eclipse.org/237308 Bug 237308]
 +
#The constructor to MIInferiorTTYSet has changed signature as part of [http://bugs.eclipse.org/237308 Bug 237308]
 +
#IGDBProcesses gets the new method attachDebuggerToProcess() as part of [http://bugs.eclipse.org/237306 Bug 237306]
 +
#GdbInferiorProcess no longer exists. Its base class, MIInferiorProcess should be used directly.
 +
#GDBBackend.doInitialize(), GDBControl.doInitialize() and GDBControl_7_0.doInitialize() are now private. Having them as public was a bug that would break versioning of the service. See [http://bugs.eclipse.org/341465 Bug 341465]
 +
#GDBControlDMContext no longer implements IBreakpointsTargetDMContext or IDisassemblyDMContext. Although not an API breaking change it has significant impacts. Mostly that code such as
  
# The interface org.eclipse.cdt.dsf.mi.service.command.output.MIListThreadGroupsInfo.IThreadGroupInfo has four new methods. See [http://bugs.eclipse.org/318230#c21 bug 318230 comment 21]
 
#* String getUser()
 
#* String getType()
 
#* String getCores()
 
#* String getExecutable()
 
# The interface org.eclipse.cdt.dsf.gdb.service.command.IGDBControl has a new method: List<String> getFeatures(). See [http://bugs.eclipse.org/322658 bug 322658]
 
# The interface org.eclipse.cdt.dsf.gdb.service.command.IGDBControl no longer has the three methods: start(...), restart(...) and canRestart(...).  Those methods are moved to org.eclipse.cdt.dsf.gdb.service.IGDBProcesses and have a new signature.
 
# org.eclipse.cdt.dsf.gdb.service.command.GDBControl and org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_0 no longer implement the five methods: start(...), restart(...), canRestart(...), startOrRestart(...), useContinueCommand(...) which are now implemented in org.eclipse.cdt.dsf.gdb.service.command.GDBProcesses and org.eclipse.cdt.dsf.gdb.service.command.GDBProcesses_7_0
 
# All the constructors of class org.eclipse.cdt.dsf.mi.service.command.commands.MIBreakInsert now take an extra parameter at the end of the parameter list: boolean allowPending.  When this parameter is set to true, -break-insert will be used with the -f option, which asks GDB to make the breakpoint pending if the installation fails.  This flag can only be enabled for GDB >= 6.8.  See [http://bugs.eclipse.org/248595 bug 248595]
 
# The interface org.eclipse.cdt.dsf.debug.service.IProcesses.IMIProcesses has a new method: IMIContainerDMContext createContainerContextFromGroupId(...). See [http://bugs.eclipse.org/317500 bug 317500]
 
# The file of constants org.eclipse.cdt.dsf.gdb.internal.ui.preferences.IGdbDebugPreferenceConstants has been removed.  It was deprecated and had already been replaced by org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants
 
# The interface org.eclipse.cdt.dsf.mi.service.IMIRunControl has a new method: IRunMode getRunMode(). See [http://bugs.eclipse.org/334463 bug 334463]
 
# FinalLaunchSequence has dramatically changed.
 
# GdbLaunch#addInferiorProcess() is removed.
 
# GDBControl.InferiorInputOutputInitStep is removed.
 
# GDBControl_7_0.InferiorInputOutputInitStep is removed.
 
# The interface IMIRunControl has the new method isTargetAcceptingCommands() as part of [http://bugs.eclipse.org/339047 Bug 339047]
 
# IGDBControl, GDBControl and GDBControl_7_0, no longer have the three methods: initInferiorInputOutput(), createInferiorProcess() and getInferiorProcess() as part of [http://bugs.eclipse.org/237308 Bug 237308]
 
# MIInferiorProcess's constructors have changed, and many of its public methods are removed (getState(), getPid(), setPid(), etc) as part of [http://bugs.eclipse.org/237308 Bug 237308]
 
# CommandFactory#createMIInferiorTTYSet() has changed signature as part of [http://bugs.eclipse.org/237308 Bug 237308]
 
# The constructor to MIInferiorTTYSet has changed signature as part of [http://bugs.eclipse.org/237308 Bug 237308]
 
# IGDBProcesses gets the new method attachDebuggerToProcess() as part of [http://bugs.eclipse.org/237306 Bug 237306]
 
# GdbInferiorProcess no longer exists.  Its base class, MIInferiorProcess should be used directly.
 
# GDBBackend.doInitialize(), GDBControl.doInitialize() and GDBControl_7_0.doInitialize() are now private.  Having them as public was a bug that would break versioning of the service. See [http://bugs.eclipse.org/341465 Bug 341465]
 
# GDBControlDMContext no longer implements IBreakpointsTargetDMContext or IDisassemblyDMContext.  Although not an API breaking change it has significant impacts.  Mostly that code such as
 
 
  (IBreakpointsTargetDMContext)fCommandControl.getContext() // Will fail with an Invalid Cast exception
 
  (IBreakpointsTargetDMContext)fCommandControl.getContext() // Will fail with an Invalid Cast exception
 
  (IDisassemblyDMContext)fCommandControl.getContext() // Will fail with an Invalid Cast exception
 
  (IDisassemblyDMContext)fCommandControl.getContext() // Will fail with an Invalid Cast exception
will now fail because the command control context is no longer an IBreakpointsTargetDMContext/IDisassemblyDMContext.  Instead, MIContainerDMC now implements IBreakpointsTargetDMContext/IDisassemblyDMContext.  This change was necessary to fully support multi-process and was done in [http://bugs.eclipse.org/335324 bug 335324] and [http://bugs.eclipse.org/344298 bug 344298].
 
  
=== Codan ===
+
will now fail because the command control context is no longer an IBreakpointsTargetDMContext/IDisassemblyDMContext. Instead, MIContainerDMC now implements IBreakpointsTargetDMContext/IDisassemblyDMContext. This change was necessary to fully support multi-process and was done in [http://bugs.eclipse.org/335324 bug 335324] and [http://bugs.eclipse.org/344298 bug 344298].
 +
 
 +
=== Codan ===
  
# The class org.eclipse.cdt.codan.core.cxx.model.CxxModelsCache is no longer a singleton.
+
#The class org.eclipse.cdt.codan.core.cxx.model.CxxModelsCache is no longer a singleton.
  
== Bugs Fixed in this Release ==
+
== Bugs Fixed in this Release ==
  
 
[https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;resolution=FIXED;target_milestone=8.0;product=CDT;classification=Tools Fixed in CDT 8.0]
 
[https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;resolution=FIXED;target_milestone=8.0;product=CDT;classification=Tools Fixed in CDT 8.0]

Revision as of 03:04, 1 June 2011

Build

Console

  • The "C-Build console" is now named "CDT Build Console"
  • It is now possible to open the CDT Build Console before performing a build. See bug 320765. Note that operations on the console will require the user to first select a project. The below screenshot shows the new access to the CDT Build Console.

CDTConsoleStart.jpg

  • "CDT Global Build Console" got introduced. This console combines output from all referenced projects being built in one view. See bug 309113.

CDTGlobalBuildConsole.jpg

  • Differentiate color highlighting in build output for error, warning and info problem markers. See bug 307211.

Bug 307211.png

Error Parsers

  • Added ability to reset individual error parsers in preferences. Also icons to indicate status, such as "user", "extension" icons and "wrench" overlay for customized parsers, bug 302720.

Bug-302720-ResetErrorParser.png

Make Targets

  • Rebuild Last Target F9 got a new option in preferences - to rebuild last target from a whole project including subfolders. This preference is the default now. bug 333113.

Bug-333113-LastMakeTarget.png

  • Source folders are shown in collapsed form now in Make Targets View, similarly as they are shown in Project Explorer. bug 339015.

Bug-339015-MakeTargetView-SrcRoots.png

Managed Build

  • By default, there will be a space added after "-o" option and its value in compiler/linker commands in the generated makefiles. That stands for other applicable options as well. See bug 232373.
g++  -o "Hello.exe"  ./src/Hello.o

Scanner Discovery

  • It is possible now to clear old built-in include paths and symbols left after compiler upgrade in Paths&Symbols in project properties. The "Clean" button was introduced on "Scanner Discovery" page. See bug 206372.
  • You can now inspect the output of command to collect built-in compiler include paths and symbols, bug 342069.

DiscoveryTab.png

Debug

Project-less debugging

CDT can now be used to debug any binary, without needing to specify or even create a project in Eclipse. This is supported for all types of debugging (local, remote, attach, and post-mortem sessions).

Furthermore, for an attach session (local or remote), there is even no need to specify the binary; for a local attach, GDB can find the binary automatically, while for a remote attach, CDT will prompt for it when it needs it.

Noprojectdebug.png

This feature was completed April 26th, 2011 as part of Bug 343861

Support for full pretty-printing of complex structures

With the proper setup of GDB, DSF-GDB will now print complex structures such as Maps, Lists and Vectors, in a user-friendly fashion, within the Variables and Expressions views, as well as the advanced Debug hover of the Editor. See below on how to setup GDB for this feature to work.


Without pretty-printing:

NoPrettyPrint.png


With pretty-printing:

FullPrettyPrint.png


This feature has been contributed by Jens Elmenthaler to CDT 8.0 as of November 4th, 2010, as part of Bug 302121


Configuring GDB for pretty-printing:

  • You will need to have python installed on your machine
  • If you want to pretty-print STL structures, you will need the Python pretty-printers for STL. Check-out the latest Python libstdc++ printers to a place on your machine. (Note that you can create your own pretty-printers for any complex-structure). In a local directory, do:
   svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
  • You will need to create a gdbinit file to tell GDB where the pretty-printers are. Create a gdbinit file with the following 6 lines. The path needs to match where the python module above was checked-out. So if checked out to: /home/marc/gdb_printers/, the path would be as written in the example:
 python
import sys
sys.path.insert(0, '/home/marc/gdb_printers/python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end
  • You will need GDB 7.0 or later. GDB 7.2 is recommended because it has some bug fixes for the pretty-printing.
  • In your DSF-GDB launch, make sure you use the right GDB and the right gdbinit file

Support for pending breakpoints

When a breakpoint is set in a dynamically-linked library that was not loaded yet, the breakpoint will now work, once the library is loaded. See bug 248595. This feature is currently only supported when using GDB 6.8 or later.

Showing cores in Debug view labels

By using the enhancements of GDB 7.1, DSF-GDB now shows the core on which each thread runs as an extra part of the Debug View label. The list of all cores on which a process is located is also added as a label. The below image shows the new feature.

CoreLabels.png

This feature has been implemented for CDT 8.0 as of July 6th, 2010, as part of Bug 318230. The feature will be enabled automatically as long as GDB 7.1 or greater is used.

Showing cores and owner in attach prompter

DSF-GDB now shows the owner of a process as an extra part of the process prompt for an attach session. The owner id will be shown starting with GDB 7.0. For a Remote attach session (using gdbserver --multi), the cores on which a process is located will also be shown. Showing the cores starts with GDB 7.1. The below image shows the new feature.

UserAndCores.jpg

This feature has been implemented for CDT 8.0 as of July 30th, 2010, as part of Bug 318230 comment 21. The feature will be enabled automatically as long as the proper version of GDB is used.

Pin & Clone

Variables, Expressions, Registers, Disassembly, and Memory Browser now supports opening multiple instances, and pin the view input to the selected debug context(s) in the Debug view. This can be used, for example, to easily compare the data of different threads.

PinCloneDebug.png

This feature has been implemented for CDT 8.0 as of Feb 15th, 2011, as part of Bug 327263, Bug 331781, and Bug 334566.

Multi-process Debugging

CDT now supports debugging multiple processes in a single debug session. It allows to attach/detach and start/stop processes repeatedly and easily.

Requirements:

  • GDB 7.2 or greater
  • Currently, only Non-Stop debugging sessions support multiple processes.
  • Note that this feature was developed and tested on Linux systems, and may not work on Windows.

To use multi-process debugging, simply launch an application as you normally would, locally or remotely, using gdbserver, and make sure to select Non-stop mode in the Debugger tab. Then, use the Debug View's "Connect" button to trigger a dialog with allows you to either attach to a running process, or to create a new process using the "New..." button. Currently, the "New..." button is only supported for Local debug sessions.

MultiAttachDialog.png


You will then have the newly selected process added to your debug session, where you can control it and examine it. You can use the "Disconnect" button to remove processes from your debug session, or you can use the "Connect" button to add new ones.

MultiProducerConsumer.png


An option to automatically attach to a forked process is also available. This means that whenever any process you are currently debugging forks a new process, that new process will be added to your debug session.


AutoAttachOption.png

C/C++ Remote Application launch

The optional "C/C++ Remote Application" launch configuration type has been made permanent for CDT.

Debugconfig.jpg

The "GDB (DSF) Remote System Process" launch delegate has been renamed to "GDB (DSF) Manual Remote Debugging" and has been moved from "C/C++ Application" to "C/C++ Remote Application". As was the case for CDT 7.0, the optional RSE Remote Launch delegate of org.eclipse.cdt.launch.remote, is still part of "C/C++ Remote Application".

This optional remote launch now provides a new DSF-GDB-based launch delegate called "GDB (DSF) Automatic Remote Debugging". This launch is very similar to the existing "GDB (DSF) Manual Remote Debugging" delegate, except that the automatic one will automatically download the application to the remote target and start gdbserver with the application.

RemoteDelegates.jpg

By default, the user will be shown the "GDB (DSF) Manual Remote Debugging". However, if the optional feature of Remote Launch is installed, the default will automatically become the more feature-rich "GDB (DSF) Automatic Remote Debugging".

Finally, the run-mode RSE Remote Launch delegate no longer shows the Debugger or Source tabs, since they were not relevant, in run-mode.

New set of preferences

A set of new preferences have been added to Preferences->C/C++->Debug->GDB to allow users to have a better debugging experience. These new preference are:

  • Default GDB path and initialization file: default path for the location of GDB as well as for the GDB initialization file.
  • Default behavior for Stop on startup: default behavior to stop the execution on startup, and on what symbol.
  • Default Non-stop mode: default behavior to automatically enable non-stop mode or not. Non-stop mode allows to control the execution of threads and processes independently.
  • Default limit for GDB Traces: limits the amount of traces printed on the gdb traces console
  • Default enabling of pretty-printing: assuming a pretty-printing enabled GDB, automatically enabled pretty-printing in CDT
  • Default child limit for pretty-printing: default to control the amount of children automatically shown by a pretty-printer


DefaultGdbPreference.png


The values of most of these preferences will be used to populate the corresponding entries of the Debugger tab, whenever a new launch is created.


LaunchDefaultGdb.png


This feature has been implemented for CDT 8.0 as as part of Bug 120162, Bug 347245 and Bug 335895.

Non-stop attach does not interrupt the process

As part of Bug 333284 attaching to a process in non-stop mode will no longer interrupt the process.

Extra node for debugged process no longer shown

The debugged process extra launch node has been removed from the Debug view. This node was felt to waste space, especially when dealing with multi-process debugging as we would have needed many of them. The Debug view already shows the debugged process as a container of threads, right below the launch node.

WithInferior.png

Editor

Override Markers

In C++ files, method declarations and definitions are annotated on the vertical bar using three types of symbols:

  • Override (green triangle) indicating that a virtual method in one of base classes is overridden,
  • Implement (empty blue triangle) indicating that a pure virtual (abstract) method in one of base classes is overridden,
  • Shadow (dark blue triangle) indicating that a method in one of base classes with the same paremeter set is shadowed.

CDTOverrideMarkers.png

As in JDT, the annotations have the action which allows to go to the declaration in base.

In case of multiple inheritance, the messages also contain the name of direct base class of the overriding method's class if the overrided method's class is further up the inheritance hierarchy.

Contrary to JDT, several messages are sometimes generated on one marker (e.g. when the same method is overridden through several base classes).

Selection Expansion

The C++ editor now allows to expand the selection to enclosing, next and previous nodes of the AST, as well as restore the hierarchy.

CDTExpandSelection.png

The behaviour is strictly analogous to JDT and the actions are located in "Edit -> Expand Selection To" menu.

Camel Case Completion

The C/C++ now supports camel case completion similar to the one of the JDT. The following additional features are available:

  • underscore notation (I): FB matches FooBar as well as FOO_BAR or Foo_Bar
  • underscore notation (II): you can also type the underscore in the text, in which case matches are explicitly required to contain the underscore. F_B matches FOO_BAR, but not FooBar.
  • you don't need to specify all segments: It is OK to omit segments (not the first, however): OTh matches OneTwoThree, even though no characters for Two are specified.
  • a segment in the matching name can consist of only upper case letters: IOT matches IONETWO.

CDTCamelCaseCompletionDemo.png

Configurable Name Style

User-configurable name styles for constants, variables, class fields, getters and setters, and for header, source and test files.

NameStyle.png

New Code Formatting Options

New options for formatting of constructor initializer lists, stream output expressions, and inline comments. Numerous improvements to the code formatter.

CodeStyle.png

New Code Templates

New code templates for namespace and class declarations and for C++ test files.

CodeTemplates.png

Refactoring

Rename Refactoring as Quick Fix

Rename in workspace option in quick fix.

RenameInWorkspace.png

Lightweight Rename Refactoring

JDT-style rename refactoring.

RenameRefactoring.png

Toggle Function Definition

Toggle Function Definition moves a function definition inside an C/C++ source editor from one position to another and preserves correctness.

Cdt t toggle member.png

Codan

Error Markers for Unresolved Symbols

Codan now has a checker which generates Problems on instances of ProblemBindings in AST, generated by the Parser. This allows to reveal many errors while typing.

Quick fixes are provided for a subset of problems. As for now, the available fixes are:

  • Name resolution problem:
    • Create Local Variable
    • Create Field
    • Create Parameter

CDTNameResolutionFix.png

API Changes and Migration to CDT 8.0

The changes affecting compatibility are listed here. Keep in mind that this list likely does not list all the issues, only some of them.


General

  1. Deprecated class org.eclipse.core.runtime.PluginVersionIdentifier has been changed to use org.osgi.framework.Version. See bug 318581
    • Affected packages: org.eclipse.cdt.managedbuilder.*.
  2. Use default check box was removed from the New C++ Class dialog. Few protected members related to that check box were removed from org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage class.


DSF-GDB

  1. The interface org.eclipse.cdt.dsf.mi.service.command.output.MIListThreadGroupsInfo.IThreadGroupInfo has four new methods. See bug 318230 comment 21
    • String getUser()
    • String getType()
    • String getCores()
    • String getExecutable()
  2. The interface org.eclipse.cdt.dsf.gdb.service.command.IGDBControl has a new method: List<String> getFeatures(). See bug 322658
  3. The interface org.eclipse.cdt.dsf.gdb.service.command.IGDBControl no longer has the three methods: start(...), restart(...) and canRestart(...). Those methods are moved to org.eclipse.cdt.dsf.gdb.service.IGDBProcesses and have a new signature.
  4. org.eclipse.cdt.dsf.gdb.service.command.GDBControl and org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_0 no longer implement the five methods: start(...), restart(...), canRestart(...), startOrRestart(...), useContinueCommand(...) which are now implemented in org.eclipse.cdt.dsf.gdb.service.command.GDBProcesses and org.eclipse.cdt.dsf.gdb.service.command.GDBProcesses_7_0
  5. All the constructors of class org.eclipse.cdt.dsf.mi.service.command.commands.MIBreakInsert now take an extra parameter at the end of the parameter list: boolean allowPending. When this parameter is set to true, -break-insert will be used with the -f option, which asks GDB to make the breakpoint pending if the installation fails. This flag can only be enabled for GDB >= 6.8. See bug 248595
  6. The interface org.eclipse.cdt.dsf.debug.service.IProcesses.IMIProcesses has a new method: IMIContainerDMContext createContainerContextFromGroupId(...). See bug 317500
  7. The file of constants org.eclipse.cdt.dsf.gdb.internal.ui.preferences.IGdbDebugPreferenceConstants has been removed. It was deprecated and had already been replaced by org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants
  8. The interface org.eclipse.cdt.dsf.mi.service.IMIRunControl has a new method: IRunMode getRunMode(). See bug 334463
  9. FinalLaunchSequence has dramatically changed.
  10. GdbLaunch#addInferiorProcess() is removed.
  11. GDBControl.InferiorInputOutputInitStep is removed.
  12. GDBControl_7_0.InferiorInputOutputInitStep is removed.
  13. The interface IMIRunControl has the new method isTargetAcceptingCommands() as part of Bug 339047
  14. IGDBControl, GDBControl and GDBControl_7_0, no longer have the three methods: initInferiorInputOutput(), createInferiorProcess() and getInferiorProcess() as part of Bug 237308
  15. MIInferiorProcess's constructors have changed, and many of its public methods are removed (getState(), getPid(), setPid(), etc) as part of Bug 237308
  16. CommandFactory#createMIInferiorTTYSet() has changed signature as part of Bug 237308
  17. The constructor to MIInferiorTTYSet has changed signature as part of Bug 237308
  18. IGDBProcesses gets the new method attachDebuggerToProcess() as part of Bug 237306
  19. GdbInferiorProcess no longer exists. Its base class, MIInferiorProcess should be used directly.
  20. GDBBackend.doInitialize(), GDBControl.doInitialize() and GDBControl_7_0.doInitialize() are now private. Having them as public was a bug that would break versioning of the service. See Bug 341465
  21. GDBControlDMContext no longer implements IBreakpointsTargetDMContext or IDisassemblyDMContext. Although not an API breaking change it has significant impacts. Mostly that code such as
(IBreakpointsTargetDMContext)fCommandControl.getContext() // Will fail with an Invalid Cast exception
(IDisassemblyDMContext)fCommandControl.getContext() // Will fail with an Invalid Cast exception

will now fail because the command control context is no longer an IBreakpointsTargetDMContext/IDisassemblyDMContext. Instead, MIContainerDMC now implements IBreakpointsTargetDMContext/IDisassemblyDMContext. This change was necessary to fully support multi-process and was done in bug 335324 and bug 344298.

Codan

  1. The class org.eclipse.cdt.codan.core.cxx.model.CxxModelsCache is no longer a singleton.

Bugs Fixed in this Release

Fixed in CDT 8.0

Copyright © Eclipse Foundation, Inc. All Rights Reserved.