Author Topic: Problems with Watches in CodeBlocks Debugger  (Read 8646 times)

Offline blinkinhek

  • Multiple posting newcomer
  • *
  • Posts: 17
Problems with Watches in CodeBlocks Debugger
« on: September 28, 2012, 03:02:11 pm »
I am desperate to get v10.05 (Mingw32) debug watches working properly. To enable this in context I created a new wxWidgets Frame-base project, built and debugged the code as created by IDE. I specifically debugged the 'OnAbout' method:
Code
void testFrame::OnAbout(wxCommandEvent &event)
{
    wxString msg = wxbuildinfo(long_f);
    wxMessageBox(msg, _("Welcome to..."));
}

The CodeBlocks debug window for the msg wxString object after the wxbuildinfo had been assigned is as shown below. This is from the 'Local Variables' section of the debug window.  This shows no string data.  I also tried assigning 'msg' to a watch, but again this shows no string data (simply shows msg="".

If I hover the mouse over the variable in the code window, then the debugger displays an error message saying msg does not exist in this context. The debugger log shows the message "No symbol "wxStringData" in current context."
Other variables and arguments do appear to be shown correctly in the debug window.

According to the codeblocks website, I should get the screen as shown in the second capture below.

I uninstalled CodeBlocks, downloaded and reinstalled, but this did not help.

This debug function did always work on previous builds.... but I am sure it is something I am doing wrong. Can anyone help??

[attachment deleted by admin]

Offline blinkinhek

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: Problems with Watches in CodeBlocks Debugger
« Reply #1 on: September 28, 2012, 04:25:59 pm »
I downloaded the old v8.02 from sourceforge and installed.  This always worked for me.

However, now, this exhibits the same problem ... so something in my setup has changed and I don't know what....
... despair has set in

Offline gd_on

  • Lives here!
  • ****
  • Posts: 797
Re: Problems with Watches in CodeBlocks Debugger
« Reply #2 on: September 28, 2012, 06:18:12 pm »
Not sure if it's your problem, but on your second screen capture the break point is on the line containing your instruction wxMessageBox... In that case, the instruction has not been still executed, so variable msg is not still filled with your string.
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline blinkinhek

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: Problems with Watches in CodeBlocks Debugger
« Reply #3 on: September 28, 2012, 06:39:07 pm »
Not sure if it's your problem, but on your second screen capture the break point is on the line containing your instruction wxMessageBox... In that case, the instruction has not been still executed, so variable msg is not still filled with your string.


The second image is from the codeblocks wiki rather than the program.  Having said that, with the break on the wxMessageBox line of code, then the assignment to msg will have been performed.

Offline blinkinhek

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: Problems with Watches in CodeBlocks Debugger
« Reply #4 on: September 28, 2012, 06:52:21 pm »
just found this in the forum, from a google search http://forums.codeblocks.org/index.php/topic,15050.msg101768.html#msg101768
It does not show the contents of the wxString object in 'Local Variables' but does show the string if I assign the object to a watch.