GDB cheat sheet

后端 未结 6 1304
别跟我提以往
别跟我提以往 2021-01-30 03:38

Can anyone recommend a good cheat sheet for gbd? I\'m experienced with windbg commands, I\'m looking for gdb equivalents for lml (list loaded modules), ~*k (all threads stack),

6条回答
  •  甜味超标
    2021-01-30 04:00

      +===========+===========+=========+============+==============+========+====+======+=====+======+=======+
      |Feature    |Description|vc       |dbx         |gdb           |windbg  |ntsd|edebug|perld|i386kd|wdeb386|
      +===========+===========+=========+============+==============+========+====+======+=====+======+=======+
      |Lang       |-          |c        |c           |c             |c       |c   |elisp |perl |c     |c      |
      |OS         |-          |win      |unix        |unix etc      |win     |win |all   |all  |win   |win    |
      |GUI        |-          |Y        |N           |N             |Y       |N   |emacs |N    |N     |N      |
      |Alt GUI    |-          |N        |emacs ffffd   |emacs         |N       |N   |N     |ffffd  |N     |N      |
      |Vendor GUI |-          |Y        |Sun/workshop|HP/wdbg       |Y       |N   |emacs |N    |N     |N      |
      |Cmdline    |-          |No No    |Y           |Y             |Y       |Y   |-     |Y    |Y     |Y      |
      |Alias      |-          |keymapper|alias/define|command       |N       |ini |Y     +=    |N     |N      |
      |Completion |      |-        |Y           |YY            |N       |N   |YY    |-    |N     |N      |
      |Script     |script     |VbPerlOle|ksh         |Y             |dll     |dll |Y     |Y    |${}|      |       |
      |History    |cmd history|N        |Y           |Y             |Y       |Y   |Y     |!    |Y     |Y      |
      |Init       |setup      |regedit  |.dbxrc      |.gdbinit      |regedit |ini |.emacs|-    |ENV   |-      |
      |Options    |config     |regedit  |dbxenv      |set           |        |    |      |O    |      |       |
      |Help       |?          |msdn     |help        |i   info      |? .hlp  |?   |info  |h pod|? msdn|? msnd |
      +===========+===========+=========+============+==============+========+====+======+=====+======+=======+
      |bp         |break      |F9       |stop at     |b             |bp      |bp  |-     |-    |bp    |bp     |
      |ba         |hardware   |A-F9     |stop access |hbreak/b *addr|br      |ba  |-     |N    |ba    |br     |
      |bl handlers|list stops |A-F9     |status      |i b           |-       |-   |l     |L    |bl    |-      |
      |bd         |delete     |F9       |delete N    |delete break N|-       |-   |u     |d D  |-     |-      |
      |bc clear   |del current|C-F9     |clear       |clear         |-       |-   |-     |-    |bc    |-      |
      |bp once    |break once |F9 F5 F9 |stop -temp  |tbreak        |-       |-   |-     |c .. |-     |-      |
      |be on      |enable     |C-F9     |-           |enable        |-       |-   |-     |-    |be    |-      |
      |bd off     |disable    |C-F9     | -disable   |disable       |-       |-   |-     |-    |bd    |-      |
      |bp if      |conditional|C-F9     |cond -if    |condition     |J       |-   |-     |-    |J     |-      |
      |bp --k==0  |count to bp|C-F9     |-count k    |ignore .. k   |J       |-   |-     |-    |J     |-      |
      |bp do act  |action on b|N        |when..{..}  |command ...   |J       |-   |-     |-    |J     |-      |
      +===========+===========+=========+============+==============+========+====+======+=====+======+=======+
      |unassemble |disassemble|C-F11/A-8|dis   $pc   |disassem addr |u       |-   |-     |-    |U     |-      |
      |bt         |backtrace  |A-7      |where       |bt            |kd kb kd|-   |-     |T    |~k ln |-      |
      |frame      |           |A-7      |frame       |up/down       |-       |-   |-     |-    |-     |-      |
      |Locals vars|-          |A-4      |dump        |-             |-       |-   |-     |V    |-     |-      |
      |regs       |registers  |A-5      |regs -F     |info regs     |-       |#R  |-     |-    |-     |-      |
      |Expr       |eval expr  |F8       |print       |print         |?expr   |-   |e/R   |x m p|?expr |-      |
      |Change var |           |F8       |p x=y       |p x=y         |-       |-   |-     +=    |E F   |-      |
      |trace      |single step|VC       |trace       |trace         |-       |-   |-     |t    |tr    |-      |
      |Examine Mem|-          |A-6      |x addr/fmt  |x/fmt addr    |dw db dc|-   |-     |-    |D     |-      |
      |Threads    |-          |A-6      |-           |-             |-       |~*KB|-     |-    |~     |-      |
      |symbols    |-          |-        |-           |i             |-       |X   |C-h   |-    |X     |-      |
      |watch      |-          |A-3      |display     |-             |-       |-   |-     |w    |-     |-      |
      |typeof     |           |         |whatis -t   |ptype         |-       |-   |-     |-    |-     |-      |
      +===========+===========+=========+============+==============+========+====+======+=====+======+=======+
      |Exe        |-          |Menu     |debug a.out |file a.out    |-       |-   |-     |-    |ini   |win.com|
      |args       |-          |Menu     |runargs     |set args      |Menu    |cmd |-     |cmd  |Kernel|Kernel |
      |src        |-          |vc pdb   |dir ~/src   |pathmap ~/src |-       |-   |-     |-    |-     |-      |
      |Edit       |-          |builtin  |list        |list          |-       |-   |-     |-    |-     |-      |
      |start      |-          |C-S-F5   |run [args]  |run           |G       |-   |-     |-    |G     |-      |
      |continue   |go         |F5       |cont        |continue      |-       |-   |c     |c    |-     |-      |
      |step into  |-          |F11      |step        |step          |T       |-   |d     |s    |T     |-      |
      |stepi      |instruction|-        |stepi       |stepi         |-       |-   |-     |-    |J     |-      |
      |step over  |-          |F10      |next        |next          |P       |-   |-     |n    |P     |-      |
      |step if    |-          |-        |-           |-             |-       |-   |-     |-    |J     |-      |
      +===========+===========+=========+============+==============+========+====+======+=====+======+=======+
      |finish     |till return|F12      |step up     |finish        |-       |-   |r     |r    |-     |-      |
      |until      |till cursor|F6       | -temp;cont |until         |-       |-   |bc    |-    |-     |-      |
      |jump       |-          |F2       |cont at     |jump          |-       |-   |-     |-    |-     |-      |
      |pop        |return now |\jump    |pop         |return        |-       |-   |-     |r    |-     |-      |
      |repeat     |redo       |-        |!!          |          |-       |-   |-     | |-     |-      |
      |quit       |-          |MENU     |quit        |q             |q       |q   |q C-] |-    |q     |q      |
      +===========+===========+=========+============+==============+========+====+======+=====+======+=======+
      |Feature    |Desc       |vc       |dbx         |gdb           |windbg  |ntsd|edebug|perld|i386kd|wdeb386|
      +===========+===========+=========+============+==============+========+====+======+=====+======+=======+  
    

提交回复
热议问题