User forums > Embedded development

CodeBlocks and Codesourcery GDB

<< < (7/8) > >>

ziss_dm:
Hi,

I have spent some time investigating this issue and found the following:
1) The CodeSourcery gdb is compilled with version of MinGW which uses both \r  and \n as an EOL
2) The wxWidget text stream is converting \n to the \n\r

As a result gdb receives 2 EOLs.

This is a quick fix:

--- Code: ---
void PipedProcess::SendString(const wxString& text)
{
    //Manager::Get()->GetLogManager()->Log(m_PageIndex, cmd);
    wxOutputStream* pOut = GetOutputStream();
    if (pOut)
    {
        wxTextOutputStream sin(*pOut);
        sin.SetMode(wxEOL_UNIX);
        wxString msg = text + _T('\n');
        sin.WriteString(msg);
    }
}

--- End code ---


which works fine on windows.

This is a test build:
http://mwc-ng.googlecode.com/files/CodeBlocks_svn_gdb.zip

regards,
ziss_dm

ollydbg:

--- Quote from: ziss_dm on April 20, 2012, 10:51:19 am ---Hi,

I have spent some time investigating this issue and found the following:
1) The CodeSourcery gdb is compilled with version of MinGW which uses both \r  and \n as an EOL
2) The wxWidget text stream is converting \n to the \n\r

As a result gdb receives 2 EOLs.

This is a quick fix:

--- Code: ---
void PipedProcess::SendString(const wxString& text)
{
    //Manager::Get()->GetLogManager()->Log(m_PageIndex, cmd);
    wxOutputStream* pOut = GetOutputStream();
    if (pOut)
    {
        wxTextOutputStream sin(*pOut);
        sin.SetMode(wxEOL_UNIX);
        wxString msg = text + _T('\n');
        sin.WriteString(msg);
    }
}

--- End code ---


which works fine on windows.

This is a test build:
http://mwc-ng.googlecode.com/files/CodeBlocks_svn_gdb.zip

regards,
ziss_dm

--- End quote ---
I think you can supply a patch, so that debugger developers (mostly obf) can quickly review it. (I'm not familiar with gdb for embedded system)

oBFusCATed:
ziss_dm:
Search the forum. I've investigated this issue and have made a better patch.
I won't commit it because Codesourcery devs should fix their gdb or give plausible reason for this behaviour.
If you know how to contact them, please do so or provide the contact details in this topic or on PM.

ziss_dm:
Hi OBF,


--- Quote ---Search the forum. I've investigated this issue and have made a better patch.

--- End quote ---

Sorry about that..  ::)

And I think you right, it would be ideal if CS could fix that. But I do not think, they going to do that in nearest future.  :) From other point of view, it is quite safe to assume \n as EOL on windows. So, if you could limit this change only for windows and post patch, it would be really helpful...

regards,
ziss_dm

martind:
Just in case you are not aware, ARM are sponsoring a GCC project now: https://launchpad.net/gcc-arm-embedded

However, not tried with CodeBlocks yet.


Martin.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version