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
84bba817
Commit
84bba817
authored
Jun 07, 2010
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc: adjust description of python dumper classes to reality
parent
73629359
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
42 deletions
+44
-42
doc/qtcreator.qdoc
doc/qtcreator.qdoc
+44
-42
No files found.
doc/qtcreator.qdoc
View file @
84bba817
...
...
@@ -4800,14 +4800,13 @@
d.putNumChild(size)
if d.isExpanded(item):
p = gdb.Value(p_ptr["array"]).cast(innerType.pointer())
d.beginChildren(
[size, 2000], innerType)
with Children(d,
[size, 2000], innerType)
for i in d.childRange():
d.safeP
utItem(Item(p.dereference(), item.iname, i))
d.p
utItem(Item(p.dereference(), item.iname, i))
p += 1
d.endChildren()
\endcode
\section2 Item
Python
Class
\section2 Item Class
The Item Python class is a thin wrapper around values corresponding to one
line in the \gui{Locals and Watchers} view. The Item members are as follows :
...
...
@@ -4833,7 +4832,7 @@
\endlist
\section2 Dumper
Python
Class
\section2 Dumper Class
For each line in the \gui{Locals and Watchers} view, a string like the
following needs to be created and channeled to the debugger plugin.
...
...
@@ -4878,26 +4877,14 @@
\o \gui{putField(self, name, value)} - Appends a comma if needed, and a
name='value' field.
\o \gui{beginHash(self)} - Appends a comma if needed and a '{', marking
the begin of a set of fields.
\o \gui{endHash(self)} - Appends a '}', marking the end of a set of
fields.
\o \gui{beginItem(self, name)} - Starts writing a field by writing \c {name='}.
\o \gui{endItem(self)} - Ends writing a field by writing \c {'}.
\o \gui{beginChildren(self, numChild_ = 1, childType_ = None, childNumChild_ = None)}
- Starts writing a list of \c numChild children, with type
\c childType_ and \c childNumChild_ grandchildren each. If \c numChild_
is a list of two integers, the first one specifies the actual number
of children and the second the maximum number of children to print.
\o \gui{endChildren(self)} - Ends writing a list of children.
\o \gui{childRange(self)} - Return the range of children specified in
\c beginChildren
.
\o \gui{childRange(self)} - Return
s
the range of children specified in
the current \c Children scope
.
\o \gui{putItemCount(self, count)} - Appends a field \c {value='<%d items'}
to the output.
...
...
@@ -4996,33 +4983,48 @@
\o \gui{putItem(self, item)} - Equivalent to:
\code
self.beginHash()
with SubItem(self):
self.putItemHelper(item)
self.endHash()
\endcode
\o \gui{safePutItemHelper(self, item)} - Calls \c putItemHelper(self, item).
If an exception is raised, catches it, and replaces all output produced by
\c putItemHelper with the output of:
Exceptions raised by nested function calls are caught and all
output produced by \c putItemHelper is replaced by the output of:
\code
self.putName(item.name)
self.putValue("
<
invalid
>
")
self.putType(str(item.value.type))
self.putNumChild(0)
self.beginChildren()
self.endChildren()
...
except RuntimeError:
d.put('value="
<
invalid
>
",type="
<
unknown
>
",numchild="
0
",')
\endcode
\endlist
\o \gui{safePutItem(self, item)} - Equivalent to:
\code
self.beginHash()
self.safePutItemHelper(item)
self.endHash()
\endcode
\endlist
\section2 Children and SubItem Class
The attempt to create child items might lead to errors if data is
uninitialized or corrupted. To gracefully recover in such situations,
use \c Children and \c SubItem \e{Context Managers} to create the nested items.
The \c Children constructor \gui{__init__(self, dumper, numChild = 1,
childType = None, childNumChild = None)} uses one mandatory argument and three
optional arguments. The mandatory argument refers to the current \c Dumper
object. The optional arguments can be used to specify the number \c numChild
of children, with type \c childType_ and \c childNumChild_ grandchildren each.
If \c numChild_ is a list of two integers, the first one specifies the actual
number of children and the second the maximum number of children to print.
Similarly, using the \SubItem class helps to protect individual items.
Example:
\code
d.putNumChild(2)
if d.isExpanded(item):
with Children(d):
with SubItem(d):
d.putName("
key
")
d.putItemHelper(Item(key, item.iname, "
key
"))
with SubItem(d):
d.putName("
value
")
d.putItemHelper(Item(value, item.iname, "
value
"))
\endcode
*/
...
...
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