• gdb cheat sheet


    0x00 misc

    命令行参数:

    gdb --args executablename arg1 arg2 arg3

    0x01 控制流

    r        run,运行程序。

    r < a.txt      run,重定向输入

    si         step instruction 进入函数

    ni           next instruction 下一条指令

    finish       执行到函数结束

    0x02 断点

    b        block,下断点

    b *0x0000xx     在指定位置下断点

    b main         在函数入口下断点

    watch *0x00xx    当修改指定内存时中断

    rwatch *0x00xx     当读取指定内存时中断

    info b           查看当前断点

    en 1 2 3       允许中断

    dis 1 2 3         不允许中断

    0x03 内存

    x

    x [Address expression]
    x /[Format] [Address expression]
    x /[Length][Format] [Address expression]

    Address expression
    Specifies the memory address which contents will be displayed. This can be the address itself or any C/C++ expression evaluating to address. The expression can include registers (e.g. $eip) and pseudoregisters (e.g. $pc). If the address expression is not specified, the command will continue displaying memory contents from the address where the previous instance of this command has finished.
    Format
    If specified, allows overriding the output format used by the command. Valid format specifiers are:
    • o - octal
    • x - hexadecimal
    • d - decimal
    • u - unsigned decimal
    • t - binary
    • f - floating point
    • a - address
    • c - char
    • s - string
    • i - instruction

    The following size modifiers are supported:

    • b - byte
    • h - halfword (16-bit value)
    • w - word (32-bit value)
    • g - giant word (64-bit value)

    x /16xb 0x123123

    x /s  0x123123123

    0x04 LOAD信息

    查看加载的段信息

    info files

  • 相关阅读:
    [转]ExtJs 中 xtype 与组件类的对应表
    [转]通过命令行处理图形
    Windows下删除.svn文件夹的最简易方法
    tomcat 设置缓存大小
    二月份的精选奇趣网站(收藏轉)
    stage.focus
    利用键盘按键操控地图
    flash 随机函数
    flash as 3.0 制作一个旋转 影片剪辑
    in关键字的使用
  • 原文地址:https://www.cnblogs.com/helica/p/10791638.html
Copyright © 2020-2023  润新知