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/Better Debugging (GSoC project)"

< CDT
(Detailed Project Description)
(Detailed Project Description)
Line 10: Line 10:
  
 
== Detailed Project Description ==
 
== Detailed Project Description ==
 +
 
This projects is intended to make debugging with CDT at least as comfortable as with Microsoft Visual Studio.
 
This projects is intended to make debugging with CDT at least as comfortable as with Microsoft Visual Studio.
  
One of main parts of this project is to provide users with more readable representation of their data.
+
=== Custom and Default formatters ===
 +
One of main parts of this project is to provide users with more readable representation of their data. ''Formatter'' is a function that accepts object and returns its human-readable description.
  
For example, when user watches on a <nowiki>vector<int></nowiki> variable he/she expects to see not details of internal implementation of vector, but its contents:
+
For example, when user watches on a vector<int> variable he/she expects to see its content, not details of internal implementation:
 
<source lang="cpp">
 
<source lang="cpp">
 
vector<int> v;
 
vector<int> v;
Line 22: Line 24:
 
should display value of v as {0, 1, 2, 3, 4}.
 
should display value of v as {0, 1, 2, 3, 4}.
  
Displaying an object as a human-readable string will be done via ''Formatters''.
+
Successful completion of this project will implement at least following default formatters for standard STL containers:
 
+
Successful completion of this project will implement at least following default formatters:
+
* All STL containers
+
 
** '''vector''', '''set''', '''multiset''' and '''list''' will display all items formatted in following way: {item1, item2, ... , itemN}.
 
** '''vector''', '''set''', '''multiset''' and '''list''' will display all items formatted in following way: {item1, item2, ... , itemN}.
 
** '''stack''' will display all items formatted in following way: (item1, item2, ... , itemN], where item1 is stack top and itemN is stack bottom.
 
** '''stack''' will display all items formatted in following way: (item1, item2, ... , itemN], where item1 is stack top and itemN is stack bottom.
Line 31: Line 30:
 
** '''priority_queue''' will display all items formatted in following way: (top:item1 other: {item2, ... , itemN}), where item1 is top of the queue and items 2..N are remaining queued items.
 
** '''priority_queue''' will display all items formatted in following way: (top:item1 other: {item2, ... , itemN}), where item1 is top of the queue and items 2..N are remaining queued items.
 
** '''map''', '''multimap''' as {key1->value1, key2->value2, ... , keyN->valueN}.
 
** '''map''', '''multimap''' as {key1->value1, key2->value2, ... , keyN->valueN}.
** '''bitset''' like (0111 1110 10)
+
** '''bitset'''s like (0111 1110 10)
  
 
Of course, all formatters will be applied recursively, thus:
 
Of course, all formatters will be applied recursively, thus:
Line 45: Line 44:
 
matrix.push_back(row2);
 
matrix.push_back(row2);
 
</source>
 
</source>
should display matrix as {{1, 2}, {3, 4}}.
+
will display matrix as {{1, 2}, {3, 4}}.
 +
 
 +
Secondly, all standard C/C++ constructions will also have default formatters:
 +
<source lang="cpp">
 +
T* obj;
 +
</source>
 +
can displayed as "ptr_to: <value of *obj>", or as "null_ptr" if obj is null.
 +
 
 +
<source lang="cpp">
 +
void* obj;
 +
</source>
 +
can be displayed as: ptr_to: <addr>
 +
 
 +
Displaying array of objects should also be intuitive. If '''arr''' is defined as int* it should be able to view it's contents giving watch expression "(int[N]) arr".
 +
 
 +
<source lang="cpp">
 +
struct Point {
 +
  double x, y, z;
 +
};
 +
</source>
 +
Will be formatted as "(x=<value of x>, y=<value of y>, z=<value of z>)".
 +
 
 +
Each structure, array and container will be expandable as a tree with access to all it's fields/items.
 +
 
 +
As per [[CDT/planning/6.0]] there exists bugzilla entry [https://bugs.eclipse.org/bugs/show_bug.cgi?id=237960 237960] which can be covered by this project.
  
 
== Schedule of Code and Deliverables ==
 
== Schedule of Code and Deliverables ==

Revision as of 22:44, 27 March 2009

This page contains detailed description of "Better Debugging Environment" project for Google Summer of Code.

Summary

The goal of this project is to create more user-friendly debugging environment. This includes (but hopefully is not limited to):

  • Default formatter for STL container types (map, vector, queue, priority_queue, ...)
  • Default formatter for user structures.
  • Support for custom formatters.
  • Viewing variable content by simply hovering mouse over it.
  • Fixing usability issues (see below).

Detailed Project Description

This projects is intended to make debugging with CDT at least as comfortable as with Microsoft Visual Studio.

Custom and Default formatters

One of main parts of this project is to provide users with more readable representation of their data. Formatter is a function that accepts object and returns its human-readable description.

For example, when user watches on a vector<int> variable he/she expects to see its content, not details of internal implementation:

vector<int> v;
for (int i = 0; i < 5; i++)
    v.push_back(i);

should display value of v as {0, 1, 2, 3, 4}.

Successful completion of this project will implement at least following default formatters for standard STL containers:

    • vector, set, multiset and list will display all items formatted in following way: {item1, item2, ... , itemN}.
    • stack will display all items formatted in following way: (item1, item2, ... , itemN], where item1 is stack top and itemN is stack bottom.
    • queue and deque will display all items formatted in following way: (item1, item2, ... , itemN), where item1 is front of the queue and itemN is back of the queue.
    • priority_queue will display all items formatted in following way: (top:item1 other: {item2, ... , itemN}), where item1 is top of the queue and items 2..N are remaining queued items.
    • map, multimap as {key1->value1, key2->value2, ... , keyN->valueN}.
    • bitsets like (0111 1110 10)

Of course, all formatters will be applied recursively, thus:

vector<int> row1, row2;
row1.push_back(1);
row1.push_back(2);
row2.push_back(3);
row2.push_back(4);
 
vector< vector<int> > matrix;
matrix.push_back(row1);
matrix.push_back(row2);

will display matrix as {{1, 2}, {3, 4}}.

Secondly, all standard C/C++ constructions will also have default formatters:

T* obj;

can displayed as "ptr_to: <value of *obj>", or as "null_ptr" if obj is null.

void* obj;

can be displayed as: ptr_to: <addr>

Displaying array of objects should also be intuitive. If arr is defined as int* it should be able to view it's contents giving watch expression "(int[N]) arr".

struct Point {
  double x, y, z;
};

Will be formatted as "(x=<value of x>, y=<value of y>, z=<value of z>)".

Each structure, array and container will be expandable as a tree with access to all it's fields/items.

As per CDT/planning/6.0 there exists bugzilla entry 237960 which can be covered by this project.

Schedule of Code and Deliverables

Copyright © Eclipse Foundation, Inc. All Rights Reserved.