Author Topic: [SOLVED] C::B Watches reports incorrect values  (Read 2293 times)

Offline Ad

  • Single posting newcomer
  • *
  • Posts: 3
[SOLVED] C::B Watches reports incorrect values
« on: October 18, 2010, 12:15:12 pm »
The Watches function worked good on previous configuration I had - Ubuntu 10.04 with C::B 10.05 installed from a ppa, and wxWidgets 2.8.11. Now I installed Ubuntu 10.10, with C::B from repository, and wxWidgets 2.9.1, and when I debug a project I wrote in previous configuration, the variables in Watches window are somehow nested. For example, on a code snippet like bellow:
Code: [Select]
case SQLITE_ROW:
                    {
                        const char *txt = (const char*)sqlite3_column_text(stmt, 0);
                        wxString NrContract(txt, wxConvUTF8);
                        this->InsertItem(i, NrContract);

                        txt = (const char*)sqlite3_column_text(stmt, 1);
                        wxString Nume(txt, wxConvUTF8);
                        this->SetItem(i, 1, Nume);

                        wxString dataScadenta = GetDataScadentaPrelungire(NrContract);
                        this->SetItem(i, 2, dataScadenta);
                        wxString valoareEvaluata = GetValoareEvaluata(NrContract);
                        this->SetItem(i, 3, valoareEvaluata);
                        wxString restPlata = GetRestPlata(NrContract);
                        this->SetItem(i, 4, restPlata);
                        wxString status = GetContractAtribut(wxT("Status"), NrContract);
                        wxDateTime dataScadentaD;
                        dataScadentaD.ParseFormat(dataScadenta, wxT("%d-%m-%Y"));
                        wxDateTime now = wxDateTime::Now();
                        wxTimeSpan timpRamas = dataScadentaD - now;
I get Watches like in the following image http://imgur.com/BVJSk. The program runs ok, but I don't have any idea about the Watches issue. Thanks in advance for any tips.
« Last Edit: October 22, 2010, 03:47:54 pm by Ad »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12224
    • Travis build status
Re: C::B Watches reports incorrect values
« Reply #1 on: October 18, 2010, 12:20:12 pm »
The "local variables" don't support script evaluation, so this is normal behavior.
If you want to see "wxvar = "string"", you should explicitly add the variable.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Ad

  • Single posting newcomer
  • *
  • Posts: 3
Re: C::B Watches reports incorrect values
« Reply #2 on: October 18, 2010, 03:22:42 pm »
Thanks for response, but I might have been a bit ambiguous in my formulation. The code above is a fragment from a class method, which is invoked at runtime, and in previous configuration Watch values were displayed correctly (each variable with it's own values). Even if I use "Add watch" for the variable I want, the result is the same.

Offline Ad

  • Single posting newcomer
  • *
  • Posts: 3
Re: C::B Watches reports incorrect values
« Reply #3 on: October 22, 2010, 03:47:35 pm »
It seems the problem was due to wxWidgets 2.9.1. I rolled back to 2.8.11, as 2.9.1 wasn't a priority for me, and now it works again as expected.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12224
    • Travis build status
Re: [SOLVED] C::B Watches reports incorrect values
« Reply #4 on: October 22, 2010, 04:07:19 pm »
Hm, yes they've modified wxString in wx2.9+, so the value parser in C::B should be updated.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]