Bug #17191 2010-05-27 15:45

mmccarty12

wxStrings display value when CL gdb, not in Watches

I say Applicationi: Error because I am not sure if it is that or Debugging.

wxStrings when displayed in the watch window do not display the actual value, they only show the value as "", even when you change the type of watch.  I ran through all the options of undefined, unsigned, binary, decimal, hexidecimal, and char.  None of the trees showed the actual value of the variable.  When running the program from the command line through the gdb () debugger, I got the following output:

[quote]
Output from command line gdb print wxString variable:
{static npos = 18446744073709551615, static ms_cache =
   {cached =
      {
         {str = 0x7fffa61ad130, pos = 0, impl = 0, len = 18446744073709551615},
         {str = 0x7fffa61acf20, pos = 0, impl = 0, len = 18446744073709551615},
         {str = 0x7fffa61ad160, pos = 0, impl = 0, len = 18446744073709551615},
         {str = 0x126efaf8, pos = 0, impl = 0, len = 18446744073709551615},
         {str = 0x126efb58, pos = 0, impl = 0, len = 18446744073709551615},
         {str = 0x7fffa61ace40, pos = 0, impl = 0, len = 18446744073709551615},
         {str = 0x7fffa61acdc0, pos = 0, impl = 0, len = 18446744073709551615},
         {str = 0x7fffa61ad2b0, pos = 0, impl = 0, len = 18446744073709551615}
      },
      lastUsed = 7
   },
   m_impl = {static npos = 18446744073709551615,
               _M_dataplus =
               {<std::allocator<char>> =
                  {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields> },
                  _M_p = 0x126f6d28 "DEM 3-D 2010.0.0.0"
               }
   },
   m_convertedToChar = {m_str = 0x0, m_len = 0},
   m_convertedToWChar = {m_str = 0x0, m_len = 0},
   m_iterators = {ptr = 0x0}
}
[/quote]

As can be seen 8 lines up, _M_p shows the actual value, but when this is parsed in the watch window, it does not show up this way(I tried to cut and paste the watch window, but had not success, so I cannot show you here).  Any simple program with a wxString in it where you break and try to view the value will show what I am talking about.  There are other wxWidgets objects that have the same problem, but the ones I use and have tried to view lately, do not seem to have an issue.  I do remember the issues from the past.  Another user on the C::B forums, Pecan, appears to have the same problem.  

I do a lot of text file output where I build a wxString and then output it using one of the wx file operations options.  In many cases when debugging the code it is necessary to view the value in the debugger.  As it stands, I have to either wait until the end of the program or at least the file write to view what data is output, or I have to use debugging logs or messages.

Thanks for your time on this.
Category
Application::Error
Group
 
Status
Open
Close date
 
Assigned to
 
ollydbg 2010-06-26 01:24

Could you give a simple test code? wxString value shows quite well in my GDB and C::B.

thanks