I am trying to figure out a problem in my c++ code and have DDD to debug with on a Sun machine. I am required to use strings per some standard we have. But whenever DDD encounters a string variable, it always comes up as being empty. I want to remember having the same trouble using CVD before on an SGI.
Short of re-writing my code to remove string is there anything else I could try/use?
Asked
Active
Viewed 541 times
5

Gilles 'SO- stop being evil'
- 104,111
- 38
- 209
- 254

mdeliota
- 51
- 1
-
2Do you mean the c++ class 'string' or just strings in general? – Seamus Connor Feb 03 '10 at 17:06
3 Answers
0
Basically, you need to create a wrapper function that prints out your string, by passing it a memory address:
void gs(string &s) { cout << s << endl; }
and then in gdb:
call gs(somevariable)

Seamus Connor
- 1,765
- 1
- 18
- 24