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 python/10646] New: pretty printers should also work for std::__debug::vector et al.


When code is compiled with -D_GLIBCXX_DEBUG, then std::vector is replaced with
std::__debug::vector.

Our pretty-printers should work on those as well.

Example:

#include <vector>

int main()
{
  std::vector<int> v;
  v.push_back(1);
  return 0;  // break here
}

g++ -g t.cc
gdb64-cvs -q ./a.out

(gdb) b 7
Breakpoint 1 at 0x4007b4: file t.cc, line 7.
(gdb) r

Breakpoint 1, main () at t.cc:7
7         return 0;  // break here
(gdb) p v
$1 = std::vector of length 1, capacity 1 = {1}

g++ -g t.cc -D_GLIBCXX_DEBUG
gdb64-cvs -q ./a.out

(gdb) b 7
Breakpoint 1 at 0x400aa4: file t.cc, line 7.
(gdb) r

Breakpoint 1, main () at t.cc:7
7         return 0;  // break here
(gdb) p v
$1 = {<std::__norm::vector<int, std::allocator<int> >> =
{<std::__norm::_Vector_base<int, std::allocator<int> >> = {
      _M_impl = {<std::allocator<int>> = {<__gnu_cxx::new_allocator<int>> = {<No
data fields>}, <No data fields>}, _M_start = 0x603010, 
        _M_finish = 0x603014, 
        _M_end_of_storage = 0x603014}}, <No data fields>},
<__gnu_debug::_Safe_sequence<std::__debug::vector<int, std::allocator<int> > >>
= {<__gnu_debug::_Safe_sequence_base> = {_M_iterators = 0x0, _M_const_iterators
= 0x0, _M_version = 2}, <No data fields>}, 
  _M_guaranteed_capacity = 1}
(gdb) q

-- 
           Summary: pretty printers should also work for
                    std::__debug::vector et al.
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: python
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: ppluzhnikov at google dot com
                CC: gdb-prs at sourceware dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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