GDB dump mem example和命令
使用方法:
You can use the commands dump, append, and restore to copy data between target memory and a file. The dump and append commands write data to a file, and the restore command reads data from a file back into the inferior's memory. Files may be in binary, Motorola S-record, Intel hex, or Tektronix Hex format; however, gdb can only append to binary files.
dump[format]memoryfilename start_addr end_addrdump[format]valuefilename expr- Dump the contents of memory from start_addr to end_addr, or the value of expr, to filename in the given format.
The format parameter may be any one of:
binary- Raw binary form.
ihex- Intel hex format.
srec- Motorola S-record format.
tekhex- Tektronix Hex format.
gdb uses the same definitions of these formats as the gnu binary utilities, like `objdump' and `objcopy'. If format is omitted, gdb dumps the data in raw binary form.
append[binary]memoryfilename start_addr end_addrappend[binary]valuefilename expr- Append the contents of memory from start_addr to end_addr, or the value of expr, to the file filename, in raw binary form. (gdb can only append data to files in raw binary form.)
restorefilename [binary] bias start end- Restore the contents of file filename into memory. The
restorecommand can automatically recognize any known bfd file format, except for raw binary. To restore a raw binary file you must specify the optional keywordbinaryafter the filename.If bias is non-zero, its value will be added to the addresses contained in the file. Binary files always start at address zero, so they will be restored at address bias. Other bfd files have a built-in location; they will be restored at offset bias from that location.
If start and/or end are non-zero, then only data between file offset start and file offset end will be restored. These offsets are relative to the addresses in the file, before the bias argument is applied.
举个例子:
dump binary memory result.bin 0x200000000 0x20000c350
This will give you a plain binary dump int file result.bin. You can also use the following to dump it in hex format:
dump ihex memory result.bin 0x200000000 0x20000c350
Using the dump command is much clearer than using the gdb logging hack (which even did not work for me somehow)
参考文档: https://stackoverflow.com/questions/16095948/gdb-dump-memory-save-formatted-output-into-a-file
GDB dump mem example和命令的更多相关文章
- gdb调试多进程和多线程命令
gdb调试多进程和多线程命令 来源:http://blog.csdn.net/pbymw8iwm/article/details/7876797 1. 默认设置下,在调试多进程程序时GDB只会调试主 ...
- Linux中使用gdb dump内存
在应急响应中,我们往往会有dump出某一块内存下来进行分析的必要.今天要讲的是利用gdb命令dump出sshd进程的内存. 按照 Linux 系统的设计哲学,内核只提供dump内存的机制,用户想要du ...
- [每天一个Linux小技巧] gdb 下一次运行多个命令
一般gdb运行的时候,我们仅仅能输入一个命令. 如: (gdb) c (gdb) bt 假设想运行多个命令怎么办? 能否像bash那样, 使用; 如 ls; ls 结论是不行. 但能够通过gdb 内建 ...
- [转]gdb调试多进程和多线程命令
1. 默认设置下,在调试多进程程序时GDB只会调试主进程.但是GDB(>V7.0)支持多进程的分别以及同时调试,换句话说,GDB可以同时调试多个程序.只需要设置follow-fork-mode( ...
- gdb调试多进程和多线程命令(转)
1. 默认设置下,在调试多进程程序时GDB只会调试主进程.但是GDB(>V7.0)支持多进程的分别以及同时调试,换句话说,GDB可以同时调试多个程序.只需要设置follow-fork-mode( ...
- CPU IO MEM NETWork 监控命令
性能优化中CPU.内存.磁盘IO.网络性能的依赖(上) 性能优化中CPU.内存.磁盘IO.网络性能的依赖(下)
- gdb各种调试命令和技巧
陈皓:用GDB调试程序 GDB概述———— GDB是GNU开源组织发布的一个强大的UNIX下的程序调试工具.或许,各位比较喜欢那种图形界面方式的,像VC.BCB等IDE的调试,但如果你是在UNIX平台 ...
- linux包之gdb之gdb命令与core文件产生
gdb-7.2-64.el6_5.2.x86_64/usr/bin/gcore/usr/bin/gdb/usr/bin/gdb-add-index/usr/bin/gdbtui/usr/bin/gst ...
- 比较全面的gdb调试命令 (转载)
转自http://blog.csdn.net/dadalan/article/details/3758025 用GDB调试程序 GDB是一个强大的命令行调试工具.大家知道命令行的强大就是在于,其可以形 ...
随机推荐
- NumPy学习_02 ndarray基本操作
1.算术运算符 它们只用于位置相同的元素之间,即为元素级的运算. 所得到的运算结果组成一个新的数组. 不用编写循环即可对数据执行批量运算.(矢量化) import numpy as np # 创建一个 ...
- postma概念与使用
Postman是google开发的一款功能强大的网页调试与发送网页HTTP请求,并能运行测试用例的的Chrome插件.Postman作为一个chrome的插件,你可以打开chrome,在chrome ...
- 1. String可调用方法
class str(basestring): """ str(object='') -> string Return a nice string represent ...
- 将bean转换成XML字符串
package com.sinoservices.bms.bbl.rest.bean; import javax.xml.bind.annotation.XmlAccessType; import j ...
- BFC和清除浮动
1.清浮动(不考虑兼容的话这一项够用了): .clear:after{ content:''; display:block; clear:both; } 兼容ie6或7 加一个 .clear{ *zo ...
- linux下安装srilm
1.安装相关依赖库 a.c/c++ compiler:编译器gcc 3.4.3及以上版本 b.GNU make:构建和管理工程的工具,解释Makefile里的指令,描述了整个工程所有文件的编译顺序 ...
- Linux中硬链接和软链接的区别
看了这篇文章之后,豁然开朗.直接放链接,感谢作者的分享. https://www.ibm.com/developerworks/cn/linux/l-cn-hardandsymb-links/#ico ...
- ASCII, Unicode, UTF-8, 8进制, 16进制等各种编码学习理解笔记
字符编码的发展历史 Unicode和UTF-8有何区别? 在这个问题下的于洋的最高票回答中,比较完整地介绍了字符编码的发展历史,为了便于记忆,再次简要概括一番. 一个字节:最初一个字节的标准是混乱的, ...
- 前端面试题---vue部分
1.vue的两大核心思想 组件化和数据驱动 2.如何理解vue中的MVVM模式 Model-View-ViewModel(简称为mvvm)是一种设计思想,model层代表数据模型,也可以再model中 ...
- 《Linux就该这么学》第十一天课程
防火墙常用的一些命令参数 原创地址:https://www.linuxprobe.com/chapter-08.html firewalld中常用的区域名称及策略规则 区域 默认规则策略 trust ...