看板 C_and_CPP 關於我們 聯絡資訊
開發平台(Platform): (Ex: Win10, Linux, ...) Ubuntu 20.04 編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出) GNU gdb 7.6.1 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): 因為之前都是先放breakpoint在main,然後直接run。 最近開始使用start命令來跑,在官網上看start指令的效用為 The ‘start’ command does the equivalent of setting a temporary breakpoint at the beginning of the main procedure and then invoking the ‘run’ command. 看起來跟我原先的用法相同,但我使用start作為開始後產生的中斷點卻無法在 info breakpoint中看到,有大大知道為甚麼嗎??? 餵入的資料(Input): gdb ./a.out start 預期的正確結果(Expected Output): Num Type Disp Enb Address What 1 breakpoint keep y 0x004045f9 in main at xc.c:1290 錯誤結果(Wrong Output): No breakpoints or watchpoints. 程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔) 補充說明(Supplement): 在這個網站找到相關說明 https://undo.io/resources/gdb-watchpoint/5-ways-reduce-debugging-hours/ Tip: Using the start command instead of the usual run command sets a temporary breakpoint at main(). -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 122.116.159.149 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1613471820.A.008.html
b0920075: temporary breakpoint 所以當你停下來之後就沒了吧 02/16 18:41
Matz: 感謝大大,順著這個思路找到 02/16 22:51
※ 編輯: Matz (1.171.71.187 臺灣), 02/16/2021 22:52:59