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++/12446] Dereferencing iterators


http://sourceware.org/bugzilla/show_bug.cgi?id=12446

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:54:57 UTC ---
Mark, I don't know if a lot has changed recently, but this appears to have been
fixed:

gdb 12446
GNU gdb (GDB) 7.2.50.20110125-cvs
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/keiths/tmp/12446...done.
(gdb) b main
Breakpoint 1 at 0x400d76: file 12446.cc, line 7.
(gdb) r
Starting program: /home/keiths/tmp/12446 

Breakpoint 1, main (argc=1, argv=0x7fffffffe038) at 12446.cc:7
7      std::pair<std::string, std::string> p ("first", "second");
(gdb) n
8      std::vector<std::pair<std::string, std::string> > v;
(gdb) 
10      v.push_back (p);
(gdb) 
12      std::vector<std::pair<std::string, std::string> >::iterator it =
v.begin ();
(gdb) 
14      std::cout << it->first << " : " << it->second << std::endl;
(gdb) p it->first
$1 =  "first"

Can you verify? [BTW, this is using a fresh copy of libstdc++ pretty printers
obtained today.]

-- 
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]