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
Q
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
Tobias Hunger
qt-creator
Commits
1500914f
Commit
1500914f
authored
Sep 18, 2009
by
Oswald Buddenhagen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pointer aliasing issue
parent
6c7c3331
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
share/qtcreator/gdbmacros/gdbmacros.cpp
share/qtcreator/gdbmacros/gdbmacros.cpp
+10
-6
No files found.
share/qtcreator/gdbmacros/gdbmacros.cpp
View file @
1500914f
...
...
@@ -1064,13 +1064,16 @@ static void qDumpInnerValueOrPointer(QDumper &d,
#ifndef QT_BOOTSTRAPPED
struct
ModelIndex
{
int
r
;
int
c
;
void
*
p
;
void
*
m
;
};
static
inline
void
qDeserializeQModelIndex
(
const
char
*
input
,
ModelIndex
&
mm
)
{
sscanf
(
input
,
"%d,%d,%p,%p"
,
&
mm
.
r
,
&
mm
.
c
,
&
mm
.
p
,
&
mm
.
m
);
}
static
void
qDumpQAbstractItem
(
QDumper
&
d
)
{
ModelIndex
mm
;
mm
.
r
=
mm
.
c
=
0
;
mm
.
p
=
mm
.
m
=
0
;
sscanf
(
d
.
templateParameters
[
0
],
"%d,%d,%p,%p"
,
&
mm
.
r
,
&
mm
.
c
,
&
mm
.
p
,
&
mm
.
m
);
const
QModelIndex
&
mi
(
*
reinterpret_cast
<
QModelIndex
*>
(
&
mm
));
QModelIndex
mi
;
qDeserializeQModelIndex
(
d
.
templateParameters
[
0
],
*
reinterpret_cast
<
ModelIndex
*>
(
&
mi
));
const
QAbstractItemModel
*
m
=
mi
.
model
();
const
int
rowCount
=
m
->
rowCount
(
mi
);
if
(
rowCount
<
0
)
...
...
@@ -1080,7 +1083,8 @@ static void qDumpQAbstractItem(QDumper &d)
return
;
d
.
putItem
(
"type"
,
NS
"QAbstractItem"
);
d
.
beginItem
(
"addr"
);
d
.
put
(
'$'
).
put
(
mm
.
r
).
put
(
','
).
put
(
mm
.
c
).
put
(
','
).
put
(
mm
.
p
).
put
(
','
).
put
(
mm
.
m
);
d
.
put
(
'$'
).
put
(
mi
.
row
()).
put
(
','
).
put
(
mi
.
column
()).
put
(
','
)
.
put
(
mi
.
internalPointer
()).
put
(
','
).
put
(
mi
.
model
());
d
.
endItem
();
//d.putItem("value", "(").put(rowCount).put(",").put(columnCount).put(")");
d
.
putItem
(
"value"
,
m
->
data
(
mi
,
Qt
::
DisplayRole
).
toString
());
...
...
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