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
d3290c32
Commit
d3290c32
authored
Nov 30, 2010
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugger: replace a few 'template_argument(0)' by the templateArgument wrapper
Makes QSharedPointer & Co. work with gdb 7.2
parent
f03138aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
14 deletions
+20
-14
share/qtcreator/gdbmacros/dumper.py
share/qtcreator/gdbmacros/dumper.py
+10
-0
share/qtcreator/gdbmacros/gdbmacros.py
share/qtcreator/gdbmacros/gdbmacros.py
+10
-14
No files found.
share/qtcreator/gdbmacros/dumper.py
View file @
d3290c32
...
...
@@ -162,6 +162,16 @@ def cleanAddress(addr):
# that might trigger Unicode encoding errors.
return
addr
.
cast
(
lookupType
(
"void"
).
pointer
())
def
templateArgument
(
type
,
position
,
outerLen
):
try
:
# This fails on stock 7.2 with
# "RuntimeError: No type named myns::QObject.\n"
return
type
.
template_argument
(
position
)
except
:
# That's something like "myns::QList<...>"
innerString
=
str
(
type
.
strip_typedefs
())
return
lookupType
(
innerString
[
outerLen
+
1
:
-
1
])
# Workaround for gdb < 7.1
def
numericTemplateArgument
(
type
,
position
):
try
:
...
...
share/qtcreator/gdbmacros/gdbmacros.py
View file @
d3290c32
...
...
@@ -318,7 +318,8 @@ def qdump__QFixed(d, item):
def
qdump__QFlags
(
d
,
item
):
i
=
item
.
value
[
"i"
]
try
:
enumType
=
item
.
value
.
type
.
unqualified
().
template_argument
(
0
)
enumType
=
templateArgument
(
item
.
value
.
type
.
unqualified
(),
0
,
len
(
d
.
ns
)
+
len
(
'QFlags'
))
d
.
putValue
(
"%s (%s)"
%
(
i
.
cast
(
enumType
),
i
))
except
:
d
.
putValue
(
"%s"
%
i
)
...
...
@@ -436,15 +437,7 @@ def qdump__QList(d, item):
checkRef
(
d_ptr
[
"ref"
])
# Additional checks on pointer arrays.
try
:
# This fails on stock 7.2 with
# "RuntimeError: No type named myns::QObject.\n"
innerType
=
item
.
value
.
type
.
template_argument
(
0
)
except
:
# That's something like "myns::QList<...>"
innerString
=
str
(
item
.
value
.
type
.
strip_typedefs
())
innerType
=
lookupType
(
innerString
[
len
(
d
.
ns
)
+
6
:
-
1
])
innerType
=
templateArgument
(
item
.
value
.
type
,
0
,
len
(
d
.
ns
)
+
len
(
'QList'
))
innerTypeIsPointer
=
innerType
.
code
==
gdb
.
TYPE_CODE_PTR
\
and
str
(
innerType
.
target
().
unqualified
())
!=
"char"
if
innerTypeIsPointer
:
...
...
@@ -543,7 +536,9 @@ def qdump__QLinkedList(d, item):
d
.
putItemCount
(
n
)
d
.
putNumChild
(
n
)
if
d
.
isExpanded
(
item
):
with
Children
(
d
,
[
n
,
1000
],
item
.
value
.
type
.
template_argument
(
0
)):
innerType
=
templateArgument
(
item
.
value
.
type
,
0
,
len
(
d
.
ns
)
+
len
(
'QLinkedList'
))
with
Children
(
d
,
[
n
,
1000
],
innerType
):
p
=
e_ptr
[
"n"
]
for
i
in
d
.
childRange
():
d
.
putSubItem
(
Item
(
p
[
"t"
],
item
.
iname
,
i
))
...
...
@@ -1593,7 +1588,8 @@ def qdump__QSharedDataPointer(d, item):
# This replaces the pointer by the pointee, making the
# pointer transparent.
try
:
innerType
=
item
.
value
.
type
.
template_argument
(
0
)
innerType
=
templateArgument
(
item
.
value
.
type
,
0
,
len
(
d
.
ns
)
+
len
(
'QSharedDataPointer'
))
except
:
d
.
putValue
(
d_ptr
)
d
.
putPlainChildren
(
item
)
...
...
@@ -1921,7 +1917,7 @@ def qdump__QVector(d, item):
check
(
0
<=
size
and
size
<=
alloc
and
alloc
<=
1000
*
1000
*
1000
)
checkRef
(
d_ptr
[
"ref"
])
innerType
=
item
.
value
.
type
.
template_argument
(
0
)
innerType
=
templateArgument
(
item
.
value
.
type
,
0
,
len
(
d
.
ns
)
+
len
(
'QVector'
)
)
d
.
putItemCount
(
size
)
d
.
putNumChild
(
size
)
if
d
.
isExpanded
(
item
):
...
...
@@ -1953,7 +1949,7 @@ def qdump__QWeakPointer(d, item):
check
(
int
(
strongref
)
<=
int
(
weakref
))
check
(
int
(
weakref
)
<=
10
*
1000
*
1000
)
innerType
=
item
.
value
.
type
.
template_argument
(
0
)
innerType
=
templateArgument
(
item
.
value
.
type
,
0
,
len
(
d
.
ns
)
+
len
(
'QWeakPointer'
)
)
if
isSimpleType
(
value
.
dereference
().
type
):
d
.
putItem
(
Item
(
value
.
dereference
(),
item
.
iname
,
None
))
else
:
...
...
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