Doc: Add info on getting to object base instance in debugging helper

Task-number: QTCREATORBUG-19597
Change-Id: Ie02b51c771faf70a1210abb5e1abe6120706c031
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Leena Miettinen
2018-02-06 10:29:06 +01:00
parent 3f757998b5
commit 8d7b548d9e

View File

@@ -1100,6 +1100,16 @@
avoid direct access to the \c gdb.* and \c lldb.* namespaces and use the avoid direct access to the \c gdb.* and \c lldb.* namespaces and use the
functions of the \c Dumper class instead. functions of the \c Dumper class instead.
To get to the base instance of the object in the debugging helper, use the
\c value.base() function or the following example code:
\code
def qdump__A(d, value):
t = value.members(True)[0].type
dptr, base_v = value.split('p{%s}' % t.name)
d.putItem(base_v)
\endcode
Debugging helpers can be set up to be called whenever a type name matches Debugging helpers can be set up to be called whenever a type name matches
a regular expression. To do so, the debugging helper's function name must a regular expression. To do so, the debugging helper's function name must
begin with \c{qdump__} (with two underscore characters). In addition, begin with \c{qdump__} (with two underscore characters). In addition,