LLDB调试和GDB调试 memory read格式

1,105 阅读1分钟

iOS调试要经常用到动态调试,这里是GDB和LLDB的对照图### GDB to LLDB command map

Examining Memory

The unit size is any of

  • b

    Bytes.

  • h

    Halfwords (two bytes).

  • w

    Words (four bytes). This is the initial default.

  • g

    Giant words (eight bytes).

比如 (lldb) x/4gx 0x100008000 意思是 读取0x100008000内存地址存放的内容,显示4个g(八个字节) 以x(hexidecimal格式)显示

第二个x代表显示格式,是默认格式,此外还有(‘x’, ‘d’, ‘u’, ‘o’, ‘t’, ‘a’, ‘c’, ‘f’, ‘s’)