# 使用GDB

可參考:[https://www.csee.umbc.edu/portal/help/nasm/nasm.shtml](https://www.csee.umbc.edu/portal/help/nasm/nasm.shtml)

## 1.我們可用gdb工具來debug

先輸入`gdb <可執行檔案>`

## ![](https://2330916861-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0u4DAW2Q8d61r4ibZO%2F-M0u4EnVwlqR5slLPOM-%2F-M0u4VsPrPqbLo13CKV1%2F12ed.png?generation=1582596282208317\&alt=media)

## 2. 接著我們可輸入run來執行程式，與disassemble來查看記憶體

![](https://2330916861-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0u4DAW2Q8d61r4ibZO%2F-M0u4EnVwlqR5slLPOM-%2F-M0u4VsRPIvx_xdhoIwE%2Fjs2.png?generation=1582596278766160\&alt=media)
