summaryrefslogtreecommitdiffstats
path: root/quanta/components/debugger/interfaces
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/interfaces
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/interfaces')
-rw-r--r--quanta/components/debugger/interfaces/Makefile.am17
-rw-r--r--quanta/components/debugger/interfaces/debuggerclient.cpp160
-rw-r--r--quanta/components/debugger/interfaces/debuggerclient.h115
-rw-r--r--quanta/components/debugger/interfaces/debuggerinterface.cpp26
-rw-r--r--quanta/components/debugger/interfaces/debuggerinterface.h80
-rw-r--r--quanta/components/debugger/interfaces/quantadebugger.desktop45
6 files changed, 443 insertions, 0 deletions
diff --git a/quanta/components/debugger/interfaces/Makefile.am b/quanta/components/debugger/interfaces/Makefile.am
new file mode 100644
index 00000000..dba1986b
--- /dev/null
+++ b/quanta/components/debugger/interfaces/Makefile.am
@@ -0,0 +1,17 @@
+
+METASOURCES = AUTO
+
+noinst_LTLIBRARIES = libdebuggerinterface.la
+libdebuggerinterface_la_LDFLAGS = $(all_libraries)
+libdebuggerinterface_la_SOURCES = debuggerinterface.cpp debuggerclient.cpp
+
+
+# Definition of the service type
+kde_servicetypes_DATA = quantadebugger.desktop
+
+
+INCLUDES = -I$(top_srcdir)/quanta/components/debugger \
+ -I$(top_srcdir)/quanta/components/debugger/interfaces \
+ -I$(top_srcdir)/quanta/project \
+ -I$(top_srcdir)/utility \
+ $(all_includes)
diff --git a/quanta/components/debugger/interfaces/debuggerclient.cpp b/quanta/components/debugger/interfaces/debuggerclient.cpp
new file mode 100644
index 00000000..8c3196d9
--- /dev/null
+++ b/quanta/components/debugger/interfaces/debuggerclient.cpp
@@ -0,0 +1,160 @@
+/***************************************************************************
+ debuggerclient.cpp
+ -------------------
+ begin : 2004-03-12
+ copyright : (C) 2004 Linus McCabe <linus@mccabe.nu>
+ Based on work by Mathieu Kooiman
+ ***************************************************************************/
+
+/****************************************************************************
+ * *
+ * 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 "debuggerclient.h"
+#include "debuggerinterface.h"
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+
+// CTor
+DebuggerClient::DebuggerClient(QObject *parent, const char* name)
+ : QObject(parent, name)
+{
+ m_active = false;
+}
+
+
+DebuggerInterface* DebuggerClient::debuggerInterface()
+{
+ return static_cast<DebuggerInterface*>( parent()->child( 0, "DebuggerInterface" ) );
+}
+
+// Active state of session
+bool DebuggerClient::isActive()
+{
+ return m_active;
+}
+
+void DebuggerClient::unSupportedAction(const QString &action)
+{
+ KMessageBox::error(NULL, i18n("The current debugger, %1, does not support the \"%2\" instruction.").arg(this->getName()).arg(action), i18n("Unsupported Debugger Function"));
+
+}
+
+// Unimplemented defaults - Pause execution
+void DebuggerClient::pause()
+{
+ unSupportedAction(i18n("Pause"));
+}
+
+// Unimplemented defaults - Send Request
+void DebuggerClient::request()
+{
+ unSupportedAction(i18n("Send HTTP Request"));
+}
+
+// Unimplemented defaults - step over
+void DebuggerClient::stepOver()
+{
+ unSupportedAction(i18n("Step Over"));
+
+}
+
+// Unimplemented defaults - step out
+void DebuggerClient::stepOut()
+{
+ unSupportedAction(i18n("Step Out"));
+
+}
+
+// Unimplemented defaults - trace
+void DebuggerClient::trace()
+{
+ unSupportedAction(i18n("Trace"));
+}
+// Unimplemented defaults - Run
+void DebuggerClient::run()
+{
+ unSupportedAction(i18n("Run"));
+}
+// Unimplemented defaults - skip
+void DebuggerClient::skip()
+{
+ unSupportedAction(i18n("Skip"));
+}
+// Unimplemented defaults - stepInto
+void DebuggerClient::stepInto()
+{
+ unSupportedAction(i18n("Step Into"));
+}
+// Unimplemented defaults - kill
+void DebuggerClient::kill()
+{
+ unSupportedAction(i18n("Kill"));
+
+}
+
+// Unimplemented defaults
+void DebuggerClient::profilerOpen( )
+{
+ unSupportedAction(i18n("Open Profiler Output"));
+}
+
+// Unimplemented defaults
+void DebuggerClient::fileOpened(const QString&)
+{
+ return;
+}
+
+// Unimplemented defaults
+void DebuggerClient::addBreakpoint(DebuggerBreakpoint*)
+{
+ unSupportedAction(i18n("Set Breakpoint"));
+
+}
+
+// Unimplemented defaults
+void DebuggerClient::removeBreakpoint(DebuggerBreakpoint*)
+{
+ unSupportedAction(i18n("Remove Breakpoint"));
+}
+
+
+// Unimplemented defaults
+void DebuggerClient::showConfig(QDomNode)
+{
+ KMessageBox::error(NULL, i18n("%1 does not have any specific settings.").arg(this->getName()), i18n("Settings"));
+}
+
+// Unimplemented defaults
+void DebuggerClient::readConfig(QDomNode)
+{
+
+}
+
+// Unimplemented defaults: add watch
+void DebuggerClient::addWatch(const QString &)
+{
+ KMessageBox::error(NULL, i18n("%1 does not support watches.").arg(this->getName()), i18n("Unsupported Debugger Function"));
+}
+
+// Unimplemented defaults: Remove watch
+void DebuggerClient::removeWatch(DebuggerVariable *)
+{
+ // Giving an error seems pointless, since you shouldnt be able to add a watch in the first place...
+ KMessageBox::error(NULL, i18n("%1 does not support watches.").arg(this->getName()), i18n("Unsupported Debugger Function"));
+}
+
+// Unimplemented defaults: set value of varialbe
+void DebuggerClient::variableSetValue(const DebuggerVariable &)
+{
+ KMessageBox::error(NULL, i18n("%1 does not support setting the value of variables.").arg(this->getName()), i18n("Unsupported Debugger Function"));
+}
+
+#include "debuggerclient.moc"
diff --git a/quanta/components/debugger/interfaces/debuggerclient.h b/quanta/components/debugger/interfaces/debuggerclient.h
new file mode 100644
index 00000000..d50526cc
--- /dev/null
+++ b/quanta/components/debugger/interfaces/debuggerclient.h
@@ -0,0 +1,115 @@
+/***************************************************************************
+ phpdebugsocket.h
+ -------------------
+ begin : 2004-03-12
+ copyright : (C) 2004 Linus McCabe <linus@mccabe.nu>
+ Based on work by Mathieu Kooiman
+ ***************************************************************************/
+
+/****************************************************************************
+ * *
+ * 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 _DEBUGGERCLIENT_H
+#define _DEBUGGERCLIENT_H
+
+#include <qserversocket.h>
+#include <qobject.h>
+#include <kurl.h>
+#include <qdom.h>
+
+#include "debuggerui.h"
+
+class DebuggerInterface;
+class DebuggerBreakpoint;
+class DebuggerVariable;
+
+namespace DebuggerClientCapabilities
+{
+ enum Capabilities
+ {
+ // Session related
+ StartSession = 1000,
+ EndSession,
+
+ // Breakpoint related
+ LineBreakpoints = 2000,
+ ConditionalBreakpoints,
+
+ // Variable related
+ Watches = 4000,
+ VariableSetValue,
+
+ // Execution related
+ Run = 5000,
+ Trace,
+ Pause,
+ Kill,
+ StepInto,
+ StepOver,
+ StepOut,
+ Skip,
+
+ // Profiler related
+ ProfilerOpen = 6000
+ };
+}
+
+class DebuggerClient : public QObject
+{
+ Q_OBJECT
+
+ private:
+ protected:
+ DebuggerClient(QObject *parent, const char* name);
+
+ bool m_active;
+
+ public:
+ virtual const uint supports(DebuggerClientCapabilities::Capabilities) = 0;
+ virtual void startSession() = 0;
+ virtual void endSession() = 0;
+ virtual QString getName() = 0;
+
+ // Execution control
+ virtual void request();
+ virtual void run();
+ virtual void trace();
+ virtual void skip();
+ virtual void stepOver();
+ virtual void stepInto();
+ virtual void stepOut();
+ virtual void kill();
+ virtual void pause();
+
+ // Settings
+ virtual void readConfig(QDomNode node);
+ virtual void showConfig(QDomNode node);
+
+ // Profiler
+ virtual void profilerOpen();
+
+ // Misc
+ virtual void fileOpened(const QString& file);
+ virtual void addBreakpoint(DebuggerBreakpoint* breakpoint);
+ virtual void removeBreakpoint(DebuggerBreakpoint* breakpoint);
+ virtual void addWatch(const QString &);
+ virtual void removeWatch(DebuggerVariable*);
+ virtual void variableSetValue(const DebuggerVariable &variable);
+
+ void unSupportedAction(const QString &action);
+
+ bool isActive();
+ DebuggerInterface *debuggerInterface();
+
+ signals:
+ void updateStatus(DebuggerUI::DebuggerStatus);
+
+};
+
+#endif
diff --git a/quanta/components/debugger/interfaces/debuggerinterface.cpp b/quanta/components/debugger/interfaces/debuggerinterface.cpp
new file mode 100644
index 00000000..5481180c
--- /dev/null
+++ b/quanta/components/debugger/interfaces/debuggerinterface.cpp
@@ -0,0 +1,26 @@
+/***************************************************************************
+ debuggerinterface.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 "debuggerinterface.h"
+
+DebuggerInterface::DebuggerInterface (QObject *parent, const char* name)
+ : QObject(parent, name)
+{
+}
+
+
+#include "debuggerinterface.moc"
diff --git a/quanta/components/debugger/interfaces/debuggerinterface.h b/quanta/components/debugger/interfaces/debuggerinterface.h
new file mode 100644
index 00000000..8c527979
--- /dev/null
+++ b/quanta/components/debugger/interfaces/debuggerinterface.h
@@ -0,0 +1,80 @@
+/***************************************************************************
+ debuggerinterface.h
+ -------------------
+ 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 DEBUGGERINTERFACE_H
+#define DEBUGGERINTERFACE_H
+
+#include <qobject.h>
+#include <qstring.h>
+#include <kurl.h>
+
+#include "debuggervariable.h"
+#include "debuggerbreakpoint.h"
+#include "backtracelistview.h"
+
+class PathMapper;
+
+class DebuggerInterface : public QObject
+{
+ Q_OBJECT
+
+ private:
+
+
+ public:
+ DebuggerInterface(QObject *parent, const char* name);
+
+ // Breakpoints
+ virtual void haveBreakpoint (const QString& file, int line) = 0;
+ virtual void havenoBreakpoint (const QString& file, int line) = 0;
+
+ // Public help functions
+ virtual bool showStatus(const QString& message, bool log) = 0;
+ virtual bool setActiveLine (const QString& file, int line) = 0;
+
+ virtual void enableAction(const QString& action, bool enable) = 0;
+ virtual void fileOpened(const QString& file) = 0;
+ virtual void sendRequest(const KURL &url) = 0;
+ virtual const QString activeFileParts(const QString & str) = 0;
+
+ // Watch handling
+ //virtual void preWatchUpdate() = 0;
+ //virtual void postWatchUpdate() = 0;
+
+ virtual DebuggerVariable* newDebuggerVariable(const QString& name, const QString& value, int type) = 0;
+ virtual DebuggerVariable* newDebuggerVariable(const QString& name, const ValueList_t& values, int type) = 0;
+ virtual void showVariable(DebuggerVariable*) = 0;
+
+ // Backtrace
+ virtual void backtraceClear() = 0;
+ virtual void backtraceShow(long level, BacktraceType type, const QString &filename, long line, const QString& func) = 0;
+
+
+ // Breakpoints
+ virtual void showBreakpoint(const DebuggerBreakpoint &bp) = 0;
+ virtual void refreshBreakpoints() = 0;
+ virtual DebuggerBreakpoint * newDebuggerBreakpoint() = 0;
+ virtual DebuggerBreakpoint * findDebuggerBreakpoint(const QString& key) = 0;
+ virtual void updateBreakpointKey(const DebuggerBreakpoint &bp, const QString& newkey) = 0;
+
+ // Path mapping
+ virtual PathMapper* Mapper() = 0;
+};
+
+#endif
+
+
diff --git a/quanta/components/debugger/interfaces/quantadebugger.desktop b/quanta/components/debugger/interfaces/quantadebugger.desktop
new file mode 100644
index 00000000..56d05e04
--- /dev/null
+++ b/quanta/components/debugger/interfaces/quantadebugger.desktop
@@ -0,0 +1,45 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=Quanta/Debugger
+Comment=A Quanta Debugger plugin
+Comment[bg]=Приставка на Quanta за дебъгване
+Comment[br]=Ul lugent dizraener Quanta
+Comment[ca]=Un connector de depuració pel Quanta
+Comment[cs]=Ladicí modul Quanty
+Comment[da]=Et Quanta fejlretter-plugin
+Comment[de]=Eine Quanta Debugger-Komponente
+Comment[el]=Πρόσθετο αποσφαλματωτή Quanta
+Comment[es]=Un accesorio para un depurador de Quanta
+Comment[et]=Quanta siluriplugin
+Comment[eu]=Quanta araztailearen plugina
+Comment[fa]=وصلۀ اشکال‌زدای Quanta
+Comment[fi]=Quantan debuggerin plugin
+Comment[fr]=Un module de débogage pour Quanta
+Comment[ga]=Breiseán dífhabhtóra Quanta
+Comment[gl]=Un plugin para o depurador de Quanta
+Comment[hu]=Quanta nyomkövető-modul
+Comment[is]=Quanta aflúsunaríforrit
+Comment[it]=Un plugin debugger di Quanta
+Comment[ja]=Quanta デバッガプラグイン
+Comment[ka]=Quanta-ს განბზიკვის მოდული
+Comment[lt]=Quanta derintuvės priedas
+Comment[ms]=Plug masuk penyah-ralat Quanta
+Comment[nds]=En Fehlersöök-Komponent för Quanta
+Comment[ne]=एउटा क्वान्टा त्रुटिमोचक प्लगइन
+Comment[nl]=Een Quanta debugger-plugin
+Comment[pl]=Wtyczka debuggera Quanty
+Comment[pt]=Um 'plugin' de depuração para o Quanta
+Comment[pt_BR]=Um plugin do Debugger do Quanta
+Comment[ru]=Модуль отладки Quanta
+Comment[sk]=Quanta debuger modul
+Comment[sl]=Vstavek razhroščevanja v Quanti
+Comment[sr]=Исправљачки прикључак Quanta-е
+Comment[sr@Latn]=Ispravljački priključak Quanta-e
+Comment[sv]=Ett Quanta-insticksprogram för felsökning
+Comment[ta]=குவாண்டா வழுநீக்கி சொருகு
+Comment[tg]=Модули ғалатёби Quanta
+Comment[tr]=Bir Quanta Hata Ayıklayıcı eklentisi
+Comment[uk]=Втулок зневадження Quanta
+Comment[zh_CN]=Quanta 调试器插件
+Comment[zh_HK]=一個 Quanta 除錯器的外掛程式
+Comment[zh_TW]=一個 Quanta 除錯器的外掛程式