예제 #1
0
GDBOutputWidget::GDBOutputWidget( QWidget *parent, const char *name) :
    QWidget(parent, name),
    m_userGDBCmdEditor(0),
    m_Interrupt(0),
    m_gdbView(0),
    showInternalCommands_(false),
    maxLines_(5000)
{

    m_gdbView = new OutputText(this);
    m_gdbView->setTextFormat(QTextEdit::LogText);

    QBoxLayout *userGDBCmdEntry = new QHBoxLayout();
    m_userGDBCmdEditor = new KHistoryCombo (this, "gdb-user-cmd-editor");

    QLabel *label = new QLabel(i18n("&GDB cmd:"), this);
    label->setBuddy(m_userGDBCmdEditor);
    userGDBCmdEntry->addWidget(label);

    userGDBCmdEntry->addWidget(m_userGDBCmdEditor);
    userGDBCmdEntry->setStretchFactor(m_userGDBCmdEditor, 1);

    m_Interrupt = new QToolButton( this, "add breakpoint" );
    m_Interrupt->setSizePolicy ( QSizePolicy ( (QSizePolicy::SizeType)0,
                                 ( QSizePolicy::SizeType)0,
                                 0,
                                 0,
                                 m_Interrupt->sizePolicy().hasHeightForWidth())
                               );
    m_Interrupt->setPixmap ( SmallIcon ( "player_pause" ) );
    userGDBCmdEntry->addWidget(m_Interrupt);
    QToolTip::add ( m_Interrupt, i18n ( "Pause execution of the app to enter gdb commands" ) );

    QVBoxLayout *topLayout = new QVBoxLayout(this, 2);
    topLayout->addWidget(m_gdbView, 10);
    topLayout->addLayout(userGDBCmdEntry);

    slotDbgStatus( "", s_dbgNotStarted);

    connect( m_userGDBCmdEditor, SIGNAL(returnPressed()), SLOT(slotGDBCmd()) );
    connect( m_Interrupt,        SIGNAL(clicked()),       SIGNAL(breakInto()));

    connect( &updateTimer_, SIGNAL(timeout()),
             this,  SLOT(flushPending()));
}
예제 #2
0
void GDBOutputWidget::currentSessionChanged(KDevelop::IDebugSession* s)
{
    DebugSession *session = qobject_cast<DebugSession*>(s);
    if (!session) return;
     connect( this,       SIGNAL(userGDBCmd(QString)),
             session, SLOT(slotUserGDBCmd(QString)));
     connect( this,       SIGNAL(breakInto()),
             session, SLOT(interruptDebugger()));

     connect( session, SIGNAL(gdbInternalCommandStdout(QString)),
             this,       SLOT(slotInternalCommandStdout(QString)) );
     connect( session, SIGNAL(gdbUserCommandStdout(QString)),
             this,       SLOT(slotUserCommandStdout(QString)) );

     connect( session, SIGNAL(gdbStateChanged(DBGStateFlags,DBGStateFlags)),
             this,       SLOT(slotStateChanged(DBGStateFlags,DBGStateFlags)));

     slotStateChanged(s_none, session->debuggerState());
}
예제 #3
0
void RubyDebuggerPart::setupController()
{
    VariableTree *variableTree = variableWidget->varTree();

    controller = new RDBController(variableTree, framestackWidget, *projectDom());

    // this -> controller
    connect( this,                  SIGNAL(rubyInspect(const QString&)),
             controller,            SLOT(slotRubyInspect(const QString&)));

    // variableTree -> framestackWidget
    connect( variableTree,          SIGNAL(selectFrame(int, int)),
             framestackWidget,      SLOT(slotSelectFrame(int, int)));

    // framestackWidget -> variableTree
    connect( framestackWidget,      SIGNAL(frameActive(int, int, const QString&)),
             variableTree,          SLOT(slotFrameActive(int, int, const QString&)));

    // variableTree -> controller
    connect( variableTree,          SIGNAL(expandItem(VarItem*, const QCString&)),
             controller,            SLOT(slotExpandItem(VarItem*, const QCString&)));
    connect( variableTree,          SIGNAL(fetchGlobals(bool)),
             controller,            SLOT(slotFetchGlobals(bool)));
    connect( variableTree,          SIGNAL(addWatchExpression(const QString&, bool)),
             controller,            SLOT(slotAddWatchExpression(const QString&, bool)));
    connect( variableTree,          SIGNAL(removeWatchExpression(int)),
             controller,            SLOT(slotRemoveWatchExpression(int)));

    // framestackWidget -> controller
    connect( framestackWidget,      SIGNAL(selectFrame(int,int,const QString&)),
             controller,            SLOT(slotSelectFrame(int,int,const QString&)));

    // rdbBreakpointWidget -> controller
    connect( rdbBreakpointWidget,   SIGNAL(clearAllBreakpoints()),
             controller,            SLOT(slotClearAllBreakpoints()));
    connect( rdbBreakpointWidget,   SIGNAL(publishBPState(const Breakpoint&)),
             controller,            SLOT(slotBPState(const Breakpoint &)));


    // rdbOutputWidget -> controller
    connect( rdbOutputWidget,       SIGNAL(userRDBCmd(const QString &)),
             controller,            SLOT(slotUserRDBCmd(const QString&)));
    connect( rdbOutputWidget,       SIGNAL(breakInto()),
             controller,            SLOT(slotBreakInto()));

    // controller -> rdbBreakpointWidget
    connect( controller,            SIGNAL(acceptPendingBPs()),
             rdbBreakpointWidget,   SLOT(slotSetPendingBPs()));
    connect( controller,            SIGNAL(unableToSetBPNow(int)),
             rdbBreakpointWidget,   SLOT(slotUnableToSetBPNow(int)));
    connect( controller,            SIGNAL(rawRDBBreakpointList (char*)),
             rdbBreakpointWidget,   SLOT(slotParseRDBBrkptList(char*)));
    connect( controller,            SIGNAL(rawRDBBreakpointSet(char*, int)),
             rdbBreakpointWidget,   SLOT(slotParseRDBBreakpointSet(char*, int)));


    // controller -> this
    connect( controller,            SIGNAL(dbgStatus(const QString&, int)),
             this,                  SLOT(slotStatus(const QString&, int)));
    connect( controller,            SIGNAL(showStepInSource(const QString&, int, const QString&)),
             this,                  SLOT(slotShowStep(const QString&, int)));

    // controller -> procLineMaker
    connect( controller,            SIGNAL(ttyStdout(const char*)),
             procLineMaker,         SLOT(slotReceivedStdout(const char*)));
    connect( controller,            SIGNAL(ttyStderr(const char*)),
             procLineMaker,         SLOT(slotReceivedStderr(const char*)));

    // controller -> rdbOutputWidget
    connect( controller,            SIGNAL(rdbStdout(const char*)),
             rdbOutputWidget,       SLOT(slotReceivedStdout(const char*)) );
    connect( controller,            SIGNAL(rdbStderr(const char*)),
             rdbOutputWidget,       SLOT(slotReceivedStderr(const char*)) );
    connect( controller,            SIGNAL(dbgStatus(const QString&, int)),
             rdbOutputWidget,       SLOT(slotDbgStatus(const QString&, int)));

}
예제 #4
0
GDBOutputWidget::GDBOutputWidget(CppDebuggerPlugin* plugin, QWidget *parent) :
    QWidget(parent),
    m_userGDBCmdEditor(0),
    m_Interrupt(0),
    m_gdbView(0),
    showInternalCommands_(false),
    maxLines_(5000)
{
//     setWindowIcon(KIcon("inline_image"));
    setWindowIcon(KIcon("debugger"));
    setWindowTitle(i18n("GDB Output"));
    setWhatsThis(i18n("<b>GDB output</b><p>"
                    "Shows all gdb commands being executed. "
                    "You can also issue any other gdb command while debugging.</p>"));

    m_gdbView = new OutputTextEdit(this);
    m_gdbView->setReadOnly(true);

    m_userGDBCmdEditor = new KHistoryComboBox (this);

    QLabel *label = new QLabel(i18n("&GDB cmd:"), this);
    label->setBuddy(m_userGDBCmdEditor);

    m_Interrupt = new QToolButton( this );
    m_Interrupt->setIcon ( KIcon ( "media-playback-pause" ) );
    m_Interrupt->setToolTip( i18n ( "Pause execution of the app to enter gdb commands" ) );

    QVBoxLayout *topLayout = new QVBoxLayout(this);
    topLayout->addWidget(m_gdbView);
    topLayout->setStretchFactor(m_gdbView, 1);
    topLayout->setMargin(0);

    QBoxLayout *userGDBCmdEntry = new QHBoxLayout();
    userGDBCmdEntry->addWidget(label);
    userGDBCmdEntry->addWidget(m_userGDBCmdEditor);
    userGDBCmdEntry->setStretchFactor(m_userGDBCmdEditor, 1);
    userGDBCmdEntry->addWidget(m_Interrupt);
    topLayout->addLayout(userGDBCmdEntry);

    setLayout(topLayout);

    slotStateChanged(s_none, s_dbgNotStarted);

    connect( m_userGDBCmdEditor, SIGNAL(returnPressed()), SLOT(slotGDBCmd()) );
    connect( m_Interrupt,        SIGNAL(clicked()),       SIGNAL(breakInto()));

    updateTimer_.setSingleShot(true);
    connect( &updateTimer_, SIGNAL(timeout()),
             this,  SLOT(flushPending()));

    connect(KDevelop::ICore::self()->debugController(), 
            SIGNAL(currentSessionChanged(KDevelop::IDebugSession*)),
            SLOT(currentSessionChanged(KDevelop::IDebugSession*)));

    connect(plugin, SIGNAL(reset()), this, SLOT(clear()));
    connect(plugin, SIGNAL(raiseGdbConsoleViews()), SIGNAL(requestRaise()));

    currentSessionChanged(KDevelop::ICore::self()->debugController()->currentSession());

    connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
            this, SLOT(updateColors()));
    updateColors();

}