2015-05-27から1日間の記事一覧

gdbでvectorなどの中身をprintする

C++

gdbでvectorなどSTLのコンテナの中身をprintしようとすると、例えば以下のようにうまく表示できません。 (gdb) p x1 $1 = {<std::_Vector_base<int, std::allocator<int> >> = { _M_impl = {<std::allocator<int>> = {<__gnu_cxx::new_allocator<int>> = {<No data fields>}, <No data fields>}, _M_start = 0x8003b9e8, _M_finish = 0x8003b9fc, _M_end_of_storage …</no></no></__gnu_cxx::new_allocator<int></std::allocator<int></std::_vector_base<int,>