From 8d7b548d9ea0e0b2579e2901ed2ab2cfa59b693d Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 6 Feb 2018 10:29:06 +0100 Subject: [PATCH] Doc: Add info on getting to object base instance in debugging helper Task-number: QTCREATORBUG-19597 Change-Id: Ie02b51c771faf70a1210abb5e1abe6120706c031 Reviewed-by: hjk --- doc/src/debugger/creator-debugger.qdoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/src/debugger/creator-debugger.qdoc b/doc/src/debugger/creator-debugger.qdoc index fa50073ef32..e6ba8f2eb98 100644 --- a/doc/src/debugger/creator-debugger.qdoc +++ b/doc/src/debugger/creator-debugger.qdoc @@ -1100,6 +1100,16 @@ avoid direct access to the \c gdb.* and \c lldb.* namespaces and use the 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 a regular expression. To do so, the debugging helper's function name must begin with \c{qdump__} (with two underscore characters). In addition,