summaryrefslogtreecommitdiffstats
path: root/quanta/components/debugger/gubed
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite9ae80694875f869892f13f4fcaf1170a00dea41 (patch)
treeaa2f8d8a217e2d376224c8d46b7397b68d35de2d /quanta/components/debugger/gubed
downloadtdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.tar.gz
tdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/components/debugger/gubed')
-rw-r--r--quanta/components/debugger/gubed/Makefile.am18
-rw-r--r--quanta/components/debugger/gubed/gubedsettings.cpp41
-rw-r--r--quanta/components/debugger/gubed/gubedsettings.h36
-rw-r--r--quanta/components/debugger/gubed/gubedsettingss.ui762
-rw-r--r--quanta/components/debugger/gubed/quantadebuggergubed.cpp1247
-rw-r--r--quanta/components/debugger/gubed/quantadebuggergubed.desktop48
-rw-r--r--quanta/components/debugger/gubed/quantadebuggergubed.h153
7 files changed, 2305 insertions, 0 deletions
diff --git a/quanta/components/debugger/gubed/Makefile.am b/quanta/components/debugger/gubed/Makefile.am
new file mode 100644
index 00000000..755a7409
--- /dev/null
+++ b/quanta/components/debugger/gubed/Makefile.am
@@ -0,0 +1,18 @@
+METASOURCES = AUTO
+
+kde_module_LTLIBRARIES = quantadebuggergubed.la
+
+quantadebuggergubed_la_SOURCES = gubedsettingss.ui quantadebuggergubed.cpp gubedsettings.cpp
+quantadebuggergubed_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+quantadebuggergubed_la_LIBADD = ../interfaces/libdebuggerinterface.la $(LIB_KPARTS)
+kde_services_DATA = quantadebuggergubed.desktop
+
+INCLUDES = -I$(top_srcdir)/quanta/components/debugger \
+ -I$(top_srcdir)/quanta/components/debugger/interfaces \
+ -I$(top_srcdir)/quanta/components/debugger/gubed \
+ -I$(top_srcdir)/quanta/project \
+ -I$(top_srcdir)/quanta/utility \
+ $(all_includes)
+
+
+noinst_HEADERS = gubedsettings.h
diff --git a/quanta/components/debugger/gubed/gubedsettings.cpp b/quanta/components/debugger/gubed/gubedsettings.cpp
new file mode 100644
index 00000000..f728d884
--- /dev/null
+++ b/quanta/components/debugger/gubed/gubedsettings.cpp
@@ -0,0 +1,41 @@
+/***************************************************************************
+ gubedsettings.cpp
+ -------------------
+ begin : 2004-04-05
+ copyright : (C) 2004 Linus McCabe <linus@mccabe.nu>
+ ***************************************************************************/
+
+/****************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "qlineedit.h"
+#include "gubedsettings.h"
+#include <ktextbrowser.h>
+
+GubedSettings::GubedSettings(const QString &protocolversion)
+ : GubedSettingsS(0, "GubedSettings", false, 0)
+{
+ textAbout->setText(textAbout->text().replace("%PROTOCOLVERSION%", protocolversion));
+}
+
+GubedSettings::~GubedSettings()
+{
+}
+
+void GubedSettings::slotUseProxyToggle( bool useproxy)
+{
+ lineServerHost->setEnabled(useproxy);
+ lineServerPort->setEnabled(useproxy);
+ lineServerListenPort->setEnabled(!useproxy);
+}
+
+
+#include "gubedsettings.moc"
+
diff --git a/quanta/components/debugger/gubed/gubedsettings.h b/quanta/components/debugger/gubed/gubedsettings.h
new file mode 100644
index 00000000..dc070f32
--- /dev/null
+++ b/quanta/components/debugger/gubed/gubedsettings.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+ gubedsettings.h
+ -------------------
+ begin : 2004-04-05
+ copyright : (C) 2004 Linus McCabe <linus@mccabe.nu>
+ ***************************************************************************/
+
+/****************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef GUBEDSETTINGS_H
+#define GUBEDSETTINGS_H
+
+#include "gubedsettingss.h"
+
+class GubedSettings : public GubedSettingsS
+{
+ Q_OBJECT
+
+ public slots:
+ virtual void slotUseProxyToggle( bool useproxy);
+
+ public:
+ GubedSettings(const QString &protocolversion);
+ ~GubedSettings();
+
+};
+
+#endif
+
diff --git a/quanta/components/debugger/gubed/gubedsettingss.ui b/quanta/components/debugger/gubed/gubedsettingss.ui
new file mode 100644
index 00000000..12125c93
--- /dev/null
+++ b/quanta/components/debugger/gubed/gubedsettingss.ui
@@ -0,0 +1,762 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>GubedSettingsS</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>GubedSettingsS</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>659</width>
+ <height>527</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Gubed Settings</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>Ca&amp;ncel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QTabWidget" row="0" column="0">
+ <property name="name">
+ <cstring>tabWidget2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;General</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="3" column="0">
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Directory Mapping</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>lblDebuggerServerBasedir</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Server basedir:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>lblDebuggerLocalBasedir</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Local basedir:</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>lineServerBasedir</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>lineLocalBasedir</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Connection Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>lineServerListenPort</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>lineServerPort</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>lineServerHost</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="1">
+ <property name="name">
+ <cstring>checkUseProxy</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>lblDebuggerUseProxe</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Use proxy</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>lblDebuggerServerHost</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Proxy host:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>lblDebuggerServerPort</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Proxy port:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>lblDebuggerServerListenPort</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Listen port:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0">
+ <property name="name">
+ <cstring>groupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>Mode</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>lineStartSession</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>See "What's This?" for available variables</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>%afn - Filename of the current script
+%afd - Absolute directory of the current script
+%afp - Absolute path (directory + filename) of the current script
+
+%rfpd - Directory of the current script relative to project root
+%rfpp - Path of the current script relative to project root
+
+%rfdd - Directory of the current script relative to document root
+%rfdp - Path of the current script relative to document root
+
+%apd - Project root
+%add - Document root of current script</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>optAddInclude</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Add include</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>optStartSession</cstring>
+ </property>
+ <property name="text">
+ <string>Start session:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Deb&amp;ug Behavior</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox4</cstring>
+ </property>
+ <property name="title">
+ <string>Error Handling</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="4" column="1">
+ <property name="name">
+ <cstring>checkBreakOnUserError</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>User errors</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>lblBreakOn</cstring>
+ </property>
+ <property name="text">
+ <string>Break on:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop</set>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="1">
+ <property name="name">
+ <cstring>checkBreakOnUserWarning</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>User warnings</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="1">
+ <property name="name">
+ <cstring>checkBreakOnUserNotice</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>User notices</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="1">
+ <property name="name">
+ <cstring>checkBreakOnNotice</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Notices</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>checkBreakOnWarning</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>W&amp;arnings</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>spacer4_3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>50</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>groupBox5</cstring>
+ </property>
+ <property name="title">
+ <string>Execution</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="1">
+ <property name="name">
+ <cstring>lblDelayFast</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>9</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string>Fast</string>
+ </property>
+ </widget>
+ <widget class="QSlider" row="1" column="2">
+ <property name="name">
+ <cstring>sliderDisplayDelay</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>27</height>
+ </size>
+ </property>
+ <property name="maxValue">
+ <number>200</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="tickmarks">
+ <enum>Below</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="3">
+ <property name="name">
+ <cstring>lblDelaySlow</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>9</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string>Slow</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1" rowspan="1" colspan="3">
+ <item>
+ <property name="text">
+ <string>Pause</string>
+ </property>
+ <property name="pixmap">
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Trace</string>
+ </property>
+ <property name="pixmap">
+ <pixmap>image1</pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Run</string>
+ </property>
+ <property name="pixmap">
+ <pixmap>image2</pixmap>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboDefaultExecutionState</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>lblDefaultExecutionMode</cstring>
+ </property>
+ <property name="text">
+ <string>Default mode:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>lblDisplayDelay</cstring>
+ </property>
+ <property name="text">
+ <string>Run speed:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>A&amp;bout</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;h4&gt;Gubed PHP Debugger Plugin for Quanta +&lt;/h4&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>pixmapLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="pixmap">
+ <pixmap>image3</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>false</bool>
+ </property>
+ <property name="alignment">
+ <set>AlignCenter</set>
+ </property>
+ </widget>
+ <widget class="KTextBrowser" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textAbout</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>&lt;html&gt;&lt;head&gt;&lt;meta name="qrichtext" content="1" /&gt;&lt;/head&gt;&lt;body style="font-size:10pt;font-family:Bitstream Vera Sans"&gt;
+&lt;p&gt;&lt;span style="font-weight:600"&gt;About&lt;/span&gt;&lt;/p&gt;
+&lt;p&gt;Gubed is a PHP debugger available for free through GPL. This plugin integrates Gubed with Quanta. &lt;/p&gt;
+&lt;p&gt;In order to use this plugin for PHP debugging, you need to get the Quanta package from the Gubed project page, &lt;a href="http://sourceforge.net/projects/gubed"&gt;http://sourceforge.net/projects/gubed&lt;/a&gt;, at SourceForge &lt;/p&gt;
+&lt;p&gt;For more info about Gubed, please visit the Gubed website at &lt;a href="http://gubed.sf.net"&gt;http://gubed.sf.net&lt;/a&gt; &lt;/p&gt;
+&lt;p&gt;&lt;span style="font-weight:600"&gt;Technical Details&lt;/span&gt;&lt;/p&gt;
+&lt;p&gt;This version of the debugger supports the %PROTOCOLVERSION% version of the Gubed protocol. &lt;/p&gt;
+&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<images>
+ <image name="image0">
+ <data format="PNG" length="696">89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff610000027f49444154388d7d93df4b53611cc69ff73de7ccb375dcdad46d2e3269036d21c4420a0b898484e82a08a2a02238a41741dd77e14dff4074d521efbae8a61b2f6a892062604e53117165e28f864dd73adb999e3cdb79cfe9c25a9c4dfa5e3e3ccfe7fdfee02538a412830b226075c3b662804d006b9567a5d4b4d2a7d77a494d5002c81370c20075797dc7fd157804139f77445846a14898fe9a67ead38f4aff661d2031b81006a1e3a16053c7ddcb3e5c3cc5c1ebe1000046c5c6a7af3a86c776b1b2bef3c3cdb2373ebcb83a5e052406e725103a9388473a1e5d13d1e8e60f9b0c1566e1655245727a3b2f19cb5d13c3b7bfff71da43a16073c7bd4b024667b56aa0b7cb0b009858fca75deff1622367357d59d58764597e481203332238317be74ad8d7798ca2ffacbf6a4eceaa00e0d0dea554ac6feb50deaabbc15f635d3c806e9728f9fc6e865cc172b49c2b9875633c1bf34033fca00db6a495a33d3c805840a2c8692638426a00953a40a9dc0000a0820842f9180f80941987cd3c0717ef04bc598ac02354f0b80642c8c1f6096cca03d66a51b791ce37d7bd06007a45a80b7304d8370db82c3d4379564a31a350a404a0f45086a3dc0283c83358fbea5e80a5e7e8b4d2a713a60f53238b36afe630c75b54c45b5487d6eed3408d2c04333712e437b608009c93937e2634a5cec79ba3019febbf1dfc2c9631b594cb448cd19b216e2d55ddda0579245a165adf9f89f94e76b649203517b16d1be9cd5dccafa8997065f241982c4f2a8aa2395cbdf75fb5eac289218fe7c8adf6904b3ada7870b242c9c07ab6bc67e8ea48c89c7a1ee2d6161545d1809adf0800b22cbbbe99a7231a17ed21948f11d894587a26c0d273417e630b405e5194f25fff6f6493fb9b9d8e82910000000049454e44ae426082</data>
+ </image>
+ <image name="image1">
+ <data format="PNG" length="258">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000000c949444154388ded93db0d83300c45af5137ea06190226610a260943d8137426f707a33c0c49a4f6a7ea91f261149f5c2207f873409dfb74d43301c006e8d66856557701408cb1ea9d3c0933b71266ccf35cc95df1284484655932f9b09888ce05a0ba965bf12b045cddf995a824139becc99cd5656211c9928b48fd67a5d4634df631b38610e848af2202ab5df19d7ced9ff736c56c6b3a82aa7a5bf74aadd79acf65b5e13d9416da432a7e8c9e60f35b9c5a7d1b16b7e6d7f8c893f6e84a1c63c4beefdfcaf0ebbc010507b65c1e0ebcf80000000049454e44ae426082</data>
+ </image>
+ <image name="image2">
+ <data format="PNG" length="229">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000000ac49444154388ded94c10dc33008453f5637ea061ec24cd2293289976083ce440f6d2262b012da5b95277188133f7f4560e0e2039dfc4eb39e621f164097894455c30280debbdb539c0180881c25dcd15a73f2509c8588c0cc3b795a4c445b0170bf65e596158f821969f19af4e8b02bf1f7e2b3890bf09eb8f145660223b63eb6a267ad00e209b47d6cfb39143f824be42e825aab5b4f27b6f2993483db2c223a4aa3db6b0633ff14e80f79015c6574466adcb13f0000000049454e44ae426082</data>
+ </image>
+ <image name="image3">
+ <data format="PNG" length="1970">89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af400000779494441545885b5566b6c54c715fe66ee6beededd8df7858dedc5181b87c501b2b20954e0d44a698df3a022a8addaa424229512f58168d52a951a5a4ad2a2d21f55da8aa6ed8f0ab595528ad434a452aa483c6a6a648bc486605b1830c602d65e83d7f6ee7dedde7ba73f1c6ffc0253851ce9fc9973bef9be3973667408e71cf7c39e6f6808d7aa6af2c1254bb6088a12bb383939f4565fdfdb1d0303dd77c389f783bca2a222f06a4dcdcf1f59ba744b2c1cae56348dfa54d53c75e5ca04804f57c02bab567dfe8fcb96fdf4b1d2d2cf4014411c07c8e711571435ca5862313cfd24e46b2391ea164d3bb891b1f5300cc0b2a6dcb6e127040151acf9d404fc301edffc7a34fab746e061d53044aeeb80ae835b16609a7800404010d6eddfbf9fdc7701d5d5d5be0d94ee7b08781886011806609a806d03f93ce03850008464397ce8d0a192fb2ae05b3535f17d9ef7c61724e9739a61487c62023c9b856b1828982690cf83e7f3a08e8387a251616c6c6ccdddf6fbbf9b30e179df7854559f22ba0e18060cd745976de3a4aea32049485a163657566289e761453008d7756b00fce7130b7876dd3aadceb6bffa4224b2376c9ac4721c9cb52cfcc034718173b8d389a914b49e1ebc9048e0f1ba3a445475755d5d9ddcdfdf9fff44021ee47ccbd668f4fb61cf23b02c9c721cbc66db38b7c047a63b0edee8e9c1bbd7afc3f5bcd2542aa50158500099fe09abaaaa986d5981e19191d19909cf3535b1e58ef3d88e48e4cd959406dc4c061de9349ebe7c19939e772fda6f88a2f862a150f8d742c162139aba1e7864d5aaaf555454046626c481af3cb17cf9c195a150804812061c07bf4ca7e7913f110a61776525d6068310c9ac9717f03cafec4eea8a15282b2bf3fd7af7ee5f8418db98ba79f3a8373969fa3cefd1e668f4e912d7257c7c1c855c0e3b4f9dc2dbc3c370a7719284ef9497e3bb555520aa0a5bd3d036398903bdbd18989c0493e561c375bf39323efe8f8504147ba0a5a5c5ba363232fcd4934f3664cbcaeadd4cc6f3150a3e55d70972394092f07e368b77d3e92239003c575e8ee7e371109f0f600c4c55b1251c46653c8ecba689db9c6b6f767545ef5481e2151c3e7cd83bd5dddd233246c2e1b01a0b87359fdf4f88a200aa8aebae8b83bdbd30dda97e9708c1b6a54bf1e3356b100e8741fc7e104d03340dc4e7c3ea8a0a6c5bbb161b57aef42f2929a9bd938059afe06c5fdf602e9f475014c1651928140045015c171f6432e81afdb83fab0301bc944840f0f9004a0159062409600c843178b28cace741515512d4b4ea7b121089c52e5e1a1e2e34545549b06d10d705cfe701cef1a70f3f442a972be67e3b9944d38a150021532e4920b20c5d149d6bba7ee92f1d1dbffd7b4f4f7b694949f5f0f8f81717bd02003872e48895b5ac61c8f2d4891405600c19cfc3e9c1c1625e5855b17df56ac88140b1f444d3005545c7c848fb5bfdfd7bcecbf2efaf8d8e76e735ed9d1b636357366cd8a02c5a81fafa7a7eb9aded82ab2871c1e7030070d7c5b18b1791b5ac2900a5f87a4303969495019cc32c1470cb30703d93c1c9c1c1ecabc78fbf03a01e40a320083200ce394f7677776f6c6a6a3addd6d6e6de51c0d48a3868791e3445013c0fa6aee3fc8d1bc57089cf87c6152bc05515574647f1873367d03b328281b131a47339e6baee5e00f2477b172b5c28148c73e7cef50348dd5580e1ba972c4a2d8d31064a713b9d465fea634c65248235757538d8de8ed7df7b0fb7757d265cfac8e719e7bcd1b6ed658b0ac864b3a39e24198431c601e89e875b1313c5786928047f2884df9d3c3997fcae4608494992746beefa3c01bae35cd33d6f027e7f988822263c0f59db2ec663b118fcb118a8380b5a007013408a103200a0c039df0960fa4fe684902ec7716cccb1790389c3792697cf67c118c0180a82006fc6cf2733063918c48bdbb7a32410e000fa28a5bf92657917636c672814da2d08c23f679003c030a5b40780b6a880f6f6f68c6e59d789aa82f8fd100301104128c65d4a612b0ad624127fddd6dc5cd3d9d959efbaeecbb66d1f374df3523e9f0fb9aefbd2ccea504aff0c20c5390fcde59b7705dddddd7a369b4d83524092e00f87a130568ca7c7c7f1dfdede2bff3e73e66713845c5bbf7efdac81c0308c6739e71b672cdd1404e1382124cf39f7cfe503e77c96b7b6b60a070e1cf89e61189ee7797c6868886fddba9503e000b8200819bfa6eddeb46993388d696969115455ada794be06c09bce05c029a53f8946a31a632c298ae297e6f2cd13c039c78e1d3b969d3871e2835c2ee7e57239be67cf1e3e63538710d24b29dd4b297d4610846728a53f22849c063039939c1072d5eff72febeaea0263ac5610845d73b9161cc98e1e3d3ad4dadadadadcdcfce5cd9b377f361e8fe7013c0ee0010002e73cc139dfbf1076da08211db22cbf9ccd66870080523ace399f3fa22f5481696f6c6c9492c96469229188504a7f03c09879c23b392164485194e6dada5a797aaff2f27246297da5b3b3932c7a050b793c1ef70b82b08b10d20720b700b10ee012a5745f2010a89a8bb76d1bc160b0f2c2850bb3041447b27bb14422215fbd7ab5d1719c759cf346ce790c534f7994527a561084f3b158ecfd63c78e19c964f29ef6fc1f4f14b29abe15e4b80000000049454e44ae426082</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>GubedSettingsS</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>GubedSettingsS</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>checkUseProxy</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>GubedSettingsS</receiver>
+ <slot>slotUseProxyToggle(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>tabWidget2</tabstop>
+ <tabstop>lineLocalBasedir</tabstop>
+ <tabstop>lineServerBasedir</tabstop>
+ <tabstop>checkUseProxy</tabstop>
+ <tabstop>lineServerHost</tabstop>
+ <tabstop>lineServerPort</tabstop>
+ <tabstop>lineServerListenPort</tabstop>
+ <tabstop>optStartSession</tabstop>
+ <tabstop>lineStartSession</tabstop>
+ <tabstop>optAddInclude</tabstop>
+ <tabstop>checkBreakOnNotice</tabstop>
+ <tabstop>checkBreakOnWarning</tabstop>
+ <tabstop>checkBreakOnUserNotice</tabstop>
+ <tabstop>checkBreakOnUserWarning</tabstop>
+ <tabstop>checkBreakOnUserError</tabstop>
+ <tabstop>comboDefaultExecutionState</tabstop>
+ <tabstop>sliderDisplayDelay</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<slots>
+ <slot specifier="pure virtual">slotUseProxyToggle( bool )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>ktextbrowser.h</includehint>
+</includehints>
+</UI>
diff --git a/quanta/components/debugger/gubed/quantadebuggergubed.cpp b/quanta/components/debugger/gubed/quantadebuggergubed.cpp
new file mode 100644
index 00000000..be703e73
--- /dev/null
+++ b/quanta/components/debugger/gubed/quantadebuggergubed.cpp
@@ -0,0 +1,1247 @@
+/***************************************************************************
+ quantadebuggergubed.cpp
+ -------------------
+ begin : 2004-03-12
+ copyright : (C) 2004 Linus McCabe <linus@mccabe.nu>
+ ***************************************************************************/
+
+/****************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <kdebug.h>
+#include <kserversocket.h>
+#include <kstreamsocket.h>
+#include <klocale.h>
+#include <kgenericfactory.h>
+#include <qlineedit.h>
+#include <qslider.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <kdeversion.h>
+#include <errno.h>
+#include <qstring.h>
+#include <qmap.h>
+
+#include <stdarg.h>
+
+#include "debuggerclient.h"
+#include "quantadebuggergubed.h"
+#include "debuggerinterface.h"
+#include "debuggerbreakpoint.h"
+#include "gubedsettings.h"
+#include "debuggervariable.h"
+#include "variableslistview.h"
+#include "pathmapper.h"
+
+#include "debuggerui.h"
+
+
+K_EXPORT_COMPONENT_FACTORY( quantadebuggergubed,
+ KGenericFactory<QuantaDebuggerGubed>("quantadebuggergubed"))
+
+const char QuantaDebuggerGubed::protocolversion[] = "0.0.12";
+
+QuantaDebuggerGubed::QuantaDebuggerGubed (QObject *parent, const char* name, const QStringList&)
+ : DebuggerClient (parent, name)
+{
+ // Create a socket object and set up its signals
+ m_socket = NULL;
+ m_server = NULL;
+ m_errormask = 1794;
+ m_defaultExecutionState = Pause;
+ setExecutionState(m_defaultExecutionState);
+
+ emit updateStatus(DebuggerUI::NoSession);
+ m_datalen = -1;
+}
+
+QuantaDebuggerGubed::~QuantaDebuggerGubed ()
+{
+
+ kdDebug(24002) << k_funcinfo << ", m_server: " << m_server << ", m_socket" << m_socket << endl;
+
+ if(m_socket)
+ {
+ sendCommand("die", (char*)0L);
+ m_socket->flush();
+ m_socket->close();
+ delete m_socket;
+ m_socket = NULL;
+ }
+ if(m_server)
+ {
+ m_server->close();
+ delete m_server;
+ m_server = NULL;
+ }
+ emit updateStatus(DebuggerUI::NoSession);
+}
+
+// Try to make a connection to the gubed server
+void QuantaDebuggerGubed::startSession()
+{
+
+ kdDebug(24002) << k_funcinfo << ", m_server: " << m_server << ", m_socket" << m_socket << endl;
+
+ // Set default execution state
+ setExecutionState(m_defaultExecutionState);
+
+ if(m_useproxy)
+ {
+ if(!m_socket)
+ {
+ m_socket = new KNetwork::KStreamSocket(m_serverHost, m_serverPort);
+
+ connect(m_socket, SIGNAL(gotError(int)), this, SLOT(slotError(int)));
+ connect(m_socket, SIGNAL(connected(const KResolverEntry &)), this, SLOT(slotConnected(const KResolverEntry &)));
+ connect(m_socket, SIGNAL(closed()), this, SLOT(slotConnectionClosed()));
+ connect(m_socket, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
+
+ m_socket->connect();
+ debuggerInterface()->enableAction("debug_connect", true);
+ debuggerInterface()->enableAction("debug_disconnect", false);
+ debuggerInterface()->enableAction("debug_request", false);
+ kdDebug(24002) << k_funcinfo << ", proxy:" << m_serverHost << ", " << m_serverPort.toUInt() << endl;
+
+ emit updateStatus(DebuggerUI::AwaitingConnection);
+ }
+ }
+ else
+ {
+ if(!m_server)
+ {
+ m_server = new KNetwork::KServerSocket(m_listenPort);
+
+ m_server->setAddressReuseable(true);
+ connect(m_server, SIGNAL(readyAccept()), this, SLOT(slotReadyAccept()));
+
+ if(m_server->listen())
+ {
+ emit updateStatus(DebuggerUI::AwaitingConnection);
+ debuggerInterface()->enableAction("debug_connect", false);
+ debuggerInterface()->enableAction("debug_disconnect", true);
+ debuggerInterface()->enableAction("debug_request", true);
+ }
+ else
+ {
+ emit updateStatus(DebuggerUI::NoSession);
+ delete m_server;
+ m_server = NULL;
+ debuggerInterface()->enableAction("debug_connect", true);
+ debuggerInterface()->enableAction("debug_disconnect", false);
+ debuggerInterface()->enableAction("debug_request", false);
+ }
+ }
+ }
+
+}
+
+
+void QuantaDebuggerGubed::endSession()
+{
+
+ kdDebug(24002) << k_funcinfo << ", m_server: " << m_server << ", m_socket" << m_socket << endl;
+
+ // Close the socket
+ if(m_socket)
+ {
+ sendCommand("die", (char*)0L);
+ m_socket->flush();
+ m_socket->close();
+
+ m_socket->deleteLater();
+ m_socket = NULL;
+ }
+
+ // Close the server
+ if(m_server)
+ {
+ m_server->close();
+ delete m_server;
+ m_server = NULL;
+ }
+
+ // Fake a connection closed signal
+ slotConnectionClosed();
+ debuggerInterface()->enableAction("debug_request", false);
+ debuggerInterface()->enableAction("debug_run", false);
+ debuggerInterface()->enableAction("debug_leap", false);
+ debuggerInterface()->enableAction("debug_pause", false);
+
+ emit updateStatus(DebuggerUI::NoSession);
+}
+
+// Change executionstate of the script
+void QuantaDebuggerGubed::setExecutionState(State newstate)
+{
+ if(newstate == Pause)
+ {
+ sendCommand("pause", (char*)0L);
+ sendCommand("sendactiveline", (char*)0L);
+ if(isActive())
+ emit updateStatus(DebuggerUI::Paused);
+ }
+ else if(newstate == Run)
+ {
+ if(m_executionState == Pause)
+ sendCommand("next", (char*)0L);
+
+ sendCommand("run", (char*)0L);
+ if(isActive())
+ emit updateStatus(DebuggerUI::Running);
+ }
+ else if(newstate == Trace)
+ {
+ if(m_executionState == Pause)
+ sendCommand("next", (char*)0L);
+
+ sendCommand("trace", (char*)0L);
+ if(isActive())
+ emit updateStatus(DebuggerUI::Tracing);
+ }
+
+ m_executionState = newstate;
+
+ if(debuggerInterface()) {
+ debuggerInterface()->enableAction("debug_trace", m_executionState != Trace);
+ debuggerInterface()->enableAction("debug_run", m_executionState != Run);
+ debuggerInterface()->enableAction("debug_pause", m_executionState != Pause);
+ }
+
+ kdDebug(24002) << k_funcinfo << ", " << m_executionState << endl;
+
+}
+
+// Return capabilities of gubed
+const uint QuantaDebuggerGubed::supports(DebuggerClientCapabilities::Capabilities cap)
+{
+ switch(cap)
+ {
+ case DebuggerClientCapabilities::LineBreakpoints:
+ case DebuggerClientCapabilities::ConditionalBreakpoints:
+ case DebuggerClientCapabilities::StartSession:
+ case DebuggerClientCapabilities::EndSession:
+ case DebuggerClientCapabilities::Kill:
+ case DebuggerClientCapabilities::Pause:
+ case DebuggerClientCapabilities::Run:
+ case DebuggerClientCapabilities::Trace:
+ case DebuggerClientCapabilities::Skip:
+ case DebuggerClientCapabilities::StepOut:
+ case DebuggerClientCapabilities::StepInto:
+ case DebuggerClientCapabilities::StepOver:
+ case DebuggerClientCapabilities::Watches:
+ case DebuggerClientCapabilities::VariableSetValue:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+// Socket errors
+void QuantaDebuggerGubed::slotError(int)
+{
+ kdDebug(24002) << k_funcinfo << ", m_server: " << m_server << ", m_socket" << m_socket << endl;
+ if(m_socket)
+ {
+ if(m_socket->error() == KNetwork::KSocketBase::RemotelyDisconnected)
+ {
+ slotConnectionClosed();
+ return;
+ }
+
+ if(m_socket->error())
+ {
+ kdDebug(24002) << k_funcinfo << ", " << m_socket->errorString() << endl;
+ debuggerInterface()->showStatus(m_socket->errorString(), false);
+ }
+ }
+
+ if(m_server && m_server->error())
+ {
+ kdDebug(24002) << k_funcinfo << ", " << m_server->errorString() << endl;
+ debuggerInterface()->showStatus(m_server->errorString(), false);
+ }
+
+}
+
+// slotReadyAccept
+void QuantaDebuggerGubed::slotReadyAccept()
+{
+
+ kdDebug(24002) << k_funcinfo << ", m_server: " << m_server << ", m_socket" << m_socket << endl;
+ if(!m_socket)
+ {
+
+ // Perhaps this shouldnt be disconnected - instead check if connections are available at disconnect?
+ disconnect(m_server, SIGNAL(readyAccept()), this, SLOT(slotReadyAccept()));
+
+ m_socket = (KNetwork::KStreamSocket *)m_server->accept(); // KSocketServer returns a KStreamSocket (!)
+ if(m_socket)
+ {
+ kdDebug(24002) << k_funcinfo << ", ready" << endl;
+ m_socket->enableRead(true);
+
+ connect(m_socket, SIGNAL(gotError(int)), this, SLOT(slotError(int)));
+ connect(m_socket, SIGNAL(connected(const KResolverEntry &)), this, SLOT(slotConnected(const KResolverEntry &)));
+ connect(m_socket, SIGNAL(closed()), this, SLOT(slotConnectionClosed()));
+ connect(m_socket, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
+ connected();
+
+ emit updateStatus(DebuggerUI::Connected);
+ }
+ else
+ {
+ kdDebug(24002) << k_funcinfo << ", " << m_server->errorString() << endl;
+ }
+ }
+
+}
+
+// Connection established
+void QuantaDebuggerGubed::slotConnected(const KNetwork::KResolverEntry &)
+{
+ emit updateStatus(DebuggerUI::Connected);
+ connected();
+}
+
+void QuantaDebuggerGubed::connected()
+{
+ kdDebug(24002) << k_funcinfo << endl;
+
+ sendCommand("wait", (char*)0L);
+ debuggerInterface()->enableAction("debug_connect", false);
+ debuggerInterface()->enableAction("debug_disconnect", true);
+ debuggerInterface()->enableAction("debug_request", false);
+
+ m_active = true;
+}
+
+// Connectio closed
+void QuantaDebuggerGubed::slotConnectionClosed()
+{
+ kdDebug(24002) << k_funcinfo << ", m_server: " << m_server << ", m_socket" << m_socket << endl;
+
+ // Check if we have more data to read
+ slotReadyRead();
+ kdDebug(24002) << k_funcinfo << "buffer: " << m_buffer << endl;
+
+ if(m_socket)
+ {
+ m_socket->deleteLater();
+ m_socket = NULL;
+ }
+
+ if(m_server)
+ connect(m_server, SIGNAL(readyAccept()), this, SLOT(slotReadyAccept()));
+
+ // Disable all session related actions and enable connection action
+ debuggerInterface()->enableAction("*", false);
+ debuggerInterface()->enableAction("debug_connect", m_useproxy == 1 || m_server == NULL);
+ debuggerInterface()->enableAction("debug_disconnect", m_useproxy == 0 && m_server != NULL);
+ setExecutionState(m_defaultExecutionState);
+
+ debuggerInterface()->enableAction("debug_request", true);
+ debuggerInterface()->enableAction("debug_breakpoints_toggle", true);
+ debuggerInterface()->enableAction("debug_breakpoints_clear", true);
+
+ debuggerInterface()->setActiveLine("", 0);
+
+ emit updateStatus(DebuggerUI::AwaitingConnection);
+ m_active = false;
+}
+
+// Data from socket
+void QuantaDebuggerGubed::slotReadyRead()
+{
+
+ // Data from gubed
+ while(m_socket && (m_socket->bytesAvailable() > 0 || m_buffer.length() >= (unsigned long)m_datalen))
+ {
+ int bytes;
+ QString data;
+
+ if(m_socket && m_socket->bytesAvailable() > 0)
+ {
+ // Read all available bytes from socket and append them to the buffer
+ bytes = m_socket->bytesAvailable();
+ char* buffer = new char[bytes + 1];
+ m_socket->readBlock(buffer, bytes);
+ buffer[bytes] = 0;
+ m_buffer += buffer;
+ delete[] buffer;
+ }
+
+ while(1)
+ {
+ // If datalen == -1, we didnt read the command yet, otherwise were reading data.
+ if(m_datalen == -1)
+ {
+ bytes = m_buffer.find(";");
+ if(bytes < 0)
+ break;
+
+ data = m_buffer.left(bytes);
+ m_buffer.remove(0, bytes + 1);
+ bytes = data.find(":");
+ m_command = data.left(bytes);
+ data.remove(0, bytes + 1);
+ m_datalen = data.toLong();
+ }
+ if(m_datalen != -1 && (long)m_buffer.length() >= m_datalen)
+ {
+ data = m_buffer.left(m_datalen);
+ m_buffer.remove(0, m_datalen);
+ m_datalen = -1;
+ processCommand(data);
+ }
+ else
+ break;
+ }
+ }
+}
+
+// Process a gubed command
+void QuantaDebuggerGubed::processCommand(const QString& datas)
+{
+ kdDebug(24002) << k_funcinfo << ", " << m_command << " : " << datas.left(50) << endl;
+ StringMap args = parseArgs(datas);
+
+ // See what command we got and act accordingly..
+ if(m_command == "commandme")
+ {
+ //sendCommand("sendactiveline", (char*)0L);
+ debuggerInterface()->setActiveLine(mapServerPathToLocal(args["filename"]), args["line"].toLong());
+ sendWatches();
+ if(m_executionState == Trace)
+ sendCommand("wait", (char*)0L);
+
+ if(m_executionState != Pause)
+ sendCommand("next", (char*)0L);
+ }
+ // Send run mode to script
+ else if(m_command == "getrunmode")
+ {
+ debuggingState(true);
+ sendCommand("setdisplaydelay", "newdelay", QString::number(m_displaydelay).ascii(), (char*)0L);
+ if(m_executionState == Pause)
+ sendCommand("pause", (char*)0L);
+ else if(m_executionState == Run)
+ sendCommand("run", (char*)0L);
+ else if(m_executionState == Trace)
+ sendCommand("trace", (char*)0L);
+
+ sendCommand("seterrormask", "errormask", QString::number(m_errormask).ascii(), (char*)0L);
+ }
+ // Just some status info, display on status line
+ else if(m_command == "status")
+ {
+ long argcnt = args["args"].toLong();
+ QString msg = i18n(args["message"]); // How will we get these messages throught to the translators?
+ for(int cnt = 1; cnt <= argcnt; cnt++)
+ msg.replace("%" + QString("%1").arg(cnt) + "%", args[QString("arg%1").arg(cnt)]);
+
+ debuggerInterface()->showStatus(msg, false);
+ }
+ // New current line
+ else if(m_command == "setactiveline")
+ {
+ debuggerInterface()->setActiveLine(mapServerPathToLocal(args["filename"]), args["line"].toLong());
+ }
+ // Script requests breakpointlist
+ else if(m_command == "sendbreakpoints")
+ {
+ sendBreakpoints();
+ }
+ // Parsing failed
+ else if(m_command == "parsefailed")
+ {
+ debuggerInterface()->showStatus(i18n("Syntax or parse error in %1)").arg(args["filenme"]), true);
+ return;
+ }
+ // A debugging session is running
+ else if(m_command == "debuggingon")
+ {
+ debuggingState(true);
+ }
+ // No session is running
+ else if(m_command == "debuggingoff")
+ {
+ debuggingState(false);
+ }
+ // We stumbled upon an error
+ else if(m_command == "error")
+ {
+ // Put the line number first so double clicking will jump to the corrrect line
+ debuggerInterface()->showStatus(i18n("Error occurred: Line %1, Code %2 (%3) in %4").arg(args["line"]).arg(args["errnum"]).arg(args["errmsg"]).arg(args["filename"]), true);
+
+ // Filter to get error code only and match it with out mask
+ long error = args["errnum"].toLong();
+ if(m_errormask & error)
+ setExecutionState(Pause);
+ else if(m_executionState == Trace)
+ setExecutionState(Trace);
+ else if(m_executionState == Run)
+ setExecutionState(Run);
+ else
+ setExecutionState(Pause);
+
+ emit updateStatus(DebuggerUI::HaltedOnError);
+ }
+ // We came across a hard coded breakpoint
+ else if(m_command == "forcebreak")
+ {
+ setExecutionState(Pause);
+ emit updateStatus(DebuggerUI::HaltedOnBreakpoint);
+ debuggerInterface()->showStatus(i18n("Breakpoint reached"), true);
+ }
+ // A conditional breakpoint was fulfilled
+ else if(m_command == "conditionalbreak")
+ {
+ setExecutionState(Pause);
+ emit updateStatus(DebuggerUI::HaltedOnBreakpoint);
+ debuggerInterface()->showStatus(i18n("Conditional breakpoint fulfilled"), true);
+ }
+ // There is a breakpoint set in this file/line
+ else if(m_command == "removebreakpoint")
+ {
+ debuggerInterface()->havenoBreakpoint(mapServerPathToLocal(args["filename"]), args["line"].toLong());
+ }
+ // We're about to debug a file..
+ else if(m_command == "initialize")
+ {
+ debuggerInterface()->showStatus(i18n("Established connection to %1").arg(args["filename"]), false);
+ sendCommand("sendprotocolversion", (char*)0L);
+
+ debuggerInterface()->setActiveLine(mapServerPathToLocal(args["filename"]), 0);
+ sendCommand("havesource", (char*)0L);
+ debuggingState(true);
+ }
+ else if(m_command == "sendingwatches")
+ {
+ //debuggerInterface()->preWatchUpdate();
+ }
+ // Show the contents of a watched variable
+ else if(m_command == "watch")
+ {
+ showWatch(args["variable"]);
+ }
+ // Show the contents of a variable
+ else if(m_command == "variable")
+ {
+ showWatch(args["variable"]);
+ }
+ // Show the contents of a variable
+ else if(m_command == "showcondition")
+ {
+ showCondition(args);
+ }
+ else if(m_command == "sentwatches")
+ {
+ //debuggerInterface()->postWatchUpdate();
+ }
+ // Reached en of an include
+ else if(m_command == "end")
+ {
+ //debuggerInterface()->showStatus(i18n("At end of include %1").arg(data), true);
+ return;
+ }
+ // Check protocol version
+ else if(m_command == "protocolversion")
+ {
+ if(args["version"] != protocolversion)
+ {
+ debuggerInterface()->showStatus(i18n("The script being debugged does not communicate with the correct protocol version"), true);
+ sendCommand("die", (char*)0L);
+ }
+ return;
+ }
+ // Instructions we currently ignore
+ else if(m_command == "sourcesent"
+ || m_command == "addsourceline"
+ )
+ {}
+ else
+ // Unimplemented command - log to debug output
+ kdDebug(24002) << "QuantaDebuggerGubed::slotReadyRead Unknown: " << m_command << ":" << datas << endl;
+}
+
+// Turn on/off actions related to a debugging session
+void QuantaDebuggerGubed::debuggingState(bool enable)
+{
+ debuggerInterface()->enableAction("debug_kill", enable);
+ debuggerInterface()->enableAction("debug_stepout", enable);
+ debuggerInterface()->enableAction("debug_stepinto", enable);
+ debuggerInterface()->enableAction("debug_stepover", enable);
+ debuggerInterface()->enableAction("debug_skip", enable);
+}
+
+void QuantaDebuggerGubed::sendBreakpoints()
+{
+ debuggerInterface()->refreshBreakpoints();
+}
+void QuantaDebuggerGubed::sendWatches()
+{
+ for(QValueList<QString>::iterator it = m_watchlist.begin(); it != m_watchlist.end(); ++it)
+ sendCommand("getwatch", "variable", (*it).ascii(), (char*)0L);
+ sendCommand("sentwatches", "key", (char*)0L, (char*)0L);
+}
+
+// Send a command to gubed
+bool QuantaDebuggerGubed::sendCommand(const QString& command, StringMap args)
+{
+
+ kdDebug(24002) << k_lineinfo << ", command " << command << " with data: " << phpSerialize(args) << endl;
+ if(!m_socket || m_socket->state() != KNetwork::KClientSocketBase::Connected)
+ return false;
+
+ QString buffer = phpSerialize(args);
+
+ buffer = QString(command + ":%1;" + buffer).arg(buffer.length());
+ m_socket->writeBlock(buffer, buffer.length());
+ return true;
+}
+
+// Send a command to gubed
+bool QuantaDebuggerGubed::sendCommand(const QString& command, char * firstarg, ...)
+{
+ StringMap ca;
+ char *next;
+
+ va_list l_Arg;
+ va_start(l_Arg, firstarg);
+
+ next = firstarg;
+ while(next)
+ {
+ ca[(QString)next] = (QString)va_arg(l_Arg, char*);
+// kdDebug(24002) << k_lineinfo << " Added arg/valuepair " << next << ", " << ca[next].left(30) << endl;
+ next = va_arg(l_Arg, char*);
+ }
+
+ va_end(l_Arg);
+ sendCommand(command, ca);
+ return true;
+}
+
+// Return name of debugger
+QString QuantaDebuggerGubed::getName()
+{
+ return "Gubed"; // no i18n on the name
+}
+
+void QuantaDebuggerGubed::showWatch(const QString& data)
+{
+ debuggerInterface()->showVariable(parsePHPVariables(data));
+}
+
+// Send HTTP Request
+void QuantaDebuggerGubed::request()
+{
+ QString request;
+ request = debuggerInterface()->activeFileParts(m_startsession);
+
+ //if(request.startsWith(m_localBasedir, false))
+ // request.remove(0, m_localBasedir.length());
+
+ //request = m_startsession + request;
+ kdDebug(24002) << k_funcinfo << ", request: " << request << endl;
+ debuggerInterface()->sendRequest(request);
+}
+
+
+// Run boy, run (and show whats happening)
+void QuantaDebuggerGubed::trace()
+{
+ setExecutionState(Trace);
+}
+
+// Go as fast as possible and dont update current line or watches
+void QuantaDebuggerGubed::run()
+{
+ setExecutionState(Run);
+}
+
+// Step into function
+void QuantaDebuggerGubed::stepInto()
+{
+ setExecutionState(Pause);
+ sendCommand("next", (char*)0L);
+}
+
+// Step over function
+void QuantaDebuggerGubed::stepOver()
+{
+ setExecutionState(Pause);
+ sendCommand("stepover", (char*)0L);
+}
+
+// Step out of function
+void QuantaDebuggerGubed::stepOut()
+{
+ setExecutionState(Pause);
+ sendCommand("stepout", (char*)0L);
+}
+
+// Skip next function
+void QuantaDebuggerGubed::skip()
+{
+ sendCommand("skip", (char*)0L);
+}
+
+// Kill the running script
+void QuantaDebuggerGubed::kill()
+{
+ sendCommand("die", (char*)0L);
+}
+
+// Pause execution
+void QuantaDebuggerGubed::pause()
+{
+ setExecutionState(Pause);
+}
+
+
+// Add a breakpoint
+void QuantaDebuggerGubed::addBreakpoint (DebuggerBreakpoint* breakpoint)
+{
+ QString type;
+ if(breakpoint->type() == DebuggerBreakpoint::LineBreakpoint)
+ type = "line";
+ else if(breakpoint->type() == DebuggerBreakpoint::ConditionalTrue)
+ type = "true";
+ else
+ type = "change";
+
+ sendCommand("breakpoint",
+ "type", type.ascii(),
+ "filename", mapLocalPathToServer(breakpoint->filePath()).ascii(),
+ "class", breakpoint->inClass().ascii(),
+ "function", breakpoint->inFunction().ascii(),
+ "expression", breakpoint->condition().ascii(),
+ "line", QString::number(breakpoint->line()).ascii(),
+ (char *)0L);
+}
+
+// QString QuantaDebuggerGubed::bpToGubed(DebuggerBreakpoint* breakpoint)
+// {
+// return QString("^" + mapLocalPathToServer(breakpoint->filePath()) +
+// "^" + breakpoint->inClass() +
+// "^" + breakpoint->inFunction() +
+// "^" + (breakpoint->type() == DebuggerBreakpoint::ConditionalTrue ? "true" : "change") +
+// "^" + breakpoint->condition());
+// }
+
+// Clear a breakpoint
+void QuantaDebuggerGubed::removeBreakpoint(DebuggerBreakpoint* breakpoint)
+{
+ QString type;
+ if(breakpoint->type() == DebuggerBreakpoint::LineBreakpoint)
+ type = "line";
+ else if(breakpoint->type() == DebuggerBreakpoint::ConditionalTrue)
+ type = "true";
+ else
+ type = "change";
+
+ sendCommand("removebreakpoint",
+ "type", type.ascii(),
+ "filename", mapLocalPathToServer(breakpoint->filePath()).ascii(),
+ "class", breakpoint->inClass().ascii(),
+ "function", breakpoint->inFunction().ascii(),
+ "expression", breakpoint->condition().ascii(),
+ "line", QString::number(breakpoint->line()).ascii(),
+ (char*)0L);
+}
+
+// A file was opened...
+void QuantaDebuggerGubed::fileOpened(const QString&)
+{
+ sendCommand("reinitialize", (char*)0L);
+}
+
+// Watch a variable
+void QuantaDebuggerGubed::addWatch(const QString &variable)
+{
+ if(m_watchlist.find(variable) == m_watchlist.end())
+ m_watchlist.append(variable);
+ sendCommand("getwatch", "variable", variable.ascii(), (char*)0L);
+}
+// Remove watch
+void QuantaDebuggerGubed::removeWatch(DebuggerVariable *variable)
+{
+ if(m_watchlist.find(variable->name()) != m_watchlist.end())
+ m_watchlist.remove(m_watchlist.find(variable->name()));
+ //sendCommand("unwatchvariable", var->name());
+}
+
+// Show conditional breakpoint state
+void QuantaDebuggerGubed::showCondition(const StringMap &args)
+{
+
+ DebuggerBreakpoint *bp = debuggerInterface()->newDebuggerBreakpoint();
+ bp->setType(args["type"] == "true" ? DebuggerBreakpoint::ConditionalTrue : DebuggerBreakpoint::ConditionalChange);
+ bp->setCondition(args["expression"]);
+ bp->setFilePath(mapServerPathToLocal(args["filename"]));
+ bp->setClass(args["class"]);
+ bp->setFunction(args["function"]);
+ bp->setValue(args["value"]);
+
+ bp->setState(DebuggerBreakpoint::Undefined);
+
+ debuggerInterface()->showBreakpoint(*bp);
+}
+
+// Read configuration
+void QuantaDebuggerGubed::readConfig(QDomNode node)
+{
+ // Server
+ QDomNode valuenode = node.namedItem("serverhost");
+ m_serverHost = valuenode.firstChild().nodeValue();
+ if(m_serverHost.isEmpty())
+ m_serverHost = "localhost";
+
+ valuenode = node.namedItem("serverport");
+ m_serverPort = valuenode.firstChild().nodeValue();
+ if(m_serverPort.isEmpty())
+ m_serverPort = "8026";
+
+ valuenode = node.namedItem("localbasedir");
+ m_localBasedir = valuenode.firstChild().nodeValue();
+ if(debuggerInterface())
+ debuggerInterface()->Mapper()->setLocalBasedir(m_localBasedir);
+
+ valuenode = node.namedItem("serverbasedir");
+ m_serverBasedir = valuenode.firstChild().nodeValue();
+ if(debuggerInterface())
+ debuggerInterface()->Mapper()->setServerBasedir(m_serverBasedir);
+
+ valuenode = node.namedItem("listenport");
+ m_listenPort = valuenode.firstChild().nodeValue();
+ if(m_listenPort.isEmpty())
+ m_listenPort = "8016";
+
+ valuenode = node.namedItem("startsession");
+ m_startsession = valuenode.firstChild().nodeValue();
+ if(m_startsession.isEmpty())
+ m_startsession = "http://localhost/Gubed/StartSession.php?gbdScript=/%rfpp";
+
+ valuenode = node.namedItem("defaultexecutionstate");
+ if(valuenode.firstChild().nodeValue().isEmpty())
+ m_defaultExecutionState = Pause;
+ else
+ m_defaultExecutionState = (State)valuenode.firstChild().nodeValue().toUInt();
+
+ valuenode = node.namedItem("useproxy");
+ m_useproxy = valuenode.firstChild().nodeValue() == "1";
+
+ valuenode = node.namedItem("displaydelay");
+ m_displaydelay = valuenode.firstChild().nodeValue().toLong();
+
+ valuenode = node.namedItem("errormask");
+ m_errormask = valuenode.firstChild().nodeValue().toLong();
+ kdDebug(24002) << k_funcinfo << ", m_errormask = " << m_errormask << endl;
+}
+
+
+// Show configuration
+void QuantaDebuggerGubed::showConfig(QDomNode node)
+{
+ GubedSettings set(protocolversion);
+
+ readConfig(node);
+
+ set.lineServerHost->setText(m_serverHost);
+ set.lineServerPort->setText(m_serverPort);
+ set.lineLocalBasedir->setText(m_localBasedir);
+ set.lineServerBasedir->setText(m_serverBasedir);
+ set.lineServerListenPort->setText(m_listenPort);
+ set.checkUseProxy->setChecked(m_useproxy);
+ set.sliderDisplayDelay->setValue(m_displaydelay);
+ set.lineStartSession->setText(m_startsession);
+ set.comboDefaultExecutionState->setCurrentItem((int)m_defaultExecutionState);
+
+ set.checkBreakOnNotice->setChecked(QuantaDebuggerGubed::Notice & m_errormask);
+ set.checkBreakOnWarning->setChecked(QuantaDebuggerGubed::Warning & m_errormask);
+ set.checkBreakOnUserNotice->setChecked(QuantaDebuggerGubed::User_Notice & m_errormask);
+ set.checkBreakOnUserWarning->setChecked(QuantaDebuggerGubed::User_Warning & m_errormask);
+ set.checkBreakOnUserError->setChecked(QuantaDebuggerGubed::User_Error & m_errormask);
+
+ if(set.exec() == QDialog::Accepted )
+ {
+ QDomElement el;
+
+ el = node.namedItem("serverhost").toElement();
+ if (!el.isNull())
+ el.parentNode().removeChild(el);
+ el = node.ownerDocument().createElement("serverhost");
+ node.appendChild( el );
+ m_serverHost = set.lineServerHost->text();
+ el.appendChild(node.ownerDocument().createTextNode(m_serverHost));
+
+ el = node.namedItem("serverport").toElement();
+ if (!el.isNull())
+ el.parentNode().removeChild(el);
+ el = node.ownerDocument().createElement("serverport");
+ node.appendChild( el );
+ m_serverPort = set.lineServerPort->text();
+ el.appendChild( node.ownerDocument().createTextNode(m_serverPort) );
+
+ el = node.namedItem("localbasedir").toElement();
+ if (!el.isNull())
+ el.parentNode().removeChild(el);
+ el = node.ownerDocument().createElement("localbasedir");
+ node.appendChild( el );
+ m_localBasedir = set.lineLocalBasedir->text();
+ if(debuggerInterface())
+ debuggerInterface()->Mapper()->setLocalBasedir(m_localBasedir);
+ el.appendChild( node.ownerDocument().createTextNode(m_localBasedir) );
+
+ el = node.namedItem("serverbasedir").toElement();
+ if (!el.isNull())
+ el.parentNode().removeChild(el);
+ el = node.ownerDocument().createElement("serverbasedir");
+ node.appendChild( el );
+ m_serverBasedir = set.lineServerBasedir->text();
+ if(debuggerInterface())
+ debuggerInterface()->Mapper()->setServerBasedir(m_serverBasedir);
+ el.appendChild( node.ownerDocument().createTextNode(m_serverBasedir) );
+
+ el = node.namedItem("useproxy").toElement();
+ if (!el.isNull())
+ el.parentNode().removeChild(el);
+ el = node.ownerDocument().createElement("useproxy");
+ node.appendChild( el );
+ m_useproxy = set.checkUseProxy->isChecked();
+ el.appendChild( node.ownerDocument().createTextNode(m_useproxy ? "1" : "0") );
+
+ el = node.namedItem("listenport").toElement();
+ if (!el.isNull())
+ el.parentNode().removeChild(el);
+ el = node.ownerDocument().createElement("listenport");
+ node.appendChild( el );
+ m_listenPort = set.lineServerListenPort->text();
+ el.appendChild( node.ownerDocument().createTextNode(m_listenPort) );
+
+ el = node.namedItem("startsession").toElement();
+ if (!el.isNull())
+ el.parentNode().removeChild(el);
+ el = node.ownerDocument().createElement("startsession");
+ node.appendChild( el );
+ m_startsession = set.lineStartSession->text();
+ el.appendChild(node.ownerDocument().createTextNode(m_startsession));
+
+ el = node.namedItem("defaultexecutionstate").toElement();
+ if (!el.isNull())
+ el.parentNode().removeChild(el);
+ el = node.ownerDocument().createElement("defaultexecutionstate");
+ node.appendChild( el );
+ m_defaultExecutionState = (State)set.comboDefaultExecutionState->currentItem();
+ el.appendChild(node.ownerDocument().createTextNode(QString::number(m_defaultExecutionState)));
+
+
+ el = node.namedItem("displaydelay").toElement();
+ if (!el.isNull())
+ el.parentNode().removeChild(el);
+ el = node.ownerDocument().createElement("displaydelay");
+ node.appendChild( el );
+ m_displaydelay = set.sliderDisplayDelay->value();
+ el.appendChild( node.ownerDocument().createTextNode(QString::number(m_displaydelay)));
+
+ el = node.namedItem("errormask").toElement();
+ if (!el.isNull())
+ el.parentNode().removeChild(el);
+ el = node.ownerDocument().createElement("errormask");
+ node.appendChild( el );
+ m_errormask = (set.checkBreakOnNotice->isChecked() ? QuantaDebuggerGubed::Notice : 0)
+ + (set.checkBreakOnWarning->isChecked() ? QuantaDebuggerGubed::Warning : 0)
+ + (set.checkBreakOnUserNotice->isChecked() ? QuantaDebuggerGubed::User_Notice : 0)
+ + (set.checkBreakOnUserWarning->isChecked() ? QuantaDebuggerGubed::User_Warning : 0)
+ + (set.checkBreakOnUserError->isChecked() ? QuantaDebuggerGubed::User_Error : 0);
+ kdDebug(24002) << k_funcinfo << ", m_errormask = " << m_errormask << endl;
+ el.appendChild( node.ownerDocument().createTextNode(QString::number(m_errormask)));
+
+ }
+}
+
+// Map a server filepath to a local one using project settings
+QString QuantaDebuggerGubed::mapServerPathToLocal(const QString& serverpath)
+{
+ // Translate filename from server to local
+ return debuggerInterface()->Mapper()->mapServerPathToLocal(serverpath);
+}
+
+// Map a local filepath to a server one using project settings
+QString QuantaDebuggerGubed::mapLocalPathToServer(const QString& localpath)
+{
+ // Translate filename from local to server
+ return debuggerInterface()->Mapper()->mapLocalPathToServer(localpath);
+}
+
+void QuantaDebuggerGubed::variableSetValue(const DebuggerVariable &variable)
+{
+ sendCommand("setvariable",
+ "variable", variable.name().ascii(),
+ "value", variable.value().ascii(),
+ (char*)0L);
+}
+
+QString QuantaDebuggerGubed::phpSerialize(StringMap args)
+{
+ StringMap::Iterator it;
+ // a:2:{s:4:"name";s:7:"Jessica";s:3:"age";s:2:"26";s:4:"test";i:1;}
+ QString ret = QString("a:%1:{").arg(args.size());
+ for( it = args.begin(); it != args.end(); ++it )
+ {
+ bool isNumber;
+
+ it.data().toInt(&isNumber);
+ if(isNumber && !it.data().isEmpty())
+ ret += QString("s:%1:\"%2\";i:%3;")
+ .arg(it.key().length())
+ .arg(it.key())
+ .arg(it.data());
+ else
+ ret += QString("s:%1:\"%2\";s:%3:\"%4\";")
+ .arg(it.key().length())
+ .arg(it.key())
+ .arg(it.data().length())
+ .arg(it.data());
+
+ }
+
+ ret += "}";
+ return ret;
+}
+
+
+StringMap QuantaDebuggerGubed::parseArgs(const QString &args)
+{
+ StringMap ca;
+ long cnt, length;
+
+ // a:2:{s:4:"name";s:7:"Jessica";s:3:"age";s:2:"26";s:4:"test";i:1;}
+
+ // No args
+ if(args.isEmpty() || args == "a:0:{}")
+ return ca;
+
+ // Make sure we have a good string
+ if(!args.startsWith("a:"))
+ {
+ kdDebug(24002) << k_funcinfo << "An error occurred in the communication link, data received was:" << args << endl;
+ return ca;
+ }
+
+ cnt = args.mid(2, args.find("{") - 3).toLong();
+ QString data = args.mid(args.find("{") + 1);
+
+ QString tmp, func;
+ while(cnt > 0)
+ {
+ tmp = data.left(data.find("\""));
+ length = tmp.mid(2, tmp.length() - 3).toLong();
+
+ func = data.mid(tmp.length() + 1, length);
+ data = data.mid( tmp.length() + length + 3);
+
+ if(data.left(1) == "i")
+ {
+ // Integer data
+ tmp = data.mid(data.find(":") + 1);
+ tmp = tmp.left(tmp.find(";"));
+ ca[func] = tmp;
+ data = data.mid(tmp.length() + 3);
+// kdDebug(24002) << k_funcinfo << "**i " << func << ": " << ca[func] << endl;
+ }
+ else
+ {
+ // String data
+ tmp = data.left(data.find("\""));
+ length = tmp.mid(2, tmp.length() - 3).toLong();
+
+ ca[func] = data.mid(tmp.length() + 1, length);
+ data = data.mid( tmp.length() + length + 3);
+// kdDebug(24002) << k_funcinfo << "**s " << func << ": " << ca[func] << endl;
+ }
+
+ cnt--;
+ }
+
+ return ca;
+}
+
+DebuggerVariable* QuantaDebuggerGubed::parsePHPVariables(const QString &varstring)
+{
+ QString str = varstring;
+ DebuggerVariable* var = parsePHPVariables(str);
+ return var;
+}
+
+DebuggerVariable* QuantaDebuggerGubed::parsePHPVariables(QString &str)
+{
+ QString key, data;
+ QString tempstring;
+ int length;
+ DebuggerVariable* debuggervar = NULL;
+
+ // get type of key
+ QString type = str.left(1);
+ str.remove(0, 2);
+
+ // Strings
+ if(type == "s")
+ {
+ // Get length of key
+ tempstring = str.left(str.find(':'));
+ str.remove(0, str.find(':') + 1);
+ length = tempstring.toUInt();
+
+ key = str.left(length + 1);
+ key.remove(0, 1); // remove starting quote
+ str.remove(0, length + 3);
+ }
+ else if(type == "i")
+ {
+ key = str.left(str.find(';'));
+ str.remove(0, str.find(';') + 1);
+
+ }
+
+ // Get type of data
+ type = str.left(1);
+ str.remove(0, 2);
+
+ if(type == "i")
+ {
+ /* Example:
+ s:4:"$row";i:6;
+ */
+ data = str.left(str.find(';'));
+ str.remove(0, str.find(';') + 1);
+ debuggervar = debuggerInterface()->newDebuggerVariable(key, data, DebuggerVariableTypes::Integer);
+
+ }
+ else if(type == "b")
+ {
+ /* Example:
+ s:8:"$boolvar";b:1;
+ */
+ data = str.left(str.find(';'));
+ data = (data == "0" ? i18n("False"): i18n("True"));
+ str.remove(0, str.find(';') + 1);
+ debuggervar = debuggerInterface()->newDebuggerVariable(key, data, DebuggerVariableTypes::Boolean);
+ }
+ else if(type == "N")
+ {
+ /* Example:
+ s:6:"return";N;
+ */
+ debuggervar = debuggerInterface()->newDebuggerVariable(key, i18n("<Undefined>"), DebuggerVariableTypes::Undefined);
+ }
+ else if(type == "s")
+ {
+ /* Example:
+ s:7:"$strvar";s:16:"This is a string";
+ */
+
+ // Get length of string
+ tempstring = str.left(str.find(':'));
+ str.remove(0, str.find(':') + 1);
+ length = tempstring.toUInt();
+
+ data = str.left(length + 1);
+ data.remove(0, 1); // remove starting quote
+ str.remove(0, length + 3);
+ debuggervar = debuggerInterface()->newDebuggerVariable(key, data, DebuggerVariableTypes::String);
+ debuggervar->setSize(length);
+ }
+ else if(type == "a")
+ {
+ /* Example:
+ s:6:"$array";a:5:{s:11:"Ingredients";a:3:{i:0;s:8:"potatoes";i:1;s:4:"salt";i:2;s:6:"pepper";}s:6:"Guests";a:4:{i:0;s:5:"Fiona";i:1;s:4:"Tori";i:2;s:4:"Neil";i:3;s:4:"Nick";}s:4:"Dogs";a:4:{i:0;s:5:"Kitty";i:1;s:5:"Tessy";i:2;s:5:"Fanny";i:3;s:5:"Cosmo";}s:7:"Numbers";a:6:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:9;i:4;i:8;i:5;i:7;}s:6:"Letter";s:1:"L";}
+ */
+
+ // Get length of array
+ tempstring = str.left(str.find(':'));
+ str.remove(0, str.find(':') + 2);
+ length = tempstring.toUInt();
+
+ QPtrList<DebuggerVariable> vars ;
+ while(length > 0)
+ {
+ //kdDebug(24002) << "VariablesListView::parsePHPVariables: length " << length << ", \"" << str << "\"" << endl;
+
+ length --;
+ DebuggerVariable* var = parsePHPVariables(str);
+ if(var)
+ vars.append(var);
+
+ }
+ str.remove(0, 1);
+ debuggervar = debuggerInterface()->newDebuggerVariable(key, vars, DebuggerVariableTypes::Array);
+ }
+ else if(type == "O")
+ {
+ /* Example:
+
+ */
+
+ // Get length of array
+ tempstring = str.left(str.find(':'));
+ str.remove(0, str.find(':') + 2);
+ tempstring = str.mid(str.find(':') + 1);
+ tempstring = tempstring.left(tempstring.find(':'));
+ length = tempstring.toUInt();
+
+ str.remove(0, str.find('{') + 1);
+
+ QPtrList<DebuggerVariable> vars ;
+ while(length > 0)
+ {
+ //kdDebug(24002) << "VariablesListView::parsePHPVariables: length " << length << ", \"" << str << "\"" << endl;
+
+ length --;
+ DebuggerVariable* var = parsePHPVariables(str);
+ if(var)
+ vars.append(var);
+
+ }
+ str.remove(0, 1);
+ debuggervar = debuggerInterface()->newDebuggerVariable(key, vars, DebuggerVariableTypes::Object);
+ }
+ else if(type == "d")
+ {
+ /* Example:
+ s:9:"$floatvar";d:12.5600000000000004973799150320701301097869873046875;"
+ */
+ data = str.left(str.find(';'));
+ str.remove(0, str.find(';') + 1);
+ debuggervar = debuggerInterface()->newDebuggerVariable(key, data, DebuggerVariableTypes::Float);
+
+ }
+ else if(type == "-")
+ {
+ debuggervar = debuggerInterface()->newDebuggerVariable(key, i18n("<Undefined>"), DebuggerVariableTypes::Undefined);
+ }
+ else if(type == "!")
+ {
+ debuggervar = debuggerInterface()->newDebuggerVariable(key, i18n("<Error>"), DebuggerVariableTypes::Error);
+ }
+ else
+ {
+ kdDebug(24002) << "VariablesListView::parsePHPVariables: Unknown variable type " << type << ", " << str << endl;
+ debuggervar = debuggerInterface()->newDebuggerVariable(key, i18n("<Unimplemented type>"), DebuggerVariableTypes::Error);
+ }
+
+ return debuggervar;
+
+}
+
+
+#include "quantadebuggergubed.moc"
diff --git a/quanta/components/debugger/gubed/quantadebuggergubed.desktop b/quanta/components/debugger/gubed/quantadebuggergubed.desktop
new file mode 100644
index 00000000..d2020cb7
--- /dev/null
+++ b/quanta/components/debugger/gubed/quantadebuggergubed.desktop
@@ -0,0 +1,48 @@
+[Desktop Entry]
+Type=Service
+Name=Gubed
+Name[ne]=ग्युब्ड
+Name[ta]=குபெட்
+Comment=Quanta debugger plugin to interact with the Gubed PHP debugger, see http://gubed.sf.net
+Comment[bg]=Приставка на Quanta за връзка с дебъгера Gubed PHP, http://gubed.sf.net
+Comment[ca]=Connector de depuració pel Quanta que interactua amb el depurador Gubed PHP, consulteu http://gubed.sf.net
+Comment[cs]=Ladicí modul Quanty s Gubed PHP debuggerem, viz http://gubed.sf.net
+Comment[da]=Quanta fejlretter-plugin til at virke sammen med Gubed PHP fejlretter, se http://gubed.sf.net
+Comment[de]=Debug-Komponente von Quanta für die Unterstützung des Gubed PHP-Debuggers. Näheres siehe http://gubed.sf.net
+Comment[el]=Αποσφαλματωτής Quanta σε συνεργασία με το αποσφαλματωτή Gubed PHP, δείτε http://gubed.sf.net
+Comment[es]=Accesorio de depuración de Quanta, para interactuar con el depurador de PHP Gubed. Vea http://gubed.sf.net
+Comment[et]=Quanta siluriplugin koostööks PHP siluriga Gubed (vaata http://gubed.sf.net)
+Comment[eu]=Gubed PHP araztailearekin lan egiteko Quanta araztailearen plugina, ikusi http://gubed.sf.net
+Comment[fa]=وصلۀ اشکال‌زدای Quanta برای تعامل با اشکال‌زدای Gubed PHP، http://gubed.sf.net را ببینید
+Comment[fi]=Gubed PHP debuggerin plugin Quantan debuggeriin (katso http://gubed.sf.net)
+Comment[fr]=Module de débogage de Quanta pour interagir avec le débogueur PHP Gubed ; consulter http://gubed.sf.net.
+Comment[gl]=Plugin de depuración de Quanta para interactuar co depurador de PHP Gubed, vexa tamén http://gubed.sf.net
+Comment[hu]=Quanta-nyomkövető (bővítőmodulként) a Gubed PHP-nyomkövetőhöz, lásd: http://gubed.sf.net
+Comment[is]=Quanta aflúsunaríforrit til samskipta við Gubed PHP aflúsarann. Sjá http://gubed.sf.net
+Comment[it]=Plugin debugger di Quanta per interagire con il debugger PHP Gubed, vedi http://gubed.sf.net
+Comment[ja]=Gubed PHP デバッガと対話する Quanta デバッガ。詳細は http://gubed.sf.net
+Comment[ka]=Quanta-ს განბზიკვის მოდული Gubed PHP განბზიკავთან დასაკავშირებლად, იხილეთ http://gubed.sf.net
+Comment[lt]=Quanta derintuvės priedas skirtas dirbti su Gubed PHP derintuve, žr.http://gubed.sf.net
+Comment[ms]=Plug masuk penyah-ralat Quanta untuk berinteraksi dengan penyah-ralat Gubed PHP, lihat http://gubed.sf.net
+Comment[nds]=Fehlersöök-Moduul för Quanta för't Tosamenwarken mit den PHP-Fehlersöker "Gubed", kiek op http://gubed.sf.net
+Comment[ne]=ग्युब्ड पीएचपी त्रुटिमोचकसँग अन्तर्क्रिया गर्नका लागि क्वान्टा त्रुटिमोचक प्लगइन, http://gubed.sf.net हेर्नुहोस्
+Comment[nl]=Quanta debugger plugin om te communiceren met de Gubed PHP debugger, zie http://gubed.sf.net
+Comment[pl]=Wtyczka debuggera Quanty współpracująca z debuggerem PHP Gubed , patrz http://gubed.sf.net
+Comment[pt]='Plugin' de Depuração do Quanta para interagir com o depurador de PHP Gubed, veja http://gubed.sf.net
+Comment[pt_BR]=Plugin do debugger do Quanta para interagir com o debugger PHP Gubed, olhe http://gubed.sf.net
+Comment[ru]=Модуль отладчика Quanta для связи с Gubed, отладчиком PHP, см. http://gubed.sf.net
+Comment[sk]=Quanta debuger modul pre interakciu s Gubed PHP debugerom, pozrihttp://gubed.sf.net
+Comment[sl]=Vstavek razhroščevanja v Quanti, ki sodeluje z razhroščevalnikom Gubed PHP, glejte http://gubed.sf.net
+Comment[sr]=Исправљачки прикључак Quanta-е за интеракцију са исправљачем PHP-а Gubed, погледајте http://gubed.sf.net
+Comment[sr@Latn]=Ispravljački priključak Quanta-e za interakciju sa ispravljačem PHP-a Gubed, pogledajte http://gubed.sf.net
+Comment[sv]=Quanta-insticksprogram för felsökning som fungerar med PHP-felsökaren Gubed, se http://gubed.sf.net
+Comment[ta]=குவாண்டா வழுநீக்கி உள்ளீடு குபெட்PHP வழுநீக்கியோடு தொடர்புக் கொண்டிருக்கிறது, பார்க்கவும் http://gubed.sf.net
+Comment[tg]=Модули ғалатёби Quanta барои алоқаи аз Gubed, ғалатёби PHP, нишон кунед http://gubed.sf.net
+Comment[tr]=Gubed PHP hata ayıklayıcısıyla iletişim kurmayı sağlayan Quanta hata ayıklama eklentisi, http://gubed.sf.net adresini ziyaret edin
+Comment[uk]=Втулок зневадження Quanta для зв'язку зі зневаджувачем PHP -- Gubed, див. http://gubed.sf.net
+Comment[zh_CN]=与 Gubed PHP 调试器交互 Quanta 调试器插件,见 http://gubed.sf.net
+Comment[zh_HK]=Quanta 對於 Gubed PHP 除錯器的通訊外掛程式, 請參閱 http://gubed.sf.net
+Comment[zh_TW]=Quanta 對於 Gubed PHP 除錯器的通訊外掛程式, 請參閱 http://gubed.sf.net
+Icon=kdbg
+ServiceTypes=Quanta/Debugger
+X-KDE-Library=quantadebuggergubed
diff --git a/quanta/components/debugger/gubed/quantadebuggergubed.h b/quanta/components/debugger/gubed/quantadebuggergubed.h
new file mode 100644
index 00000000..62acac0b
--- /dev/null
+++ b/quanta/components/debugger/gubed/quantadebuggergubed.h
@@ -0,0 +1,153 @@
+/***************************************************************************
+ phpdebuggubed.cpp
+ -------------------
+ begin : 2004-03-12
+ copyright : (C) 2004 Linus McCabe <linus@mccabe.nu>
+ ***************************************************************************/
+
+/****************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef QUANTADEBUGGERGUBED_H
+#define QUANTADEBUGGERGUBED_H
+
+#include <kserversocket.h>
+#include <kstreamsocket.h>
+#include <qptrlist.h>
+#include <kurl.h>
+#include <qdom.h>
+
+#include "debuggerclient.h"
+
+typedef QValueList<QString> WatchList;
+typedef QMap<QString, QString> StringMap;
+
+class QuantaDebuggerGubed : public DebuggerClient
+{
+ Q_OBJECT
+
+ public:
+ QuantaDebuggerGubed(QObject *parent, const char* name, const QStringList&);
+ ~QuantaDebuggerGubed();
+
+ // Execution states
+ enum State
+ {
+ Pause = 0,
+ Trace,
+ Run
+ };
+ // Error codes
+ enum Errors
+ {
+ Warning = 2,
+ Notice = 8,
+ User_Error = 256,
+ User_Warning = 512,
+ User_Notice = 1024
+ };
+
+ // Protocol version
+ static const char protocolversion[];
+
+ // Manager interaction
+ const uint supports(DebuggerClientCapabilities::Capabilities);
+
+ // Execution control
+ void request();
+ void trace();
+ void run();
+ void skip();
+ void stepInto();
+ void stepOver();
+ void stepOut();
+ void pause();
+ void kill();
+ void setExecutionState(State newstate);
+
+ // Connection
+ void startSession();
+ void endSession();
+
+ // Return name of debugger
+ QString getName();
+
+ // New file opened in quanta
+ void fileOpened(const QString& file);
+
+ // Settings
+ void readConfig(QDomNode node);
+ void showConfig(QDomNode node);
+
+ // Breakpoints
+ void addBreakpoint(DebuggerBreakpoint* breakpoint);
+ void removeBreakpoint(DebuggerBreakpoint* breakpoint);
+ void showCondition(const StringMap &args);
+
+ // Variables
+ void addWatch(const QString &variable);
+ void removeWatch(DebuggerVariable *var);
+ void variableSetValue(const DebuggerVariable &variable);
+
+ private:
+ KNetwork::KStreamSocket *m_socket;
+ KNetwork::KServerSocket *m_server;
+ QString m_command, m_buffer;
+ long m_datalen;
+
+ QString m_serverBasedir;
+ QString m_localBasedir;
+ QString m_serverPort;
+ QString m_serverHost;
+ QString m_startsession;
+ QString m_listenPort;
+ bool m_useproxy;
+ State m_executionState, m_defaultExecutionState;
+ long m_errormask;
+ long m_displaydelay;
+
+ WatchList m_watchlist;
+
+// bool sendCommand(const QString&, const QString&);
+ bool sendCommand(const QString& command, StringMap args);
+ bool sendCommand(const QString& command, char * firstarg, ...);
+
+ void processCommand(const QString&);
+ void sendWatches();
+ void sendBreakpoints();
+ void debuggingState(bool enable);
+ void connected();
+
+ QString mapServerPathToLocal(const QString& serverpath);
+ QString mapLocalPathToServer(const QString& localpath);
+ QString bpToGubed(DebuggerBreakpoint* breakpoint);
+
+ // Communication helpers
+ QString phpSerialize(StringMap args);
+ StringMap parseArgs(const QString &args);
+
+ // Variables
+ DebuggerVariable* parsePHPVariables(const QString &varstring);
+ DebuggerVariable* parsePHPVariables(QString &str);
+ void showWatch(const QString& data);
+
+
+ public slots:
+ // Socket slots
+ void slotConnected(const KNetwork::KResolverEntry &);
+ void slotConnectionClosed();
+ void slotError(int error);
+ void slotReadyRead();
+ void slotReadyAccept();
+
+ signals:
+ void updateStatus(DebuggerUI::DebuggerStatus);
+};
+
+#endif