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
Marco Bubke
flatpak-qt-creator
Commits
8510d887
Commit
8510d887
authored
Jan 15, 2010
by
hjk
Browse files
debugger: dumper for TBuf<N>
parent
b4e99074
Changes
2
Hide whitespace changes
Inline
Side-by-side
share/qtcreator/gdbmacros/dumper.py
View file @
8510d887
...
...
@@ -36,6 +36,15 @@ def cleanAddress(addr):
# that might trigger Unicode encoding errors.
return
addr
.
cast
(
gdb
.
lookup_type
(
"void"
).
pointer
())
# Workaround for gdb < 7.1
def
numericTemplateArgument
(
type
,
position
):
try
:
return
int
(
type
.
template_argument
(
position
))
except
RuntimeError
as
error
:
# ": No type named 30."
msg
=
str
(
error
)
return
int
(
msg
[
14
:
-
1
])
def
parseAndEvaluate
(
exp
):
if
isGoodGdb
():
return
gdb
.
parse_and_eval
(
exp
)
...
...
share/qtcreator/gdbmacros/gdbmacros.py
View file @
8510d887
...
...
@@ -1878,3 +1878,24 @@ def qdump__std__basic_string(d, item):
def
qdump__wstring
(
d
,
item
):
qdump__std__string
(
d
,
item
)
#######################################################################
#
# Symbian
#
#######################################################################
def
qdump__TBuf
(
d
,
item
):
size
=
item
.
value
[
"iLength"
]
&
0xffff
max
=
numericTemplateArgument
(
item
.
value
.
type
,
0
)
check
(
0
<=
size
and
size
<=
max
)
base
=
item
.
value
[
"iBuf"
]
s
=
""
for
i
in
xrange
(
size
):
val
=
int
(
base
[
i
])
s
+=
"%02x"
%
(
val
%
256
)
s
+=
"%02x"
%
(
val
/
256
)
d
.
putNumChild
(
0
)
d
.
putValue
(
s
,
"6"
)
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