owned this note changed 4 years ago
Linked with GitHub

How to Debug Using GDB - 張明彥

由於場地問題,第二天我們移動到另一棟大樓啦!議程教室變動請見網站上的議程表

歡迎來到 https://hackmd.io/@coscup/2019 共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

點擊本頁上方的 開始用 Markdown 一起寫筆記!
手機版請點選上方 按鈕展開議程列表。

  • 去 IC 廠很好用
  • 用來找出熱點
  • 用 addr2line 可以反查

為什麼要學 GDB

  1. 處理複雜的 compiler flag
  2. 快速在陌生的環境 dbug
  3. 處理骯髒的 code

知道 runtime 的 code flow

b function
bt 

印出 back trace

觀察資料結構

印出 vector A

p A

好處

  1. 快速驗證,節省編譯的時間

常見使用情境

lay src

顯示 source code,退出 ctrl + x + a

需要編譯時下 -g 帶上 symbol 才能用

印出 dump 當前所有 call stack

thread apply all bt

Tools

投影片

今天的投影片 How to debug using GDB

Q&A

Hi,我是講者大大
如果有還有疑惑,或是那邊覺得我說不清楚的,可以mail到:

相關資料我在hackmd上面有筆記可以參考: AIdrifter CS 浮生筆錄

tags: COSCUP2019 帶您讀源碼 IE2102

Youtube:
https://www.youtube.com/watch?v=41UR0bWS5h8

Select a repo