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
0ac615a1
Commit
0ac615a1
authored
Jan 28, 2009
by
hjk
Browse files
Fixes: debugger: fix dumping of QString used as hash key
parent
2932203a
Changes
2
Hide whitespace changes
Inline
Side-by-side
share/qtcreator/gdbmacros/gdbmacros.cpp
View file @
0ac615a1
...
...
@@ -311,7 +311,7 @@ static bool isSimpleType(const char *type)
static
bool
isShortKey
(
const
char
*
type
)
{
return
isSimpleType
(
type
)
||
isEqual
(
type
,
"QString"
);
return
isSimpleType
(
type
)
||
isEqual
(
type
,
NS
"QString"
);
}
static
bool
isMovableType
(
const
char
*
type
)
...
...
@@ -704,44 +704,44 @@ static void qDumpUnknown(QDumper &d)
}
static
void
qDumpInnerValueHelper
(
QDumper
&
d
,
const
char
*
type
,
const
void
*
addr
,
const
char
*
key
=
"value"
)
const
char
*
field
=
"value"
)
{
type
=
stripNamespace
(
type
);
switch
(
type
[
1
])
{
case
'l'
:
if
(
isEqual
(
type
,
"float"
))
P
(
d
,
key
,
*
(
float
*
)
addr
);
P
(
d
,
field
,
*
(
float
*
)
addr
);
return
;
case
'n'
:
if
(
isEqual
(
type
,
"int"
))
P
(
d
,
key
,
*
(
int
*
)
addr
);
P
(
d
,
field
,
*
(
int
*
)
addr
);
else
if
(
isEqual
(
type
,
"unsigned"
))
P
(
d
,
key
,
*
(
unsigned
int
*
)
addr
);
P
(
d
,
field
,
*
(
unsigned
int
*
)
addr
);
else
if
(
isEqual
(
type
,
"unsigned int"
))
P
(
d
,
key
,
*
(
unsigned
int
*
)
addr
);
P
(
d
,
field
,
*
(
unsigned
int
*
)
addr
);
else
if
(
isEqual
(
type
,
"unsigned long"
))
P
(
d
,
key
,
*
(
unsigned
long
*
)
addr
);
P
(
d
,
field
,
*
(
unsigned
long
*
)
addr
);
else
if
(
isEqual
(
type
,
"unsigned long long"
))
P
(
d
,
key
,
*
(
qulonglong
*
)
addr
);
P
(
d
,
field
,
*
(
qulonglong
*
)
addr
);
return
;
case
'o'
:
if
(
isEqual
(
type
,
"bool"
))
switch
(
*
(
bool
*
)
addr
)
{
case
0
:
P
(
d
,
key
,
"false"
);
break
;
case
1
:
P
(
d
,
key
,
"true"
);
break
;
default:
P
(
d
,
key
,
*
(
bool
*
)
addr
);
break
;
case
0
:
P
(
d
,
field
,
"false"
);
break
;
case
1
:
P
(
d
,
field
,
"true"
);
break
;
default:
P
(
d
,
field
,
*
(
bool
*
)
addr
);
break
;
}
else
if
(
isEqual
(
type
,
"double"
))
P
(
d
,
key
,
*
(
double
*
)
addr
);
P
(
d
,
field
,
*
(
double
*
)
addr
);
else
if
(
isEqual
(
type
,
"long"
))
P
(
d
,
key
,
*
(
long
*
)
addr
);
P
(
d
,
field
,
*
(
long
*
)
addr
);
else
if
(
isEqual
(
type
,
"long long"
))
P
(
d
,
key
,
*
(
qulonglong
*
)
addr
);
P
(
d
,
field
,
*
(
qulonglong
*
)
addr
);
return
;
case
'B'
:
if
(
isEqual
(
type
,
"QByteArray"
))
{
d
<<
key
<<
"encoded=
\"
1
\"
,"
;
P
(
d
,
key
,
*
(
QByteArray
*
)
addr
);
d
<<
field
<<
"encoded=
\"
1
\"
,"
;
P
(
d
,
field
,
*
(
QByteArray
*
)
addr
);
}
return
;
case
'L'
:
...
...
@@ -769,8 +769,8 @@ static void qDumpInnerValueHelper(QDumper &d, const char *type, const void *addr
return
;
case
'S'
:
if
(
isEqual
(
type
,
"QString"
))
{
d
<<
key
<<
"encoded=
\"
1
\"
,"
;
P
(
d
,
key
,
*
(
QString
*
)
addr
);
d
<<
field
<<
"encoded=
\"
1
\"
,"
;
P
(
d
,
field
,
*
(
QString
*
)
addr
);
}
return
;
default:
...
...
src/plugins/debugger/gdbengine.cpp
View file @
0ac615a1
...
...
@@ -3555,8 +3555,11 @@ void GdbEngine::handleDumpCustomValue2(const GdbResultRecord &record,
if
(
item
.
findChild
(
"nameencoded"
).
data
()[
0
]
==
'1'
)
data1
.
name
=
QByteArray
::
fromBase64
(
data1
.
name
.
toUtf8
());
QString
key
=
item
.
findChild
(
"key"
).
data
();
if
(
!
key
.
isEmpty
())
if
(
!
key
.
isEmpty
())
{
if
(
item
.
findChild
(
"keyencoded"
).
data
()[
0
]
==
'1'
)
key
=
QByteArray
::
fromBase64
(
key
.
toUtf8
());
data1
.
name
+=
" ("
+
key
+
")"
;
}
setWatchDataType
(
data1
,
item
.
findChild
(
"type"
));
setWatchDataExpression
(
data1
,
item
.
findChild
(
"exp"
));
setWatchDataChildCount
(
data1
,
item
.
findChild
(
"numchild"
));
...
...
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