VScode-C語言除錯技巧
VScode
(float[5])v_anchors
查看大小為5的float array
參考:
https://github.com/microsoft/vscode-cpptools/issues/688#issuecomment-299262784
GDB
列印位址
1 | //變數c的位址 |
https://stackoverflow.com/questions/43861731/gdb-print-the-value-of-memory-address
列印位址的內容
1 | (gdb) p *(struct node *) 0x00000000004004fc |
https://stackoverflow.com/questions/43861731/gdb-print-the-value-of-memory-address
segmentation fault 除錯
- gdb run 並且帶入執行參數
gdb –args executablename arg1 arg2 arg3
(gdb) run
VScode-C語言除錯技巧