zoukankan      html  css  js  c++  java
  • GDB常用功能

    执行时,常用-q去掉copyright等无用信息:

    gdb ./a.out -q

    Command   simple cmd Effect
    Starting and stopping
    quit   q Exit GDB
    run r Run your program(give command line  arguments here)
    kill k stop your program
    set args   before run, set running args
    BreakPoints
    break sum b sum set breakpoint at entry to function sum
    break *0x80483c3 b *0x80483c3 set breakpoint at address 0x80483c3
    delete 1 d 1 delete breakpoint 1
    delete d delete all breakpoint
    Execution
    stepi si execute one instruction
    stepi 4 si 4 execute 4 instructions
    nexti ni Like stepi, but process through function calls
    continue c resume execution
    finish f run until current function returns
    Examining code
    disas   Disassemble current function
    disas sum   Disassemble function sum
    disas 0x80483b7   Disassemble function around address 0x80483b7
    disas 0x80483b7 0x80483c7   Disassemble code within specified address range
    print /x $eip   Print program counter in hex
    Examining data
    print $eax p $eax

    Print contents of %eax in decimal

    print /x $eax  

    Print contents of %eax in hex

    print /t $eax  

    Print contents of %eax in binary

    print 0x100  

    Print decimal representation of 0x100 

    print /x 555

     

    Print hex representation of 555 

    print /x ($ebp+8) 

     

    Print contents of %ebp plus 8 in hex 

    print*(int*)0xbffff890 

     

    Printintegerataddress0xbffff890

    print *(int *) ($ebp+8) 

     

    Print integer at address %ebp + 8

    x/2w 0xbffff890 

     

    Examine two (4-byte) words starting at address 0xbffff890 

    x/20b sum 

     

    Examine first 20 bytes of function sum 

    Useful information
    info frame  

    Information about current stack frame 

    info registers  

    Values of all the registers

  • 相关阅读:
    可汗学院公开课:统计学
    libsvm 之 easy.py(流程化脚本)注释
    机器学习概览
    学习资源
    libsvm-3.21使用文档
    Machine Learning
    Machine Learning
    MySQL 5.7半同步复制after sync和after commit详解【转】
    网站架构设计【转】
    httpd功能配置之虚拟主机【转】
  • 原文地址:https://www.cnblogs.com/qwertwwwe/p/5794969.html
Copyright © 2011-2022 走看看