Can DDD log strings?

I am trying to figure out a problem in my C ++ and DDD code for debugging on a Sun machine. I have to use strings according to some standard that we have. But whenever a DDD encounters a string variable, it always looks empty. I want to remember that I have the same problem using CVD before on SGI.
With the exception of re-writing my code to delete the line, is there anything else I could try / use?

+5
source share
3 answers

Look here

They solve it by implementing a helper function that can be used by gdb (should also work for DDD since it uses gdb)

+1
source
p variablename.c_str()

or

display variablename.c_str()
+1
source

Basically, you need to create a wrapper function that prints your string by passing it a memory address:

void gs(string &s) { cout << s << endl; }

and then in gdb:

call gs(somevariable)

Link

0
source

All Articles