Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
afef6dd0
Commit
afef6dd0
authored
Nov 02, 2010
by
hjk
Browse files
debugger: work around gdb 7.2 quirk in QFlag dumper
Reviewed-By: Friedemann Kleint
parent
7b6022be
Changes
1
Hide whitespace changes
Inline
Side-by-side
share/qtcreator/gdbmacros/gdbmacros.py
View file @
afef6dd0
...
...
@@ -328,12 +328,34 @@ def qdump__QFixed(d, item):
d
.
putNumChild
(
0
)
# Stock gdb 7.2 seems to have a problem with types here:
#
# echo -e "namespace N { struct S { enum E { zero, one, two }; }; }\n"\
# "int main() { N::S::E x = N::S::one;\n return x; }" >> main.cpp
# g++ -g main.cpp
# gdb-7.2 -ex 'file a.out' -ex 'b main' -ex 'run' -ex 'step' \
# -ex 'ptype N::S::E' -ex 'python print gdb.lookup_type("N::S::E")' -ex 'q'
# gdb-7.1 -ex 'file a.out' -ex 'b main' -ex 'run' -ex 'step' \
# -ex 'ptype N::S::E' -ex 'python print gdb.lookup_type("N::S::E")' -ex 'q'
# gdb-cvs -ex 'file a.out' -ex 'b main' -ex 'run' -ex 'step' \
# -ex 'ptype N::S::E' -ex 'python print gdb.lookup_type("N::S::E")' -ex 'q'
#
# gives as of 2010-11-02
#
# type = enum N::S::E {N::S::zero, N::S::one, N::S::two} \n
# Traceback (most recent call last): File "<string>", line 1, in <module> RuntimeError: No type named N::S::E.
# type = enum N::S::E {N::S::zero, N::S::one, N::S::two} \n N::S::E
# type = enum N::S::E {N::S::zero, N::S::one, N::S::two} \n N::S::E
#
# i.e. there's something broken in stock 7.2 that is was ok in 7.1 and is ok later.
def
qdump__QFlags
(
d
,
item
):
#warn("QFLAGS: %s" % item.value)
i
=
item
.
value
[
"i"
]
enumType
=
item
.
value
.
type
.
template_argument
(
0
)
#warn("QFLAGS: %s" % item.value["i"].cast(enumType))
d
.
putValue
(
"%s (%s)"
%
(
i
.
cast
(
enumType
),
i
))
try
:
enumType
=
item
.
value
.
type
.
unqualified
().
template_argument
(
0
)
d
.
putValue
(
"%s (%s)"
%
(
i
.
cast
(
enumType
),
i
))
except
:
d
.
putValue
(
"%s"
%
i
)
d
.
putNumChild
(
0
)
...
...
Write
Preview
Supports
Markdown
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