Xcode 4.1 custom DataFormatter suite

I am trying to create my own Formatter dataset to allow me to print things like STL containers more nicely, etc.

I followed the instructions on the Internet, and I can, however, it seems I canโ€™t get the package code to run. All I can do is get Xcode to say โ€œSummary Unavailableโ€ when my data formatter is copied to / Developer / Library / Xcode / CustomDataViews /

I created my package with the Xcode "bundle" template and put it in my C ++ file:

#include "/Developer/Library/Xcode/PrivatePlugIns/DebuggerFoundation.ideplugin/Contents/Headers/DataFormatterPlugin.h" #include "Hi.h" _pbxgdb_plugin_function_list *_pbxgdb_plugin_functions = NULL; char * printHi( Hi * obj, int Id) { char * result = (char*)(_pbxgdb_plugin_functions->allocate(Id,100)); sprintf( result, "%s", obj->string ); return result; } 

If the Hi object is trivial:

 #include <stdio.h> #include <string.h> class Hi { public: Hi( char * str ) { string = new char[strlen(str)+1]; strcpy( string, str ); } ~Hi() { delete( string ); } void print( void ) { printf( "%s", string ); } char * string; }; 

I know that my problem is not with my .plist file, because if I put the following in the StringSummary field, it will print the string field;

 %string%:s 

However, if I put this in: (Yes, I associate this with the Hi * object, not the Hi object.)

 {(char *)printHi($VAR, $ID)}:s 

All I can find is this resume is not available. I am debugging a simple project:

 #include "hi.h" void foo( Hi * obj ) { obj->print(); } int main( void ) { Hi h( "test!" ); foo( &h ); return 1; } 

Anyone have any tips on debugging debuggers ?: P

+4
source share
1 answer

There is a product> Debug> Shared Libraries - you have to check if your package is loaded. It also seems that you can use any functions from the currently running target, but the _pbxgdb_plugin_function_list variable seems to be NULL at this point.

+1
source

All Articles