Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Splitting debugger in two - specific debugger and common GUI

<< < (123/136) > >>

oBFusCATed:
Morten:
Hm, I don't understand your last fix. Can you explain?
Are you sure you've fixed it and not added a workaround for some kind of memory corruption?

MortenMacFly:

--- Quote from: oBFusCATed on January 17, 2012, 10:42:25 pm ---Hm, I don't understand your last fix. Can you explain?
--- End quote ---
I fully agree that it looks a completely weird but I've seen this in my own applications, too. If you sum a wxString by reference, the and have the reference itself in the equation, too sometimes garbage comes out. I don't know why (maybe I should have look at the affected operators of wxString), but I do know that introducing a temporary (copied) variable works. And in fact the Chinese characters are gone for me.

MortenMacFly:

--- Quote from: oBFusCATed on January 18, 2012, 08:40:56 am ---Morten: I wouldn't be surprised if the wx guys have messed the API, once again. But I'll be happy if you take some time and try to find the real cause for the problem.

--- End quote ---
I did and I found it. This caused a reversal of the initial fix. The problem was in a wrong use of the WinAPI function to retrieve the 8.3 path notation in case the file is not present. (The latter was not handeled correctly). I've fixed this now and forever. However, one thing must be clear: If the file is not present (on Windows) the trial to obtain a 8.3 path (either with or without file) will not succeed. In that case the file name is left as it is, so the argument will be provided "some string" with spaces in it, as you simple cannot convert it to "something without spaces" using Windows file API. This means, the -args argument might indeed get something with spaces and also the path to the debuggee might still contain spaces. This might cause side effects but there is no way to do it properly in the place where I did the modifications.

I also used the wx function now which is cross-platform, so no need for this ugly "GetShortPathNBame" hack for Unixes anymore.

tomjnx:
obFus: are you sure the following does the right thing? It seems to me that only every second command is deleted...

from debuggerdriver.cpp:
void DebuggerDriver::ClearQueue()
{
    int idx = 0;
    // if the first command in the queue is running, delete all others
    // (this will be deleted when done)
    if (m_QueueBusy && !m_DCmds.GetCount())
        idx = 1;
    for (int i = idx; i < (int)m_DCmds.GetCount(); ++i)
    {
        delete m_DCmds;
        m_DCmds.RemoveAt(i);
    }
}

oBFusCATed:
No, I'm not sure, but I've fixed it just in case, thank you for the report :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version