Hello all,
I have a fix for "unable to make breapoints usable in CYGWIN",
just modify this method in GDB_driver class :
void GDB_driver::AddBreakpoint(DebuggerBreakpoint* bp)
{
wxString SaveFileName(bp->filename);
if(platform::windows && m_CygwinPresent==true)
{
wxString FileName(bp->filename);
if (FileName.GetChar(1) == _T(':'))
{
wxString m_CygdrivePrefixNormalized;
if (m_CygdrivePrefix.EndsWith(_T("/"))) // for the case "/cygdrive/"
m_CygdrivePrefixNormalized = m_CygdrivePrefix;
else // for cases e.g. "/cygdrive"
m_CygdrivePrefixNormalized = m_CygdrivePrefix + _T("/");
// replace drive letter with cygwin prefix and adding the drive label back
if (FileName.GetChar(2) == _T('/'))
FileName.Replace(FileName.Left(1) + _T(":") + _T("/"), m_CygdrivePrefixNormalized + FileName.Left(1).Lower() + _T("/"), false);
else
FileName.Replace(FileName.Left(1) + _T(":"), m_CygdrivePrefixNormalized + FileName.Left(1).Lower() + _T("/"), false);
}
bp->filename = FileName;
} if (bp->type == DebuggerBreakpoint::bptData) {
QueueCommand(new GdbCmd_AddDataBreakpoint(this, bp));
}
//Workaround for GDB to break on C++ constructor/destructor
else
{
if (bp->func.IsEmpty() && !bp->lineText.IsEmpty())
{
wxRegEx reCtorDtor(_T("([0-9A-z_]+):
[~]?)([0-9A-z_]+)[ \t\(]*"));
if (reCtorDtor.Matches(bp->lineText))
{
wxString strBase = reCtorDtor.GetMatch(bp->lineText, 1);
wxString strDtor = reCtorDtor.GetMatch(bp->lineText, 2);
wxString strMethod = reCtorDtor.GetMatch(bp->lineText, 3);
if (strBase.IsSameAs(strMethod))
{
bp->func = strBase;
bp->func << _T("::");
bp->func << strDtor;
bp->func << strMethod;
// if (bp->temporary)
// bp->temporary = false;
NotifyCursorChanged(); // to force breakpoints window update
}
}
}
//end GDB workaround
QueueCommand(new GdbCmd_AddBreakpoint(this, bp));
}
bp->filename = SaveFileName;}