This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/12383] error printing elements in vector from C++ program


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]