GDB Cheatsheet


Sep 24, 2021

一些開發 OS 時常用到的指令,意外解出很多奇妙 bug

Display variable

  • Display variable name hello

    • display hello
  • Display with different format: (ref: Output formats)

    • display/x (hex)
    • display/t (binary)

Examining Memory

General format: x/nfu addr, n(count), f(format), u(unit size)

  • Examining memory start from 0x720 with 20 items in hex with 8 bits in each item
    • x/20b 0x720 or x/20xb 0x720 becuase format is default to hex
  • Set breakpoint while pc=0x8000
    • break *0x8000 (* is necessary)

Show register

  • info registers

Set variable

Set a variable with name myVar1

  • set $myVar1 = 1
#gdb






你可能感興趣的文章

如何成為專家 - 技巧篇(尚未完成,先放出來供需要的朋友參考)

如何成為專家 - 技巧篇(尚未完成,先放出來供需要的朋友參考)

N4_Webpack 介紹、使用

N4_Webpack 介紹、使用

統一網頁支付介面:Payment Request API

統一網頁支付介面:Payment Request API






留言討論






2
2
2