File: LLDBVariable.h

package info (click to toggle)
codelite 14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 112,816 kB
  • sloc: cpp: 483,662; ansic: 150,144; php: 9,569; lex: 4,186; python: 3,417; yacc: 2,820; sh: 1,147; makefile: 52; xml: 13
file content (126 lines) | stat: -rw-r--r-- 3,821 bytes parent folder | download
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
117
118
119
120
121
122
123
124
125
126
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// copyright            : (C) 2014 Eran Ifrah
// file name            : LLDBVariable.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 LLDBLOCALVARIABLE_H
#define LLDBLOCALVARIABLE_H

#include <vector>
#include <wx/string.h>
#include <wx/clntdata.h>
#include <wx/sharedptr.h>
#include "JSON.h"
#include <wx/treebase.h>
#include "LLDBEnums.h"
#if BUILD_CODELITE_LLDB
#include <lldb/API/SBValue.h>
#endif

class LLDBVariable
{
public:
    typedef wxSharedPtr<LLDBVariable> Ptr_t;
    typedef std::vector<LLDBVariable::Ptr_t> Vect_t;

protected:
    wxString m_name;
    wxString m_value;
    wxString m_summary;
    wxString m_type;
    wxString m_expression;
    bool m_valueChanged;
    int m_lldbId;
    bool m_hasChildren;
    bool m_isWatch;

private:
#if BUILD_CODELITE_LLDB
    void DoInitFromLLDBValue(lldb::SBValue value);
#endif

public:
#if BUILD_CODELITE_LLDB
    LLDBVariable(lldb::SBValue value);
#endif

    LLDBVariable()
        : m_valueChanged(false)
        , m_lldbId(wxNOT_FOUND)
        , m_hasChildren(false)
        , m_isWatch(false)
    {
    }
    virtual ~LLDBVariable();

    void SetLldbId(int lldbId) { this->m_lldbId = lldbId; }

    int GetLldbId() const { return m_lldbId; }

    // Seriliazation API
    void FromJSON(const JSONItem& json);
    JSONItem ToJSON() const;

    void SetValueChanged(bool valueChanged) { this->m_valueChanged = valueChanged; }
    bool IsValueChanged() const { return m_valueChanged; }
    void SetSummary(const wxString& summary) { this->m_summary = summary; }
    const wxString& GetSummary() const { return m_summary; }
    void SetType(const wxString& type) { this->m_type = type; }
    const wxString& GetType() const { return m_type; }

    void SetExpression(const wxString& expression) { this->m_expression = expression; }
    const wxString &GetExpression() const { return m_expression; }

    void SetName(const wxString& name) { this->m_name = name; }

    void SetValue(const wxString& value) { this->m_value = value; }

    const wxString& GetName() const { return m_name; }

    const wxString& GetValue() const { return m_value; }

    bool HasChildren() const { return m_hasChildren; }

    void SetIsWatch(bool isWatch) { this->m_isWatch = isWatch; }
    bool IsWatch() const { return m_isWatch; }

    wxString ToString(const wxString& alternateName = wxEmptyString) const;
};

class LLDBVariableClientData : public wxTreeItemData
{
    LLDBVariable::Ptr_t m_variable;
    wxString m_path;

public:
    LLDBVariableClientData(LLDBVariable::Ptr_t variable)
        : m_variable(variable)
    {
    }
    LLDBVariable::Ptr_t GetVariable() const { return m_variable; }

    void SetPath(const wxString& path) { this->m_path = path; }
    const wxString& GetPath() const { return m_path; }
};

#endif // LLDBLOCALVARIABLE_H