[Qt-creator] Introducing the python based cdb dumper

David Schulz david.schulz at qt.io
Wed Jan 18 10:55:55 CET 2017


Hi all,

The local values provided by debuggers contain very basic data, which in 
most cases
isn't helpful at all. We are using dumpers/extensions to convert these 
data into user
friendly information. Python based dumpers have been used for quite a 
long time
now when debugging with GDB. The LLDB engine also dumps values via these 
dumpers.
Both debuggers provide a python interpreter and interface allowing to 
access debugger
internals from python code. In contrast: the CDB engine uses an 
extension (dll) loaded
into the debugger to collect data and dump values. This requires us to 
maintain two
different approaches on dumping values. Unfortunately the CDB doesn't 
provide a
python interface.
So, let's introduce one.
First step was to lower the barrier for new debuggers using the python 
dumpers by
reducing the interface required by our dumpers to a minimum. Big thanks 
to Andre
to take care of that. Next step was to provide all necessary information 
from the CDB
in a python module that can be accessed by the python dumper, 
fortunately this task
was easier than expected. Final step and currently in process is 
packaging and
delivering the extension with Qt Creator. And here comes the downside: 
We need to
accept a new license (https://docs.python.org/3.5/license.html) when 
using the python
enabled CDB extension. The idea is to have an extra component (selected 
by default)
for the CDB extension when installing Qt Creator on Windows. This way 
you could
still use Qt Creator without accepting the license, but you won't be 
able to debug
with CDB.

Any opinions regarding the python license or the dumper topic in general?

Whoever want to test the python based dumpers need to define an environment
variable PYTHON_INSTALL_DIR that points to a Python 3.5 installation 
matching the
bitness of your Qt before building Qt Creator. The same path needs to be 
added to
the PATH environment variable before executing Qt Creator. Feel free to 
contact me
on any available channel if you encounter any problems.

TL;DR: I want to use python in the CDB extension. Debugging with the CDB 
will require
accepting a new license (https://docs.python.org/3.5/license.html). For 
testing: Define
PYTHON_INSTALL_DIR pointing to a python 3.5 installation before building 
Qt Creator and
add python to your PATH before executing Qt Creator.

Greetings
David




More information about the Qt-creator mailing list