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
5ba9cbc5
Commit
5ba9cbc5
authored
Dec 11, 2008
by
hjk
Browse files
nicer type display for std::map (not including an actual dumper yet)
parent
e76d7a5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/watchhandler.cpp
View file @
5ba9cbc5
...
...
@@ -411,7 +411,7 @@ static QString niceType(QString type)
"std::allocator<wchar_t> >"
,
"std::wstring"
);
// std::vector
static
QRegExp
re1
(
"std::vector<(.*)
\\
s*
,std::allocator<(.*)>
\\
s*>"
);
static
QRegExp
re1
(
"std::vector<(.*),
std::allocator<(.*)>
\\
s*>"
);
re1
.
setMinimal
(
true
);
for
(
int
i
=
0
;
i
!=
10
;
++
i
)
{
if
(
re1
.
indexIn
(
type
)
==
-
1
||
re1
.
cap
(
1
)
!=
re1
.
cap
(
2
))
...
...
@@ -420,7 +420,7 @@ static QString niceType(QString type)
}
// std::list
static
QRegExp
re2
(
"std::list<(.*)
\\
s*
,std::allocator<(.*)>
\\
s*>"
);
static
QRegExp
re2
(
"std::list<(.*),
std::allocator<(.*)>
\\
s*>"
);
re2
.
setMinimal
(
true
);
for
(
int
i
=
0
;
i
!=
10
;
++
i
)
{
if
(
re2
.
indexIn
(
type
)
==
-
1
||
re2
.
cap
(
1
)
!=
re2
.
cap
(
2
))
...
...
@@ -428,6 +428,17 @@ static QString niceType(QString type)
type
.
replace
(
re2
.
cap
(
0
),
"std::list<"
+
re2
.
cap
(
1
)
+
">"
);
}
// std::map
static
QRegExp
re3
(
"std::map<(.*), (.*), std::less<(.*)
\\
s*>, "
"std::allocator<std::pair<const (.*), (.*)
\\
s*> > >"
);
re3
.
setMinimal
(
true
);
for
(
int
i
=
0
;
i
!=
10
;
++
i
)
{
if
(
re3
.
indexIn
(
type
)
==
-
1
||
re3
.
cap
(
1
)
!=
re3
.
cap
(
3
)
||
re3
.
cap
(
1
)
!=
re3
.
cap
(
4
)
||
re3
.
cap
(
2
)
!=
re3
.
cap
(
5
))
break
;
type
.
replace
(
re3
.
cap
(
0
),
"std::map<"
+
re3
.
cap
(
1
)
+
", "
+
re3
.
cap
(
2
)
+
">"
);
}
type
.
replace
(
" >"
,
">"
);
}
return
type
;
...
...
tests/manual/gdbdebugger/simple/app.cpp
View file @
5ba9cbc5
...
...
@@ -53,6 +53,7 @@
#include <QtNetwork/QHostAddress>
#include <iostream>
#include <map>
#include <list>
#include <stack>
#include <string>
...
...
@@ -131,7 +132,6 @@ void testArray()
}
}
void
testQByteArray
()
{
QByteArray
ba
=
"Hello"
;
...
...
@@ -142,7 +142,6 @@ void testQByteArray()
ba
+=
2
;
}
void
testQHash
()
{
QHash
<
int
,
float
>
hgg0
;
...
...
@@ -412,6 +411,41 @@ void testStdList()
vec
.
push_back
(
false
);
}
void
testStdMap
()
{
std
::
map
<
uint
,
QStringList
>
ggl
;
ggl
[
11
]
=
QStringList
()
<<
"11"
;
ggl
[
22
]
=
QStringList
()
<<
"22"
;
typedef
std
::
map
<
uint
,
QStringList
>
T
;
T
ggt
;
ggt
[
11
]
=
QStringList
()
<<
"11"
;
ggt
[
22
]
=
QStringList
()
<<
"22"
;
#if 0
std::map<uint, float> gg0;
gg0[11] = 11.0;
gg0[22] = 22.0;
std::map<QString, float> gg1;
gg1["22.0"] = 22.0;
std::map<int, QString> gg2;
gg2[22] = "22.0";
std::map<QString, Foo> gg3;
gg3["22.0"] = Foo(22);
gg3["33.0"] = Foo(33);
QObject ob;
std::map<QString, QPointer<QObject> > map;
map.insert("Hallo", QPointer<QObject>(&ob));
map.insert("Welt", QPointer<QObject>(&ob));
map.insert(".", QPointer<QObject>(&ob));
#endif
}
void
testStdStack
()
{
std
::
stack
<
int
*>
plist1
;
...
...
@@ -795,6 +829,7 @@ int main(int argc, char *argv[])
testArray
();
testStdList
();
testStdMap
();
testStdStack
();
testStdString
();
testStdVector
();
...
...
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