1 Star 0 Fork 1

anklean / qt5printers

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

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/.

空文件

简介

暂无描述 展开 收起
Python
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/anklean/qt5printers.git
git@gitee.com:anklean/qt5printers.git
anklean
qt5printers
qt5printers
master

搜索帮助