Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flatpak-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
Marco Bubke
flatpak-qt-creator
Commits
efed3fd7
Commit
efed3fd7
authored
14 years ago
by
Friedemann Kleint
Browse files
Options
Downloads
Patches
Plain Diff
Debugger[CDB]: Add a dumper for QSharedPointer.
As the structure is quite deeply nested.
parent
4e2937bf
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libs/qtcreatorcdbext/knowntype.h
+1
-0
1 addition, 0 deletions
src/libs/qtcreatorcdbext/knowntype.h
src/libs/qtcreatorcdbext/symbolgroupvalue.cpp
+35
-0
35 additions, 0 deletions
src/libs/qtcreatorcdbext/symbolgroupvalue.cpp
with
36 additions
and
0 deletions
src/libs/qtcreatorcdbext/knowntype.h
+
1
−
0
View file @
efed3fd7
...
@@ -76,6 +76,7 @@ enum KnownType
...
@@ -76,6 +76,7 @@ enum KnownType
KT_QAtomicInt
=
KT_Qt_Type
+
KT_HasSimpleDumper
+
19
,
KT_QAtomicInt
=
KT_Qt_Type
+
KT_HasSimpleDumper
+
19
,
KT_QObject
=
KT_Qt_Type
+
KT_HasSimpleDumper
+
KT_HasComplexDumper
+
20
,
KT_QObject
=
KT_Qt_Type
+
KT_HasSimpleDumper
+
KT_HasComplexDumper
+
20
,
KT_QWidget
=
KT_Qt_Type
+
KT_HasSimpleDumper
+
KT_HasComplexDumper
+
21
,
KT_QWidget
=
KT_Qt_Type
+
KT_HasSimpleDumper
+
KT_HasComplexDumper
+
21
,
KT_QSharedPointer
=
KT_Qt_Type
+
KT_HasSimpleDumper
+
KT_HasComplexDumper
+
22
,
// Types: Various QT movable types
// Types: Various QT movable types
KT_QPen
=
KT_Qt_Type
+
KT_Qt_MovableType
+
30
,
KT_QPen
=
KT_Qt_Type
+
KT_Qt_MovableType
+
30
,
KT_QUrl
=
KT_Qt_Type
+
KT_Qt_MovableType
+
31
,
KT_QUrl
=
KT_Qt_Type
+
KT_Qt_MovableType
+
31
,
...
...
This diff is collapsed.
Click to expand it.
src/libs/qtcreatorcdbext/symbolgroupvalue.cpp
+
35
−
0
View file @
efed3fd7
...
@@ -939,6 +939,10 @@ static KnownType knownClassTypeHelper(const std::string &type,
...
@@ -939,6 +939,10 @@ static KnownType knownClassTypeHelper(const std::string &type,
if
(
!
type
.
compare
(
qPos
,
11
,
"QLinkedList"
))
if
(
!
type
.
compare
(
qPos
,
11
,
"QLinkedList"
))
return
KT_QLinkedList
;
return
KT_QLinkedList
;
break
;
break
;
case
14
:
if
(
!
type
.
compare
(
qPos
,
14
,
"QSharedPointer"
))
return
KT_QSharedPointer
;
break
;
}
}
}
}
// Remaining non-template types
// Remaining non-template types
...
@@ -1688,6 +1692,29 @@ static bool dumpQVariant(const SymbolGroupValue &v, std::wostream &str, void **s
...
@@ -1688,6 +1692,29 @@ static bool dumpQVariant(const SymbolGroupValue &v, std::wostream &str, void **s
return
true
;
return
true
;
}
}
// Dump a qsharedpointer (just list reference counts)
static
inline
bool
dumpQSharedPointer
(
const
SymbolGroupValue
&
v
,
std
::
wostream
&
str
,
void
**
specialInfoIn
=
0
)
{
const
SymbolGroupValue
externalRefCountV
=
v
[
unsigned
(
0
)];
if
(
!
externalRefCountV
)
return
false
;
const
SymbolGroupValue
dV
=
externalRefCountV
[
"d"
];
if
(
!
dV
)
return
false
;
// Get value element from base and store in special info.
const
SymbolGroupValue
valueV
=
externalRefCountV
[
unsigned
(
0
)][
"value"
];
if
(
!
valueV
)
return
false
;
// Format references.
const
int
strongRef
=
dV
[
"strongref"
][
"_q_value"
].
intValue
();
const
int
weakRef
=
dV
[
"weakref"
][
"_q_value"
].
intValue
();
if
(
strongRef
<
0
||
weakRef
<
0
)
return
false
;
str
<<
L"References: "
<<
strongRef
<<
'/'
<<
weakRef
;
*
specialInfoIn
=
valueV
.
node
();
return
true
;
}
// Dump builtin simple types using SymbolGroupValue expressions.
// Dump builtin simple types using SymbolGroupValue expressions.
unsigned
dumpSimpleType
(
SymbolGroupNode
*
n
,
const
SymbolGroupValueContext
&
ctx
,
unsigned
dumpSimpleType
(
SymbolGroupNode
*
n
,
const
SymbolGroupValueContext
&
ctx
,
std
::
wstring
*
s
,
int
*
knownTypeIn
/* = 0 */
,
std
::
wstring
*
s
,
int
*
knownTypeIn
/* = 0 */
,
...
@@ -1792,6 +1819,9 @@ unsigned dumpSimpleType(SymbolGroupNode *n, const SymbolGroupValueContext &ctx,
...
@@ -1792,6 +1819,9 @@ unsigned dumpSimpleType(SymbolGroupNode *n, const SymbolGroupValueContext &ctx,
case
KT_QWidget
:
case
KT_QWidget
:
rc
=
dumpQWidget
(
v
,
str
,
specialInfoIn
)
?
SymbolGroupNode
::
SimpleDumperOk
:
SymbolGroupNode
::
SimpleDumperFailed
;
rc
=
dumpQWidget
(
v
,
str
,
specialInfoIn
)
?
SymbolGroupNode
::
SimpleDumperOk
:
SymbolGroupNode
::
SimpleDumperFailed
;
break
;
break
;
case
KT_QSharedPointer
:
rc
=
dumpQSharedPointer
(
v
,
str
,
specialInfoIn
)
?
SymbolGroupNode
::
SimpleDumperOk
:
SymbolGroupNode
::
SimpleDumperFailed
;
break
;
case
KT_StdString
:
case
KT_StdString
:
case
KT_StdWString
:
case
KT_StdWString
:
rc
=
dumpStd_W_String
(
v
,
str
)
?
SymbolGroupNode
::
SimpleDumperOk
:
SymbolGroupNode
::
SimpleDumperFailed
;
rc
=
dumpStd_W_String
(
v
,
str
)
?
SymbolGroupNode
::
SimpleDumperOk
:
SymbolGroupNode
::
SimpleDumperFailed
;
...
@@ -1863,6 +1893,11 @@ std::vector<AbstractSymbolGroupNode *>
...
@@ -1863,6 +1893,11 @@ std::vector<AbstractSymbolGroupNode *>
SymbolGroupNode
*
containerNode
=
reinterpret_cast
<
SymbolGroupNode
*>
(
specialInfo
);
SymbolGroupNode
*
containerNode
=
reinterpret_cast
<
SymbolGroupNode
*>
(
specialInfo
);
rc
.
push_back
(
new
ReferenceSymbolGroupNode
(
"children"
,
"children"
,
containerNode
));
rc
.
push_back
(
new
ReferenceSymbolGroupNode
(
"children"
,
"children"
,
containerNode
));
}
}
case
KT_QSharedPointer
:
// Special info by simple dumper is the value
if
(
specialInfo
)
{
SymbolGroupNode
*
valueNode
=
reinterpret_cast
<
SymbolGroupNode
*>
(
specialInfo
);
rc
.
push_back
(
new
ReferenceSymbolGroupNode
(
"value"
,
"value"
,
valueNode
));
}
break
;
break
;
default
:
default
:
break
;
break
;
...
...
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