[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdevelop (silent)
From:       Robert Gruber <rgruber () users ! sourceforge ! net>
Date:       2005-07-27 13:01:27
Message-ID: 1122469287.646110.22028.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 439220 by rgruber:

SVN_SILENT
Merged debugger jump feature from 3.5-branch to trunk


 M  +1 -0      languages/cpp/debugger/dbgcontroller.h  
 M  +24 -1     languages/cpp/debugger/debuggerpart.cpp  
 M  +1 -0      languages/cpp/debugger/debuggerpart.h  
 M  +13 -0     languages/cpp/debugger/gdbcontroller.cpp  
 M  +1 -0      languages/cpp/debugger/gdbcontroller.h  
 M  +1 -0      languages/cpp/debugger/kdevdebugger.rc  
 M  +1 -1      pics/toolbar/Makefile.am  
 AM            pics/toolbar/hi22-action-dbgjumpto.png   \
branches/KDE/3.5/kdevelop/pics/toolbar/hi22-action-dbgjumpto.png#439210


--- trunk/KDE/kdevelop/languages/cpp/debugger/dbgcontroller.h #439219:439220
@@ -96,6 +96,7 @@
 
     virtual void slotRun()                                                  = 0;
     virtual void slotRunUntil(const QString &fileName, int lineNum)         = 0;
+    virtual void slotJumpTo(const QString &fileName, int lineNum)           = 0;
     virtual void slotStepInto()                                             = 0;
     virtual void slotStepOver()                                             = 0;
     virtual void slotStepIntoIns()                                          = 0;
--- trunk/KDE/kdevelop/languages/cpp/debugger/debuggerpart.cpp #439219:439220
@@ -194,6 +194,13 @@
     action->setWhatsThis(i18n("<b>Run to cursor</b><p>Continues execution until the \
cursor position is reached."));  
 
+    action = new KAction(i18n("Set E&xecution Position to Cursor"), "dbgjumpto", 0,
+                         this, SLOT(slotJumpToCursor()),
+                         actionCollection(), "debug_jumptocursor");
+    action->setToolTip( i18n("Jump to cursor") );
+    action->setWhatsThis(i18n("<b>Set Execution Position </b><p>Set the execution \
pointer to the current cursor position.")); +
+
     action = new KAction(i18n("Step &Over"), "dbgnext", 0,
                          this, SLOT(slotStepOver()),
                          actionCollection(), "debug_stepover");
@@ -805,9 +812,25 @@
     uint line, col;
     cursorIface->cursorPosition(&line, &col);
 
-    controller->slotRunUntil(rwpart->url().path(), line);
+    controller->slotRunUntil(rwpart->url().path(), ++line);
 }
 
+void DebuggerPart::slotJumpToCursor()
+{
+    KParts::ReadWritePart *rwpart
+            = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart());
+    KTextEditor::ViewCursorInterface *cursorIface
+            = dynamic_cast<KTextEditor::ViewCursorInterface*>(partController()->activeWidget());
 +
+    if (!rwpart || !rwpart->url().isLocalFile() || !cursorIface)
+        return;
+
+    uint line, col;
+    cursorIface->cursorPositionReal(&line, &col);
+
+    controller->slotJumpTo(rwpart->url().path(), ++line);
+}
+
 void DebuggerPart::slotStepOver()
 {
     controller->slotStepOver();
--- trunk/KDE/kdevelop/languages/cpp/debugger/debuggerpart.h #439219:439220
@@ -74,6 +74,7 @@
     void slotStop(KDevPlugin* which = 0);
     void slotPause();
     void slotRunToCursor();
+    void slotJumpToCursor();
     void slotStepOver();
     void slotStepOverInstruction();
     void slotStepIntoInstruction();
--- trunk/KDE/kdevelop/languages/cpp/debugger/gdbcontroller.cpp #439219:439220
@@ -1492,6 +1492,19 @@
 
 // **************************************************************************
 
+void GDBController::slotJumpTo(const QString &fileName, int lineNum)
+{
+    if (stateIsOn(s_appBusy|s_dbgNotStarted|s_shuttingDown))
+        return;
+
+    if (!fileName.isEmpty()) {
+        queueCmd(new GDBCommand(QCString().sprintf("tbreak %s:%d", \
fileName.latin1(), lineNum), NOTRUNCMD, NOTINFOCMD, 0)); +        queueCmd(new \
GDBCommand(QCString().sprintf("jump %s:%d", fileName.latin1(), lineNum), RUNCMD, \
NOTINFOCMD, 0)); +    }
+}
+
+// **************************************************************************
+
 void GDBController::slotStepInto()
 {
     if (stateIsOn(s_appBusy|s_appNotStarted|s_shuttingDown))
--- trunk/KDE/kdevelop/languages/cpp/debugger/gdbcontroller.h #439219:439220
@@ -97,6 +97,7 @@
 
     void slotRun();
     void slotRunUntil(const QString &filename, int lineNum);
+    void slotJumpTo(const QString &filename, int lineNum);
     void slotStepInto();
     void slotStepOver();
     void slotStepIntoIns();
--- trunk/KDE/kdevelop/languages/cpp/debugger/kdevdebugger.rc #439219:439220
@@ -7,6 +7,7 @@
   <Action name="debug_stop" group="debug"/>
   <Action name="debug_pause" group="debug"/>
   <Action name="debug_runtocursor" group="debug"/>
+  <Action name="debug_jumptocursor" group="debug"/>
   <Separator group="debug"/>
   <Action name="debug_stepover" group="debug"/>
   <Action name="debug_stepoverinst" group="debug"/>
--- trunk/KDE/kdevelop/pics/toolbar/Makefile.am #439219:439220
@@ -2,7 +2,7 @@
 kdevelop_ICON = AUTO
 
 kdevdebuggerdir = $(kde_datadir)/kdevdebugger/icons
-kdevdebugger_ICON = dbgnext dbgwatchvar dbgrun dbgstepout dbgmemview dbgparam \
dbgrunto dbgstep dbgnextinst dbgrestart dbgstepinst dbgvar debugger \
+kdevdebugger_ICON = dbgnext dbgwatchvar dbgrun dbgstepout dbgmemview dbgparam \
dbgrunto dbgstep dbgnextinst dbgrestart dbgstepinst dbgvar debugger dbgjumpto  
 cppsupportdir = $(kde_datadir)/kdevcppsupport/icons
 cppsupport_ICON = classnew classwiz
** trunk/KDE/kdevelop/pics/toolbar/hi22-action-dbgjumpto.png #property changes
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic