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
5adefac6
Commit
5adefac6
authored
Jun 29, 2010
by
hjk
Browse files
debuggger: fix dumping of array of string types
parent
dc7894d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
share/qtcreator/gdbmacros/dumper.py
View file @
5adefac6
...
...
@@ -210,7 +210,7 @@ class SubItem:
if
len
(
type
)
>
0
and
type
!=
self
.
d
.
currentChildType
:
self
.
d
.
put
(
'type="%s",'
%
type
)
# str(type.unqualified()) ?
if
not
self
.
d
.
currentValueEncoding
is
None
:
self
.
d
.
put
(
'valueencoded="%d",'
,
self
.
d
.
currentValueEncoding
)
self
.
d
.
put
(
'valueencoded="%d",'
%
self
.
d
.
currentValueEncoding
)
if
not
self
.
d
.
currentValue
is
None
:
self
.
d
.
put
(
'value="%s",'
%
self
.
d
.
currentValue
)
except
:
...
...
@@ -1106,7 +1106,7 @@ class Dumper:
def
childRange
(
self
):
return
xrange
(
qmin
(
self
.
currentMaxNumChilds
,
self
.
currentNumChilds
))
#
c
onvenience
#
C
onvenience
function.
def
putItemCount
(
self
,
count
):
# This needs to override the default value, so don't use 'put' directly.
self
.
putValue
(
'<%s items>'
%
count
)
...
...
@@ -1129,7 +1129,7 @@ class Dumper:
self
.
put
(
'numchild="%s",'
%
numchild
)
def
putValue
(
self
,
value
,
encoding
=
None
,
priority
=
0
):
#
h
igher priority values override lower ones
#
H
igher priority values override lower ones
.
if
priority
>=
self
.
currentValuePriority
:
self
.
currentValue
=
value
self
.
currentValuePriority
=
priority
...
...
@@ -1155,7 +1155,7 @@ class Dumper:
def
putByteArrayValue
(
self
,
value
):
str
=
encodeByteArray
(
value
)
self
.
put
(
'v
alue
encoded="%d",value="%s",'
%
(
Hex2EncodedLatin1
,
str
)
)
self
.
put
V
alue
(
str
,
Hex2EncodedLatin1
)
def
putName
(
self
,
name
):
self
.
put
(
'name="%s",'
%
name
)
...
...
@@ -1341,7 +1341,7 @@ class Dumper:
isHandled
=
True
target
=
stripTypedefs
(
type
.
target
())
if
(
not
isHandled
)
and
target
.
code
==
TYPE_CODE_VOID
:
if
(
not
isHandled
)
and
target
.
code
==
gdb
.
TYPE_CODE_VOID
:
self
.
putType
(
item
.
value
.
type
)
self
.
putValue
(
str
(
value
))
self
.
putNumChild
(
0
)
...
...
@@ -1463,7 +1463,7 @@ class Dumper:
item
.
iname
,
"@%d"
%
baseNumber
,
field
.
name
)
baseNumber
+=
1
with
SubItem
(
self
):
self
.
put
(
'iname="%s",'
,
child
.
iname
)
self
.
put
(
'iname="%s",'
%
child
.
iname
)
self
.
putItemHelper
(
child
)
elif
len
(
field
.
name
)
==
0
:
# Anonymous union. We need a dummy name to distinguish
...
...
tests/manual/gdbdebugger/simple/app.cpp
View file @
5adefac6
...
...
@@ -227,11 +227,13 @@ void testArray()
d
[
i
][
j
]
=
i
+
j
;
#endif
#if 1
char
c
[
20
];
c
[
0
]
=
'a'
;
c
[
1
]
=
'b'
;
c
[
2
]
=
'c'
;
c
[
3
]
=
'd'
;
#endif
#if 1
QString
s
[
20
];
...
...
@@ -239,7 +241,17 @@ void testArray()
s
[
1
]
=
"b"
;
s
[
2
]
=
"c"
;
s
[
3
]
=
"d"
;
#endif
#if 1
QByteArray
b
[
20
];
b
[
0
]
=
"a"
;
b
[
1
]
=
"b"
;
b
[
2
]
=
"c"
;
b
[
3
]
=
"d"
;
#endif
#if 1
Foo
foo
[
10
];
//for (int i = 0; i != sizeof(foo)/sizeof(foo[0]); ++i) {
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
...
...
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