Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
aa16f34e
Commit
aa16f34e
authored
Aug 17, 2010
by
hjk
Browse files
debugger: next attempt at robustly recognizing QObjects
(cherry picked from commit
e8eea80c
)
parent
7aa677c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
share/qtcreator/gdbmacros/dumper.py
View file @
aa16f34e
...
...
@@ -843,7 +843,6 @@ class Item:
# This is a mapping from 'type name' to 'display alternatives'.
qqDumpers
=
{}
qqFormats
=
{}
...
...
@@ -858,7 +857,6 @@ class SetupCommand(gdb.Command):
for
key
,
value
in
module
.
__dict__
.
items
():
if
key
.
startswith
(
"qdump__"
):
name
=
key
[
7
:]
qqDumpers
[
name
]
=
value
qqFormats
[
name
]
=
qqFormats
.
get
(
name
,
""
);
elif
key
.
startswith
(
"qform__"
):
name
=
key
[
7
:]
...
...
@@ -1330,27 +1328,41 @@ class Dumper:
value
=
item
.
value
type
=
value
.
type
typedefStrippedType
=
stripTypedefs
(
type
);
nsStrippedType
=
self
.
stripNamespaceFromType
(
typedefStrippedType
).
replace
(
"::"
,
"__"
)
typedefStrippedType
=
stripTypedefs
(
type
)
if
isSimpleType
(
typedefStrippedType
):
#warn("IS SIMPLE: %s " % type)
self
.
putType
(
item
.
value
.
type
)
self
.
putValue
(
value
)
self
.
putNumChild
(
0
)
return
# Is this derived from QObject?
hasMetaObject
=
False
for
field
in
typedefStrippedType
.
strip_typedefs
().
fields
():
if
field
.
name
==
"staticMetaObject"
:
hasMetaObject
=
True
break
nsStrippedType
=
self
.
stripNamespaceFromType
(
typedefStrippedType
)
\
.
replace
(
"::"
,
"__"
)
#warn(" STRIPPED: %s" % nsStrippedType)
#warn(" DUMPERS: %s" % self.dumpers)
#warn(" DUMPERS: %s" % (nsStrippedType in self.dumpers))
if
isSimpleType
(
typedefStrippedType
):
#warn("IS SIMPLE: %s " % type)
self
.
putType
(
item
.
value
.
type
)
self
.
putValue
(
value
)
self
.
putNumChild
(
0
)
format
=
self
.
itemFormat
(
item
)
elif
nsStrippedType
in
self
.
dumpers
:
if
self
.
useFancy
\
and
((
format
is
None
)
or
(
format
>=
1
))
\
and
((
nsStrippedType
in
self
.
dumpers
)
or
hasMetaObject
):
#warn("IS DUMPABLE: %s " % type)
self
.
putType
(
item
.
value
.
type
)
self
.
dumpers
[
nsStrippedType
](
self
,
item
)
if
hasMetaObject
:
# value has references stripped off item.value.
item1
=
Item
(
value
,
item
.
iname
)
qdump__QObject
(
self
,
item1
)
else
:
self
.
dumpers
[
nsStrippedType
](
self
,
item
)
#warn(" RESULT: %s " % self.output)
elif
typedefStrippedType
.
code
==
gdb
.
TYPE_CODE_ENUM
:
...
...
@@ -1363,8 +1375,6 @@ class Dumper:
elif
typedefStrippedType
.
code
==
gdb
.
TYPE_CODE_PTR
:
isHandled
=
False
format
=
self
.
itemFormat
(
item
)
if
not
format
is
None
:
self
.
putAddress
(
value
.
address
)
self
.
putType
(
item
.
value
.
type
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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