Automatically show properties of C++ objects in Xcode debugger

The Xcode debug area can sometimes show a summary of the most important variables inside of an object that's in the list, without the need to expand the object to see it's individual members.

Is there a way for me to teach the debugger about my own C++ objects to do the same? Let's say I have a simple class with a single member variable:

class Foo
{
    int bar;
};

And the debug area should show something like the following:

aVariableOfTypeFoo = (Foo) bar=123

I know that some C++ objects are able to do this (for example std::vector shows it's size), but I wasn't able to figure out if this is somehow configurable, or if it's built-in in the debugger/Xcode itself.

I'm using Xcode 5.0.1

Thanks

Answers


You can change the summary description for a given type selecting Edit Summary Format... by right clicking on a variable of that type.

The format in your case is pretty simple and will look like this: bar = {$VAR.bar} For more information about formats check the "Using Data Formatters" section in the Xcode User Guide (pages 42 & 43).


Need Your Help

Error while Importing v7 appcombat for Action bar

java android eclipse android-activity sdk

while importing v7 appcombat file for Action bar, it is not importing the project even after clicking the finish button many times.Also it is not showing any error. The screen remains unresponsive ...

ER Diagram - relationhip

sql database

What can be the best relationship for disease and symptom?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.