~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to share/qtcreator/debugger/creatortypes.py

  • Committer: Timo Jyrinki
  • Date: 2013-11-15 12:25:23 UTC
  • mfrom: (1.1.28)
  • Revision ID: timo.jyrinki@canonical.com-20131115122523-i2kyamsu4gs2mu1m
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
############################################################################
 
2
#
 
3
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 
4
# Contact: http://www.qt-project.org/legal
 
5
#
 
6
# This file is part of Qt Creator.
 
7
#
 
8
# Commercial License Usage
 
9
# Licensees holding valid commercial Qt licenses may use this file in
 
10
# accordance with the commercial license agreement provided with the
 
11
# Software or, alternatively, in accordance with the terms contained in
 
12
# a written agreement between you and Digia.  For licensing terms and
 
13
# conditions see http://qt.digia.com/licensing.  For further information
 
14
# use the contact form at http://qt.digia.com/contact-us.
 
15
#
 
16
# GNU Lesser General Public License Usage
 
17
# Alternatively, this file may be used under the terms of the GNU Lesser
 
18
# General Public License version 2.1 as published by the Free Software
 
19
# Foundation and appearing in the file LICENSE.LGPL included in the
 
20
# packaging of this file.  Please review the following information to
 
21
# ensure the GNU Lesser General Public License version 2.1 requirements
 
22
# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 
23
#
 
24
# In addition, as a special exception, Digia gives you certain additional
 
25
# rights.  These rights are described in the Digia Qt LGPL Exception
 
26
# version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
 
27
#
 
28
#############################################################################
 
29
 
 
30
from dumper import *
 
31
 
 
32
def qdump__Core__Id(d, value):
 
33
    try:
 
34
        name = d.parseAndEvaluate("Core::nameForId(%d)" % value["m_id"])
 
35
        d.putValue(d.encodeCharArray(name), Hex2EncodedLatin1)
 
36
        d.putPlainChildren(value)
 
37
    except:
 
38
        d.putValue(value["m_id"])
 
39
        d.putNumChild(0)
 
40
 
 
41
def qdump__Debugger__Internal__GdbMi(d, value):
 
42
    str = d.encodeByteArray(value["m_name"]) + "3a20" \
 
43
        + d.encodeByteArray(value["m_data"])
 
44
    d.putValue(str, Hex2EncodedLatin1)
 
45
    d.putPlainChildren(value)
 
46
 
 
47
def qdump__Debugger__Internal__WatchData(d, value):
 
48
    d.putByteArrayValue(value["iname"])
 
49
    d.putPlainChildren(value)
 
50
 
 
51
def qdump__Debugger__Internal__WatchItem(d, value):
 
52
    d.putByteArrayValue(value["iname"])
 
53
    d.putPlainChildren(value)
 
54
 
 
55
def qdump__Debugger__Internal__BreakpointModelId(d, value):
 
56
    d.putValue("%s.%s" % (value["m_majorPart"], value["m_minorPart"]))
 
57
    d.putPlainChildren(value)
 
58
 
 
59
def qdump__CPlusPlus__ByteArrayRef(d, value):
 
60
    d.putValue(d.encodeCharArray(value["m_start"], 100, value["m_length"]),
 
61
        Hex2EncodedLatin1)
 
62
    d.putPlainChildren(value)
 
63
 
 
64
def qdump__CPlusPlus__Identifier(d, value):
 
65
    d.putValue(d.encodeCharArray(value["_chars"]), Hex2EncodedLatin1)
 
66
    d.putPlainChildren(value)
 
67
 
 
68
def qdump__CPlusPlus__IntegerType(d, value):
 
69
    d.putValue(value["_kind"])
 
70
    d.putPlainChildren(value)
 
71
 
 
72
def qdump__CPlusPlus__NamedType(d, value):
 
73
    literal = downcast(value["_name"])
 
74
    d.putValue(d.encodeCharArray(literal["_chars"]), Hex2EncodedLatin1)
 
75
    d.putPlainChildren(value)
 
76
 
 
77
def qdump__CPlusPlus__TemplateNameId(d, value):
 
78
    s = d.encodeCharArray(value["_identifier"]["_chars"])
 
79
    d.putValue(s + "3c2e2e2e3e", Hex2EncodedLatin1)
 
80
    d.putPlainChildren(value)
 
81
 
 
82
def qdump__CPlusPlus__Literal(d, value):
 
83
    d.putValue(d.encodeCharArray(value["_chars"]), Hex2EncodedLatin1)
 
84
    d.putPlainChildren(value)
 
85
 
 
86
def qdump__CPlusPlus__StringLiteral(d, value):
 
87
    d.putValue(d.encodeCharArray(value["_chars"]), Hex2EncodedLatin1)
 
88
    d.putPlainChildren(value)
 
89
 
 
90
def qdump__CPlusPlus__Internal__Value(d, value):
 
91
    d.putValue(value["l"])
 
92
    d.putPlainChildren(value)
 
93
 
 
94
def qdump__Utils__FileName(d, value):
 
95
    d.putStringValue(value)
 
96
    d.putPlainChildren(value)
 
97
 
 
98
def qdump__Utils__ElfSection(d, value):
 
99
    d.putByteArrayValue(value["name"])
 
100
    d.putPlainChildren(value)
 
101
 
 
102
def qdump__CPlusPlus__Token(d, value):
 
103
    k = int(value["f"]["kind"])
 
104
    if int(k) == 6:
 
105
        d.putValue("T_IDENTIFIER. offset: %d, len: %d"
 
106
            % (value["offset"], value["f"]["length"]))
 
107
    elif int(k) == 7:
 
108
        d.putValue("T_NUMERIC_LITERAL. offset: %d, value: %d"
 
109
            % (value["offset"], value["f"]["length"]))
 
110
    elif int(k) == 60:
 
111
        d.putValue("T_RPAREN")
 
112
    else:
 
113
        d.putValue("Type: %s" % k)
 
114
    d.putPlainChildren(value)
 
115
 
 
116
def qdump__CPlusPlus__Internal__PPToken(d, value):
 
117
    k = value["f"]["kind"];
 
118
    data, size, alloc = d.byteArrayData(value["m_src"])
 
119
    length = int(value["f"]["length"])
 
120
    offset = int(value["offset"])
 
121
    #warn("size: %s, alloc: %s, offset: %s, length: %s, data: %s"
 
122
    #    % (size, alloc, offset, length, data))
 
123
    d.putValue(d.readMemory(data + offset, min(100, length)),
 
124
        Hex2EncodedLatin1)
 
125
    d.putPlainChildren(value)
 
126
 
 
127