GSOC - Provide Qt pretty printer for command line gdb

Ralf Habacker ralf.habacker at freenet.de
Mon May 31 15:22:05 BST 2021


Hi Ebuka,

first, I would like to thank you for your good presentation yesterday
about the ways gdb can query internal data structures from an
application/library being debugged. The two ways listed, executing
public class methods with gdb.parse_and_eval () and direct access to an
application's memory should cover everything needed in my opinion.

As we stated together, the first goal is to provide QtCore - pretty
printers for gdb on the command line to debug the console program
klauncher5 I presented yesterday on Windows with Qt5 information.

This goal is not immediately achievable and needs some more steps.
To lower the entry hurdle, I think we should first start with a simple
Qt console application on the Linux platform you know. In principle, any
Qt console application could be used for this. But since we want to work
primarily with the kmymoney sources, I recommend to build kmymoney from
the master branch on Linux and use the generated console application
xea2kmt.

mkdir ~/src
cd src
git clone https://invent.kde.org/office/kmymoney.git
cd kmymoney-build
cmake ../kmymoney
make [-jxx]
gdb --args bin/xea2kmt --debug not-existant.xea
l main
b 623
... <activate qt5 debug printers>
r

p arg

For this test case, QString, QDir, QStringList, QList, and QMap are
relevant. After that, QXmlStreamReader, QXmlStreamWriter and others
could follow.

As a remote target I think
https://codereview.qt-project.org/c/qt/qtbase/+/87052/2/src/gdbprinters/qt5printers/core.py#889
would be suitable.

If there is nothing against it, I recommend to use the implementation of
https://codereview.qt-project.org/c/qt/qtbase/+/87052/2/src/gdbprinters/qt5printers/core.py
as a base layer. You can test it right away, where something is missing
and needs to be added.

Best regards
 Ralf


More information about the Kde-finance-apps mailing list