久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 Qt Creator 中進入 Qt 源代碼(在 Ubuntu Linux 中)

Stepping into Qt sources in Qt Creator (in Ubuntu Linux)(在 Qt Creator 中進入 Qt 源代碼(在 Ubuntu Linux 中))
本文介紹了在 Qt Creator 中進入 Qt 源代碼(在 Ubuntu Linux 中)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我在 Ubuntu 中使用 Qt Creator.它是從存儲庫安裝的,但就像現在一樣,調試時無法進入 Qt 源.

I'm using Qt Creator in Ubuntu. It's installed from the repositories but as it is now, there is no way to step into the Qt sources when debugging.

我怎樣才能啟用它?

推薦答案

由于Qt Creator使用gdb,所以需要配置gdb.首先要做的是安裝Qt調試符號:

Since Qt Creator uses gdb, you need to configure gdb. First thing to do is to install Qt debugging symbols:

apt-get install libqt4-dbg

或者,對于 Qt5:

apt-get install qtbase5-dbg # For the qtbase package

這將為 Qt 庫安裝調試符號.舊版本的 Ubuntu 有一個愚蠢的錯誤,需要額外的技巧來糾正這些符號文件,但在當前版本中它運行良好.

This will install the debugging symbols for Qt libraries. Older releases of Ubuntu had a silly bug that required additional trick to correct those symbol files, but in the current release it works fine.

這將使 gdb 進入 Qt 方法,但沒有源就沒有樂趣.所以我們需要可以像這樣安裝的源,假設在 APT 中啟用了源存儲庫:

This will make gdb step inside Qt methods, but it's no fun without sources. So we need sources which can be installed like this, assuming that the source repository is enabled in the APT:

apt-get source qt4-x11
ln -s qt4-x11-4.7.0 qt # a convenience symlink

或者,對于 Qt5:

apt-get source qtbase-opensource-src
# Make a link as above, if you wish

這將下載源代碼,將它們解壓到當前目錄并相應地修補它們,除非當前用戶不可寫入當前目錄,否則不需要 root 權限.

This will download the sources, unpack them into the current directory and patch them accordingly, no root privileges needed unless the current dir isn't writeable by the current user.

最后一件事是通知 gdb 源位置,這是通過將它放在 ~/.gdbinit 文件中來完成的:

And the last thing is to inform gdb of the sources location, which is done by putting this in the ~/.gdbinit file:

dir ~/vita/qt/src/corelib
dir ~/vita/qt/src/gui
dir ~/vita/qt/src/network
dir ~/vita/qt/src/sql

根據需要添加模塊和正確的路徑.方便的符號鏈接在這里非常有用,因此我們不必每次升級到新的 Qt 版本時都編輯此文件.我們只需要下載新的源代碼,修補它們并更改符號鏈接.

Add modules and correct paths as needed. The convenience symlink is very useful here, so we don't have to edit this file each time we upgrade to a new Qt version. We only need to download the new sources, patch them and change the symlink.

請注意,即使我們安裝了調試符號,我們仍然使用 Qt 庫的發布版本.這意味著代碼經過高度優化,有時在進入 Qt 二進制文件時會表現得非常奇怪.如果有問題,則需要在調試模式下構建 Qt,單獨安裝(例如,在/usr/local/qt4-debug 中)并告訴 Qt Creator 使用該特定安裝.

Note that even we have installed the debugging symbols, we still use the release build of Qt libraries. This means that the code is highly optimized and will sometimes behave very strange when stepping inside Qt binaries. If it is a problem, then it is necessary to build Qt in debug mode, install it separately (say, in /usr/local/qt4-debug) and tell Qt Creator to use that particular installation.

這篇關于在 Qt Creator 中進入 Qt 源代碼(在 Ubuntu Linux 中)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How can I read and manipulate CSV file data in C++?(如何在 C++ 中讀取和操作 CSV 文件數據?)
In C++ why can#39;t I write a for() loop like this: for( int i = 1, double i2 = 0; (在 C++ 中,為什么我不能像這樣編寫 for() 循環: for( int i = 1, double i2 = 0;)
How does OpenMP handle nested loops?(OpenMP 如何處理嵌套循環?)
Reusing thread in loop c++(在循環 C++ 中重用線程)
Precise thread sleep needed. Max 1ms error(需要精確的線程睡眠.最大 1ms 誤差)
Is there ever a need for a quot;do {...} while ( )quot; loop?(是否需要“do {...} while ()?環形?)
主站蜘蛛池模板: 99re热精品视频 | 亚洲成人第一页 | 颜色网站在线观看 | 成人免费看片 | 亚洲看片| 午夜羞羞| 欧州一区 | 午夜免费网 | 欧美精品二区 | 国产乱码一二三区精品 | 日韩av在线中文字幕 | 精品久久中文 | 日本一区二区三区四区 | 在线中文字幕亚洲 | 天天影视网天天综合色在线播放 | 亚洲电影成人 | 成人性生交a做片 | 91久久精品国产91久久性色tv | 国产精品视频一区二区三区, | 偷拍亚洲色图 | 久久久久久久久久一区 | 99精品免费久久久久久久久日本 | 亚洲在线一区 | 九九精品在线 | 国产清纯白嫩初高生视频在线观看 | 色综合天天天天做夜夜夜夜做 | 国产成人99久久亚洲综合精品 | h在线看 | 午夜视频一区二区三区 | 欧美一区二区三区在线免费观看 | 国产亚洲欧美在线 | av网址在线播放 | 国产在线精品一区二区三区 | 久久伊人影院 | 亚洲电影成人 | 九九视频网 | 亚洲 欧美 日韩 在线 | 91在线网 | 国产精品久久久久一区二区三区 | 国产午夜精品视频 | 欧美日韩亚洲国产综合 |