Author Topic: Crash in debugger plugin  (Read 8230 times)

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Crash in debugger plugin
« on: January 09, 2006, 05:18:07 pm »
It seems it doesn't turn off it's message logging when the message manager closes, so it crashed in DebuggerGDB::Log(). It's hard for me to reproduce this bug (I'm guessing it's been there for a long time, but this is the first time I've seen it). This seems to be a solution, but maybe what really needs to be done is have the debugger stop making logging calls after the manager closes? Y'all would know better than me on this.

Code
void DebuggerGDB::Log(const wxString& msg)
{
    Manager* manager = Manager::Get();
    if (!manager)
        return;
    MessageManager* msgmanager = manager->GetMessageManager();
    if (!msgmanager)
        return;
    msgmanager->Log(m_PageIndex, msg);
}

void DebuggerGDB::DebugLog(const wxString& msg)
{
    // gdb debug messages
    if (m_HasDebugLog)
    {
        Manager* manager = Manager::Get();
        if (!manager)
            return;
        MessageManager* msgmanager = manager->GetMessageManager();
        if (!msgmanager)
            return;
        msgmanager->Log(m_DbgPageIndex, msg);
    }
}
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Crash in debugger plugin
« Reply #1 on: January 09, 2006, 06:40:14 pm »
Quote from: 280Z28
Y'all would know better than me on this.

Hehe, I just might :)

Code
void DebuggerGDB::Log(const wxString& msg)
{
    if (m_IsAttached)
        Manager::Get()->GetMessageManager()->Log(m_PageIndex, msg);
}

void DebuggerGDB::DebugLog(const wxString& msg)
{
    // gdb debug messages
    if (m_IsAttached && m_HasDebugLog)
        Manager::Get()->GetMessageManager()->Log(m_DbgPageIndex, msg);
}

Revision 1695.
Be patient!
This bug will be fixed soon...