summaryrefslogtreecommitdiffstats
path: root/quanta/components/debugger/interfaces/debuggerclient.h
blob: 69ba565022b8d4dc2b77534c92286d1c89af8b25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/***************************************************************************
                          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 <tqserversocket.h>
#include <tqobject.h>
#include <kurl.h>
#include <tqdom.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 TQObject
{
  Q_OBJECT
  TQ_OBJECT

  private:
  protected:
    DebuggerClient(TQObject *parent, const char* name);

    bool m_active;

  public:
    virtual const uint supports(DebuggerClientCapabilities::Capabilities) = 0;
    virtual void startSession() = 0;
    virtual void endSession() = 0;
    virtual TQString 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(TQDomNode node);
    virtual void showConfig(TQDomNode node);

    // Profiler
    virtual void profilerOpen();

    // Misc
    virtual void fileOpened(const TQString& file);
    virtual void addBreakpoint(DebuggerBreakpoint* breakpoint);
    virtual void removeBreakpoint(DebuggerBreakpoint* breakpoint);
    virtual void addWatch(const TQString &);
    virtual void removeWatch(DebuggerVariable*);
    virtual void variableSetValue(const DebuggerVariable &variable);

    void unSupportedAction(const TQString &action);

    bool isActive();
    DebuggerInterface *debuggerInterface();

  signals:
    void updateStatus(DebuggerUI::DebuggerStatus);

};

#endif