This is the mail archive of the
mailing list for the GDB project.
Display content of unicode std::wstring objects
- From: "Fredrik Orderud" <fredrik dot orderud at idi dot ntnu dot no>
- To: <gdb at sourceware dot org>
- Date: Fri, 15 Aug 2008 15:12:54 +0200
- Subject: Display content of unicode std::wstring objects
Is there any in-build support for displaying the content of C++ STL unicode
text-strings in gdb?
In my C++ program I have a lot of std::wstring objects, and I want a
convenient way to display the content of these unicode strings from gdb
whenever I break my program. Currently, I just dump the content of the
memory area manually with "x/20c str_obj._M_dataplus._M_p" (for a
"std::wstring str_obj" object), but this is inconvenient due to the
"_M_dataplus._M_p" subfields and results in a very verbose listing. You also
need to know the string length in advance with this approach.
On my machine I run Fedora linux 9, with gcc/g++ 4.3.0 and gdb 6.8.
Thanks in advance