This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/7: cout << 1 doesn't work for c++
- To: gdb-gnats at sources dot redhat dot com
- Subject: gdb/7: cout << 1 doesn't work for c++
- From: dill at theforce dot stanford dot edu
- Date: 14 Nov 2000 18:14:40 -0000
- Reply-To: dill at theforce dot stanford dot edu
>Number: 7
>Category: gdb
>Synopsis: cout << 1 doesn't work for c++
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Nov 14 10:18:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: David Dill
>Release: unknown-1.0
>Organization:
>Environment:
Pentium 3
Redhat 6.2
GCC 2.95
>Description:
p cout << 1 doesn't work for C++.
Message:
Argument list of operator<< mismatch with component in the structure.
>How-To-Repeat:
Here is a log:
squash>cat hello.cpp
#include <iostream.h>
void main()
{
cout << "Hello world" << endl;
}
squash>gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.95.1/specs
gcc version 2.95.1 19990816/Linux (release)
squash>gcc -ggdb hello.cpp -lstdc++ -o hello
gcc -ggdb hello.cpp -lstdc++ -o hello
squash>gdb hello
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) break main
Breakpoint 1 at 0x804a6a6: file hello.cpp, line 5.
(gdb) run
Starting program: /squash/squash2/dill/TEMP/hello
Breakpoint 1, main () at hello.cpp:5
5 cout << "Hello world" << endl;
(gdb) p cout << 1
Argument list of operator<< mismatch with component in the structure.
(gdb) p cout << "a string"
Argument list of operator<< mismatch with component in the structure.
(gdb) info function <<
All functions matching regular expression "<<":
(gdb) quit
The program is running. Exit anyway? (y or n) y
1.710u 0.140s 0:56.71 3.2% 0+0k 0+0io 1326pf+0w
squash>
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: