Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Debug stringstr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 45636 of 47472
Post > Topic >>

Debug stringstream with GDB in general

by ademirzanetti <ademirzanetti@[EMAIL PROTECTED] > Apr 29, 2008 at 09:02 AM

Does anyone know how to debug objects of the type stream in general
using GDB ? I am currently using GDB version 6.4.

There is no much usefull information about it througout the internet.
I am using the tips of the sites below to debug STL containers but I
found nothing about stream.

http://www.yolinux.com/TUTORIALS/GDB-Commands.html#STLDEREF

Basically I need to see the contents on a stringstream as the one on
the program below, but I can not use call either print on a
stringstream object.

#include <iostream>
#include <sstream>

using namespace std;

int main ( int argc, char* argv[] ) {

        cout << "Starting Processing" << endl;

        stringstream l_Str;
        l_Str << "foo";

        cout << "Process finished" << endl;

        return 0;
}

g++ -ggdb -o test test.cpp

gdb ./test

(gdb) break test.cpp:12
(gdb) run

(gdb) call l_Str.str()
Couldn't find method stringstream::str
(gdb) print l_Str.str()
Couldn't find method stringstream::str
(gdb) print l_Str
$1 = <incomplete type>
 




 3 Posts in Topic:
Debug stringstream with GDB in general
ademirzanetti <ademirz  2008-04-29 09:02:15 
Re: Debug stringstream with GDB in general
utab <umut.tabak@[EMAI  2008-04-29 14:07:34 
Re: Debug stringstream with GDB in general
Ian Collins <ian-news@  2008-04-30 09:10:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Aug 29 2:20:14 CDT 2008.