[問題] CMake在vscode中debug出現錯誤

作者: fishxd1096 (UN_ReAL)   2021-06-19 16:42:36
開發平台(Platform): (Ex: Win10, Linux, ...)
Linux
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
GCC
問題(Question):
我照著VSCODE官方的CMake Hello World教學操作,可以編譯、可以執行,但是進行debug時出現錯誤。
(我不會用CMake,只知道是用來Build專案的工具,所以想透過這個hello world開始學習)
我選擇的Kit
https://imgur.com/FNCF113
Build訊息
https://imgur.com/rwZKcCJ
可以在斷點停下
https://imgur.com/ZQo2hgq
Debug訊息
https://imgur.com/sSEm6x5
但按下Step後就錯誤了
https://imgur.com/19nicB8
我在該路徑應該放什麼檔案嗎?我的根目錄沒有build這個資料夾
https://imgur.com/BT7GIU4
我前陣子google了很久還是不知道怎麼解決,所以決定詢問大家
作者: Sanvean   2021-06-19 17:15:00
你是用 Step in, Step out 還是 Step over? 我猜是用到Step in,然後進到沒有 debug 資訊的 library 裡了。當你在 cout 那一行要 Step in 的時候應該會進到Standard Library,如果沒有特別安裝或自己編譯,stdlib不是沒有 debug 資訊就是沒有對應可以 debug 的原始碼。

Links booklink

Contact Us: admin [ a t ] ucptt.com