Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
bbba0f58
Commit
bbba0f58
authored
Dec 20, 2010
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugger: cache results of finding out the current Qt namespace
parent
39b16d86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
share/qtcreator/gdbmacros/dumper.py
share/qtcreator/gdbmacros/dumper.py
+16
-10
No files found.
share/qtcreator/gdbmacros/dumper.py
View file @
bbba0f58
...
...
@@ -788,8 +788,13 @@ def makeExpression(value):
#warn(" EXP: %s" % exp)
return
exp
qqNs
=
None
def
qtNamespace
():
if
not
qqNs
is
None
:
return
qqNs
try
:
global
qqNs
str
=
catchCliOutput
(
"ptype QString::Null"
)[
0
]
# The result looks like:
# "type = const struct myns::QString::Null {"
...
...
@@ -797,7 +802,8 @@ def qtNamespace():
# "}"
pos1
=
str
.
find
(
"struct"
)
+
7
pos2
=
str
.
find
(
"QString::Null"
)
return
str
[
pos1
:
pos2
]
qqNs
=
str
[
pos1
:
pos2
]
return
qqNs
except
:
return
""
...
...
@@ -977,7 +983,6 @@ qqDumpers = {}
# This is a cache of the namespace of the currently used Qt version.
# FIXME: This is not available on 'bbsetup' time, only at 'bb' time.
qqNs
=
""
# This is a cache of typenames->bool saying whether we are QObject
# derived.
...
...
@@ -1011,10 +1016,11 @@ def bbsetup():
pass
qqFormats
[
name
]
=
formats
result
=
"dumpers=["
qqNs
=
qtNamespace
()
#
qqNs = qtNamespace()
# This is too early
for
key
,
value
in
qqFormats
.
items
():
result
+=
'{type="%s",formats="%s"},'
%
(
key
,
value
)
result
+=
'],namespace="%s"'
%
qqNs
result
+=
']'
#result += ',namespace="%s"' % qqNs
result
+=
',hasInferiorThreadList="%s"'
%
int
(
hasInferiorThreadList
())
return
result
...
...
@@ -1120,8 +1126,8 @@ class Dumper:
options
=
[]
varList
=
[]
watchers
=
""
resultVarName
=
""
resultVarName
=
""
for
arg
in
args
.
split
(
' '
):
pos
=
arg
.
find
(
":"
)
+
1
if
arg
.
startswith
(
"options:"
):
...
...
@@ -1151,12 +1157,12 @@ class Dumper:
self
.
passExceptions
=
"pe"
in
options
self
.
autoDerefPointers
=
"autoderef"
in
options
self
.
partialUpdate
=
"partial"
in
options
#self.ns = qqNs
self
.
ns
=
qtNamespace
()
try
:
self
.
alienSource
=
catchCliOutput
(
"info source"
)[
0
][
-
3
:
-
1
]
==
".d"
except
:
self
.
alienSource
=
False
self
.
alienSource
=
False
#try:
# self.alienSource = catchCliOutput("info source")[0][-3:-1]==".d"
#except:
# self.alienSource = False
#warn("NAMESPACE: '%s'" % self.ns)
#warn("VARIABLES: %s" % varList)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment