forked from eranif/codelite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NodeJSDebuggerPane.h
87 lines (80 loc) · 3.22 KB
/
NodeJSDebuggerPane.h
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
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// Copyright : (C) 2015 Eran Ifrah
// File name : NodeJSDebuggerPane.h
//
// -------------------------------------------------------------------------
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// 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 NODEJSDEBUGGERPANE_H
#define NODEJSDEBUGGERPANE_H
#include "WebToolsBase.h"
#include "NodeJSEvents.h"
#include <map>
#include "json_node.h"
#include "NodeJSOuptutParser.h"
class NodeJSDebuggerPane : public NodeJSDebuggerPaneBase
{
struct FrameData {
int index;
int line;
wxString file;
wxString function;
FrameData()
: index(wxNOT_FOUND)
, line(wxNOT_FOUND)
{
}
};
public:
std::map<int, NodeJSHandle> m_handles;
std::vector<PendingLookupDV> m_pendingLookupRefs;
protected:
virtual void OnLocalExpanding(wxDataViewEvent& event);
virtual void OnEvaluateExpression(wxCommandEvent& event);
virtual void OnBreakpointSelected(wxDataViewEvent& event);
void ClearCallstack();
void BuildLocals(const JSONElement& json);
void BuildArguments(const JSONElement& json);
wxDataViewItem AddLocal(const wxDataViewItem& parent, const wxString& name, int refId);
void ParseRefsArray(const JSONElement& refs);
NodeJSHandle ParseRef(const JSONElement& ref);
void DoOpenFile(const wxString& filename, int line);
void DoDeleteLocalItemAfter(const wxDataViewItem& item);
void DoAddKnownRefs(const std::vector<std::pair<int, wxString> >& refs, const wxDataViewItem& parent);
void DoAddUnKnownRefs(const std::vector<std::pair<int, wxString> >& refs, const wxDataViewItem& parent);
void Clear();
protected:
void OnItemActivated(wxDataViewEvent& event);
void OnUpdateCallstack(clDebugEvent& event);
void OnExpressionEvaluated(clDebugEvent& event);
void OnLostControl(clDebugEvent& event);
void OnLookup(clDebugEvent& event);
void OnConsoleLog(clDebugEvent& event);
void OnSessionStarted(clDebugEvent& event);
void OnSessionStopped(clDebugEvent& event);
void OnExceptionThrown(clDebugEvent& event);
void OnUpdateDebuggerView(clDebugEvent& event);
void OnFrameSelected(clDebugEvent& event);
void OnSettingsChanged(wxCommandEvent& event);
public:
NodeJSDebuggerPane(wxWindow* parent);
virtual ~NodeJSDebuggerPane();
};
#endif // NODEJSDEBUGGERPANE_H