[lldb-dev] Custom formatter request

Somorjai, Akos ASomorjai at graphisoft.com
Mon Dec 10 07:35:21 PST 2012


Hello everyone,

I need a little help with a custom formatter for the class below; I'd appreciate if someone could throw together a skeleton I can start from.

Thanks,

Akos


Here's the class layout:

class UniString {

private:
	struct SharedBuffer;

	SharedBuffer*	content;	// shared buffer storing content of the string

		// Implementation classes and structures

	struct SharedBuffer {
		USize			length;			// length of the string in UniChar::Layout units
		USize			capacity;		// capacity of the allocated buffer in UniChar::Layout units
		SInt32			refCounter;		// stores number of references to this shared buffer
		char			reserved[2];		// padding reserved for the future use
		unichar			string[1];			// buffer storing content of the string (extends beyond of the SharedBuffer)

		inline SharedBuffer ();
		inline SharedBuffer (USize initialLength, USize initialCapacity, Int32 initialRefCounter);
	};
…
};





More information about the lldb-dev mailing list