Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
04c4a0ec
Commit
04c4a0ec
authored
Dec 17, 2008
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make the std::map dumper work with keys that already have a const
qualification like 'const char *'
parent
fff7acad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
bin/gdbmacros/gdbmacros.cpp
bin/gdbmacros/gdbmacros.cpp
+9
-1
src/plugins/debugger/gdbengine.cpp
src/plugins/debugger/gdbengine.cpp
+7
-2
tests/manual/gdbdebugger/simple/app.cpp
tests/manual/gdbdebugger/simple/app.cpp
+5
-0
No files found.
bin/gdbmacros/gdbmacros.cpp
View file @
04c4a0ec
...
...
@@ -2155,6 +2155,14 @@ static void qDumpStdMap(QDumper &d)
P
(
d
,
"valuedisabled"
,
"true"
);
P
(
d
,
"valueoffset"
,
d
.
extraInt
[
2
]);
// HACK: we need a properly const qualified version of the
// std::pair used. We extract it from the allocator parameter
// as it is there, and, equally importantly, in an order that
// gdb accepts when fed with it.
char
*
pairType
=
(
char
*
)(
d
.
templateParameters
[
3
])
+
16
;
pairType
[
strlen
(
pairType
)
-
2
]
=
0
;
P
(
d
,
"pairtype"
,
pairType
);
if
(
d
.
dumpChildren
)
{
bool
simpleKey
=
isSimpleType
(
keyType
);
bool
simpleValue
=
isShortKey
(
valueType
);
...
...
@@ -2177,7 +2185,7 @@ static void qDumpStdMap(QDumper &d)
d
.
beginHash
();
P
(
d
,
"name"
,
"["
<<
i
<<
"]"
);
P
(
d
,
"addr"
,
it
.
operator
->
());
P
(
d
,
"type"
,
"std::pair<const "
<<
keyType
<<
","
<<
valueType
<<
" >"
);
P
(
d
,
"type"
,
pairType
);
d
.
endHash
();
}
}
...
...
src/plugins/debugger/gdbengine.cpp
View file @
04c4a0ec
...
...
@@ -3022,8 +3022,13 @@ void GdbEngine::runCustomDumper(const WatchData & data0, bool dumpChildren)
}
else
if
(
outertype
==
"std::map"
)
{
// We don't want the comparator and the allocator confuse gdb.
// But we need the offset of the second item in the value pair.
extraArgs
[
2
]
=
"(size_t)&(('std::pair<const "
+
inners
.
at
(
0
)
+
","
+
inners
.
at
(
1
)
+
">'*)0)->second"
;
// We read the type of the pair from the allocator argument because
// that gets the constness "right" (in the sense that gdb can
// read it back;
QString
pairType
=
inners
.
at
(
3
);
// remove 'std::allocator<...>':
pairType
=
pairType
.
mid
(
15
,
pairType
.
size
()
-
15
-
2
);
extraArgs
[
2
]
=
"(size_t)&(('"
+
pairType
+
"'*)0)->second"
;
extraArgs
[
3
]
=
"0"
;
}
else
if
(
outertype
==
"std::basic_string"
)
{
//qDebug() << "EXTRACT TEMPLATE: " << outertype << inners;
...
...
tests/manual/gdbdebugger/simple/app.cpp
View file @
04c4a0ec
...
...
@@ -416,6 +416,11 @@ void testStdMap()
gg3
[
"33.0"
]
=
Foo
(
33
);
gg3
[
"44.0"
]
=
Foo
(
44
);
std
::
map
<
const
char
*
,
Foo
>
m1
;
m1
[
"22.0"
]
=
Foo
(
22
);
m1
[
"33.0"
]
=
Foo
(
33
);
m1
[
"44.0"
]
=
Foo
(
44
);
#if 1
std
::
map
<
uint
,
uint
>
gg
;
gg
[
11
]
=
1
;
...
...
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