News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Problems with Watches in CodeBlocks Debugger

Started by blinkinhek, September 28, 2012, 03:02:11 PM

Previous topic - Next topic

blinkinhek

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:
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]

blinkinhek

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

gd_on

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 (25H2), svn C::B (last version or almost!), wxWidgets 3.3.2, Msys2 Compilers 16.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

blinkinhek

Quote from: gd_on 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.


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.

blinkinhek

just found this in the forum, from a google search http://forums.next.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.