7

I have a C++ project that uses ICU Unicode strings heavily. Recently, I started using the Eclipse CDT IDE, but I cannot watch the contents of the strings while debugging. The only options are printing them to logs or casting them to std::string.

Does anyone know of a way to get Eclipse to show the contents of ICU strings in the "expression" view?

Update: It seems this is a known issue with Eclipse. GDB does not parse the contents of Unicode strings. It's possible to add macros/functions to enable GDB to parse them, but how can I make Eclipse use them in the "expressions" window while debugging?

honk
  • 9,137
  • 11
  • 75
  • 83
WeaselFox
  • 7,220
  • 8
  • 44
  • 75
  • Do you mean `class UnicodeString` or `UChar[]` (which is UTF-16)? – Steven R. Loomis Jan 11 '12 at 19:21
  • I mean `class UnicodeString`, but the debugger will show neither. – WeaselFox Jan 12 '12 at 06:22
  • I haven't ported this to GDB yet, but here's some MSVC code for showing UnicodeString: http://userguide.icu-project.org/dev/codingguidelines#TOC-Windows-Microsoft-Visual-Studio – Steven R. Loomis Jan 13 '12 at 18:45
  • 1
    You probably want to implement a GDB pretty printer for UnicodeString – gvd Nov 25 '13 at 04:17
  • 2
    "the only options are printing them to logs or casting them to std::string." printf debugging is often the only tool you have. get good at it rather than faffing around trying to fix substandard tools. – jheriko Nov 27 '13 at 03:43

0 Answers0