This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug c++/12383] error printing elements in vector from C++ program
- From: "keiths at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Thu, 17 Feb 2011 21:46:45 +0000
- Subject: [Bug c++/12383] error printing elements in vector from C++ program
- Auto-submitted: auto-generated
- References: <bug-12383-4717@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=12383
Keith Seitz <keiths at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |keiths at redhat dot com
--- Comment #1 from Keith Seitz <keiths at redhat dot com> 2011-02-17 21:46:31 UTC ---
The problem here is that the user's program does not use
std::vector::operator[], so the compiler omits it.
Unfortunately, in order to use operator[] at the command prompt, your program
*must* include it. Or more specifically, the compiler/linker must include it.
If you add a call to operator[] in your program, everything should just
"magically" work (at least it does for me):
(gdb) p myvector[0]
$1 = (int &) @0x603010: 0
Various ideas are floating around on how to further address this issue, but
nothing definitive has been decided yet.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.