From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,f45ff7545658efb7,start X-Google-Attributes: gidfee84,public From: pth@belbone.be (Pierre Theate) Subject: GDB and C++ problem Date: 1999/09/14 Message-ID: <7rllu8$dgr$1@news0.skynet.be>#1/1 X-Deja-AN: 524986677 X-Complaints-To: abuse@skynet.be X-Trace: news0.skynet.be 937319176 13851 195.13.1.178 (14 Sep 1999 14:26:16 GMT) Organization: Belgacom Multimedia & Infohighways NNTP-Posting-Date: 14 Sep 1999 14:26:16 GMT Newsgroups: comp.unix.osf.osf1 Hi wizards, I can use gdb with C program but have some trouble with C++. For example, see folowing gdb session : > more pth.cpp 1 #include 2 3 void 4 main (void) 5 { 6 int i = 1; 7 8 i++; 9 cout << "i = " << i << endl; 10 } > g++ -g pth.cpp > gdb a.out GNU gdb 4.17 .. (gdb) b 6 Breakpoint 1 at 0x12000a6e8: file pth.cpp, line 6. (gdb) r Starting program: /shared/home/rtrp/tmp/a.out Breakpoint 1, main () at pth.cpp:6 6 int i = 1; (gdb) n 8 i++; (gdb) n 9 cout << "i = " << i << endl; (gdb) print i $1 = 2 (gdb) n operator::operator<< (this=0x14002e600, s=0x0) at iostream.cc:765 765 { (gdb) I use 'next' command but gdb step in cout operator source code ! Do you have the same behaviour on your system ? My system is Digital OSF1 V4.0 878 alpha. Any help would be greatly apreciated. Pierre. -------------------------------------------- Pierre Theate Belgacom, Multimedia & Infohighways division e-mail: pth@belbone.be phone: +32 2 202.44.45.