Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
771f30a6
Commit
771f30a6
authored
16 years ago
by
dt
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
Task-number: 243747
parents
617ddf03
0e73d5fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
share/qtcreator/gdbmacros/test/main.cpp
+64
-16
64 additions, 16 deletions
share/qtcreator/gdbmacros/test/main.cpp
with
64 additions
and
16 deletions
share/qtcreator/gdbmacros/test/main.cpp
+
64
−
16
View file @
771f30a6
...
@@ -28,13 +28,18 @@
...
@@ -28,13 +28,18 @@
**************************************************************************/
**************************************************************************/
#include
<QtCore/QStringList>
#include
<QtCore/QStringList>
#include
<QtCore/QVector>
#include
<QtCore/QTimer>
#include
<QtCore/private/qobject_p.h>
#include
<string>
#include
<string>
#include
<list>
#include
<list>
#include
<vector>
#include
<stdio.h>
#include
<stdio.h>
#include
<string.h>
#include
<string.h>
/* Test program for Dumper development/porting.
/* Test program for Dumper development/porting.
* Takes the type as first argument. */
* Takes the type as first argument. */
...
@@ -106,6 +111,16 @@ static int dumpQIntList()
...
@@ -106,6 +111,16 @@ static int dumpQIntList()
return
0
;
return
0
;
}
}
static
int
dumpQIntVector
()
{
QVector
<
int
>
test
=
QVector
<
int
>
()
<<
1
<<
2
;
prepareInBuffer
(
"QVector"
,
"local.qintvector"
,
"local.qintvector"
,
"int"
);
qDumpObjectData440
(
2
,
42
,
&
test
,
1
,
sizeof
(
int
),
0
,
0
,
0
);
fputs
(
qDumpOutBuffer
,
stdout
);
fputc
(
'\n'
,
stdout
);
return
0
;
}
// --------------- std types
// --------------- std types
static
int
dumpStdString
()
static
int
dumpStdString
()
...
@@ -142,28 +157,61 @@ static int dumpStdIntList()
...
@@ -142,28 +157,61 @@ static int dumpStdIntList()
return
0
;
return
0
;
}
}
static
int
dumpStdIntVector
()
{
std
::
vector
<
int
>
test
;
test
.
push_back
(
1
);
test
.
push_back
(
2
);
prepareInBuffer
(
"std::vector"
,
"local.intvector"
,
"local.intvector"
,
"int"
);
qDumpObjectData440
(
2
,
42
,
&
test
,
1
,
sizeof
(
int
),
sizeof
(
std
::
list
<
int
>::
allocator_type
),
0
,
0
);
fputs
(
qDumpOutBuffer
,
stdout
);
fputc
(
'\n'
,
stdout
);
return
0
;
}
static
int
dumpQObject
()
{
QTimer
t
;
QObjectPrivate
*
tp
=
reinterpret_cast
<
QObjectPrivate
*>
(
&
t
);
const
int
childOffset
=
(
char
*
)
&
tp
->
children
-
(
char
*
)
tp
;
printf
(
"Qt version %s Child offset: %d
\n
"
,
QT_VERSION_STR
,
childOffset
);
prepareInBuffer
(
"QObject"
,
"local.qobject"
,
"local.qobject"
,
""
);
qDumpObjectData440
(
2
,
42
,
&
t
,
1
,
childOffset
,
0
,
0
,
0
);
fputs
(
qDumpOutBuffer
,
stdout
);
fputc
(
'\n'
,
stdout
);
return
0
;
}
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
printf
(
"Running query protocol
\n
"
);
printf
(
"Running query protocol
\n
"
);
qDumpObjectData440
(
1
,
42
,
0
,
1
,
0
,
0
,
0
,
0
);
qDumpObjectData440
(
1
,
42
,
0
,
1
,
0
,
0
,
0
,
0
);
fputs
(
qDumpOutBuffer
,
stdout
);
fputs
(
qDumpOutBuffer
,
stdout
);
fputc
(
'\n'
,
stdout
);
fputc
(
'\n'
,
stdout
);
fputc
(
'\n'
,
stdout
);
fputc
(
'\n'
,
stdout
);
if
(
argc
<
2
)
if
(
argc
<
2
)
return
0
;
return
0
;
const
char
*
arg
=
argv
[
1
];
for
(
int
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
!
qstrcmp
(
arg
,
"QString"
))
const
char
*
arg
=
argv
[
i
];
return
dumpQString
();
printf
(
"
\n
Testing %s
\n
"
,
arg
);
if
(
!
qstrcmp
(
arg
,
"QStringList"
))
if
(
!
qstrcmp
(
arg
,
"QString"
))
return
dumpQStringList
();
dumpQString
();
if
(
!
qstrcmp
(
arg
,
"QList<int>"
))
if
(
!
qstrcmp
(
arg
,
"QStringList"
))
return
dumpQIntList
();
dumpQStringList
();
if
(
!
qstrcmp
(
arg
,
"string"
))
if
(
!
qstrcmp
(
arg
,
"QList<int>"
))
return
dumpStdString
();
dumpQIntList
();
if
(
!
qstrcmp
(
arg
,
"list<int>"
))
if
(
!
qstrcmp
(
arg
,
"QVector<int>"
))
return
dumpStdIntList
();
dumpQIntVector
();
if
(
!
qstrcmp
(
arg
,
"list<string>"
))
if
(
!
qstrcmp
(
arg
,
"string"
))
return
dumpStdStringList
();
dumpStdString
();
fprintf
(
stderr
,
"Unhandled type %s
\n
"
,
arg
);
if
(
!
qstrcmp
(
arg
,
"list<int>"
))
return
1
;
dumpStdIntList
();
if
(
!
qstrcmp
(
arg
,
"list<string>"
))
dumpStdStringList
();
if
(
!
qstrcmp
(
arg
,
"vector<int>"
))
dumpStdIntVector
();
if
(
!
qstrcmp
(
arg
,
"QObject"
))
dumpQObject
();
}
return
0
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment