customized display of e.g. std::string?

Geert Kloosterman <[email protected]>
Newsgroups gmane.comp.debugging.ddd.general
Message-ID <[email protected]>
Hi all,

When I display a std::string in DDD, the display looks somewhat like
this:

1. s
npos = 429457295
_M_dataplus = {...}


The content of the string isn't immediately visible, I have to dive into
the structure to see what's in there.

Is there a way to customize the display of std::string items?

I can print/display the string itself, either using s._M_dataplus._M_p
or using s.c_str().  It would be nice to have its display look more like
that of a char *:

3. pointervar
0xbfd9ea54 "this is my char* string"

Another, more fancy display would be something like this:
42. s
c_str()    = "my std::string value"
length()   = 20
capacity() = 20


Would it be possible to instruct DDD to display all std::string types
like this?  Could this be done by writing a DDD theme?

Such a custom display could be useful for other structures as well.

Best regards,
Geert Kloosterman

_______________________________________________
ddd mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/ddd
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.