1.使用 dump memory 导出二进制数据
dump memory <输出文件> <起始地址> <结束地址>示例:
pBuf的地址是0x55555555a000nLength的值是1024(字节)
# 计算结束地址 = pBuf + nLength
(gdb) set $endAddr = (char*)pBuf + nLength
(gdb) dump memory dump.bin pBuf $endAddr
# 或者
(gdb) dump memory dump.bin pBuf pBuf+nLength