Feuille de triche GDB

Quelqu'un peut-il recommander une bonne feuille de triche pour gbd? Je suis expérimenté avec les commandes windbg, je cherche des équivalents gdb pour lml (liste des modules chargés), ~*k (pile de tous les threads), ba (pause sur l'accès), dt (type de vidage), DV (variables de trame de vidage), sxe (configurer le gestionnaire SEH) etc. Je comprends qu'il n'y aura pas d'équivalent 1 à 1, mais j'ai juste besoin d'un résumé condensé des commandes les plus utilisées/utiles.

30
demandé sur Remus Rusanu 2009-05-17 22:52:14

6 réponses

J'utilise celui-ci personnellement: feuille de triche de gdb ou ce lien n'est pas encore cassé .. . J'ai imprimé à l'œuvre.

42
répondu yves Baumes 2012-01-09 16:09:35
  +========================+==============================+=============================+
  |GDB                     | DBX                          | WINDOWS  ntsd,wdeb386,windbg|
  +========================+==============================+=============================+
  |break line              | stop at line                 |                          F9 |
  |break func              | stop in func                 |bp func                 A-F9 |
  |break *addr             | stopi at addr                |br,ba                   A-F9 |
  |break ... if expr       | stop ... -if expr            |bp f "j cond 'r';'g'"   A-F9 |
  |cond n                  | stop ... -if expr            |                             |
  |tbreak                  | stop ... -temp               |bp f "bc"           F9 F5 F9 |
  |watch expr              | stop expr [slow]             |                             |
  |watch var               | stop modify &var [fast]      |                             |
  |                        | stop change var              |                        A-F9 |
  |catch x                 | intercept x                  |                             |
  |info break              | status                       |bl                      A-F9 |
  |info watch              | status                       |                             |
  |clear                   | clear                        |                             |
  |clear fun               | delete n                     |bc                           |
  |delete                  | delete all                   |bc *                    A-F9 |
  |disable                 | handler -disable all         |bd *                    C-F9 |
  |disable n               | handler -disable n           |                             |
  |enable                  | handler -enable all          |be                           |
  |enable n                | handler -enable n            |                             |
  |ignore n cnt            | handler -count n cnt         |bp n cnt                A-F9 |
  +========================+==============================+=============================+
  |set args                | runargs                      |                         A-F7|
  |run                     | run args                     |g                      C-S-F5|
  |continue                | cont                         |g (go)                   F5  |
  |stepi                   | stepi                        |t                            |
  |step                    | step                         |                         F11 |
  |next                    | next                         |p                        F10 |
  |jump line               | cont at line                 |p =addr / g =addr     R-Mouse|
  |finish                  | step up                      |bp retaddr+4             F12 |
  |return (now)            | pop                          |g =retaddr                   |
  |until line              | stop at line -temp;cont      |bp func;g                    |
  |C-j                     | !!                           |<CR> (repeat)                |
  +========================+==============================+=============================+
  |commands n              | when ... { cmds; }           |bp n "cmds"                  |
  |backtrace n             | where n                      |kb ks kv                     |
  |frame n                 | frame n                      |                             |
  |info reg reg            | print $reg                   |r                            |
  |signal num              | cont sig num                 |                             |
  |set var=expr            | assign var=expr              |e (enter bytes),f (fill)     |
  |x/fmt addr              | x addr/fmt                   |d[abcw] addr (display)    A-6|
  |disassem addr           | dis addr                     |u                   C-F11,A-8|
  |shell cmd               | sh cmd [if needed]           |                             |
  |info func regex         | funcs regexp                 |X (ntsd)                     |
  |ptype type              | whatis -t type               |                             |
  |define cmd              | function cmd                 |zs,zl,zd (default cmd)       |
  |handle sig              | stop sig sig                 |                             |
  |info signals            | status; catch                |di (display IDT)             |
  |attach pid              | debug - pid                  |                             |
  |attach pid              | debug a.out pid              |                             |
  |file file               | [unnecessary]                |                             |
  |exec file               | debug file                   |                             |
  |core file               | debug a.out corefile         |                             |
  |set editing on          | set -o emacs                 |                             |
  |set language x          | language x                   |                             |
  |set prompt x            | PS1=x                        |                             |
  |set history size x      | HISTSIZE=x                   |                             |
  |set print object on     | dbxenv output_dynamic_type on|                             |
  |show commands           | history                      |                             |
  |dir name                | pathmap name                 |                             |
  |show dir                | pathmap                      |lm                           |
  |info line <n            | listi n                      |                             |
  |info source             | file                         |ln                           |
  |info sources            | files; modules               |                             |
  |forw regex              | search regexp                |lse regexp                   |
  |rev regex               | bsearch regexp               |                             |
  |.gdbinit                | .dbxrc (was .dbxinit)        |                             |
  |q                       | quit                         |q                            |
  +========================+==============================+=============================+
4
répondu mosh 2013-02-04 03:44:40
  +===========+===========+=========+============+==============+========+====+======+=====+======+=======+
  |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 ddd   |emacs         |N       |N   |N     |ddd  |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 |<TAB>      |-        |Y           |YY            |N       |N   |YY    |-    |N     |N      |
  |Script     |script     |VbPerlOle|ksh         |Y             |dll     |dll |Y     |Y    |$<file|dll    |
  |Actions    |When .. do |         |when        |              |        |    |      |a<>{}|      |       |
  |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       |-        |!!          |<CR>          |-       |-   |-     |<CR> |-     |-      |
  |quit       |-          |MENU     |quit        |q             |q       |q   |q C-] |-    |q     |q      |
  +===========+===========+=========+============+==============+========+====+======+=====+======+=======+
  |Feature    |Desc       |vc       |dbx         |gdb           |windbg  |ntsd|edebug|perld|i386kd|wdeb386|
  +===========+===========+=========+============+==============+========+====+======+=====+======+=======+  
0
répondu mosh 2013-02-04 03:49:00

Voici une feuille de triche de débogage multi-plateforme très simple que j'utilise (et que j'ai créée). http://mohit.io/blog/cross-platform-debugging-cheat-sheet/ J'espère que vous trouverez les commandes windbg -> gdb requises.

0
répondu mohit 2013-09-30 02:55:35

Deux liens de Google où j'ai rapidement trouvé des choses réellement utiles que je ne pouvais pas trouver dans les liens d'autres réponses:

0
répondu akavel 2013-10-15 08:50:35