Coder Social home page Coder Social logo

qt5printers's Introduction

qt5printers

The core.py, typeinfo.py and __init__.py files are taken from patchset 2 at https://codereview.qt-project.org/87052 and provide a GDB pretty printer for Qt5. These are authored by Alex Merry from the KDE project.

Usage

Copy the three Python files to ~/.gdb/qt5printers/ and add this to your ~/.gdbinit (or execute it from an existing gdb session):

python
import sys, os.path
sys.path.insert(0, os.path.expanduser('~/.gdb'))
import qt5printers
qt5printers.register_printers(gdb.current_objfile())
end

Now verify it with your favorite program. Below you can find a quick test program.

Test program

Here is a test program (save it as test.cpp):

#include <QTextStream>
void test(const QByteArray & ba) { }
int main(void) {
    test(QByteArray("abc"));
    return 0;
}

Compile it with:

g++ test.cpp $(pkg-config --cflags --libs Qt5Core) -g

If everything goes well you should see the expanded data:

$ gdb -q -ex break\ test -ex r ./a.out
...
Breakpoint 1, test (ba="abc" = {...}) at test.cpp:4
4           test(QByteArray("abc"));

Background

The Qt4 pretty printers from KDevelop0 are not fully compatible with Qt5. For instance, the latest version (from December 2014) does not properly handle QByteArray. While these qt5printers are compatible with Qt5, it conflicts with Qt4 (for example, QByteArray changed in Qt 5 from Qt 4 in this commit1).

See also:

License

For the applicable licenses, see the headers of the files and refer to the Qt5 sources at https://code.qt.io/cgit/qt/qtbase.git/tree/.

qt5printers's People

Contributors

lekensteyn avatar kropp avatar nicholasbishop avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.