Gdb: 두 판 사이의 차이
ph
잔글편집 요약 없음 |
편집 요약 없음 |
||
| 3번째 줄: | 3번째 줄: | ||
* '''[http://inside.mines.edu/fs_home/lwiencke/elab/gdb/gdb_toc.html debugging with gdb]''' | * '''[http://inside.mines.edu/fs_home/lwiencke/elab/gdb/gdb_toc.html debugging with gdb]''' | ||
* summary of commands (from [http://condor.depaul.edu/glancast/373class/docs/gdb.html here]) | * summary of commands (from [http://condor.depaul.edu/glancast/373class/docs/gdb.html here]) | ||
{| class="wikitable" | |||
|- | |||
! Gdb Command !! Description | |||
|- | |||
| set listsize <em>n</em> | |||
| Set the number of lines listed by the list command to <em>n</em> <span class="code2">[set listsize]</span> | |||
|- | |||
| b <em>function</em> | |||
| Set a breakpoint at the beginning of <em>function</em> <span class="code2">[break]</span> | |||
|- | |||
| b <em>line number</em> | |||
| Set a breakpoint at <em>line number</em> of the current file. <span class="code2">[break]</span> | |||
|- | |||
| info b | |||
| List all breakpoints <span class="code2">[info]</span> | |||
|- | |||
| delete <em>n</em> | |||
| Delete breakpoint number <em>n</em> <span class="code2">[delete]</span> | |||
|- | |||
| r <em>args</em> | |||
| Start the program being debugged, possibly with command line arguments <em>args</em>. <span class="code2">[run]</span> | |||
|- | |||
| s <em>count</em> | |||
| Single step the next <em>count</em> statments (default is 1). Step <b><em>into</em></b> functions. <span class="code2">[step]</span> | |||
|- | |||
| n <em>count</em> | |||
| Single step the next <em>count</em> statments (default is 1). Step <b><em>over</em></b> functions. <span class="code2">[next]</span> | |||
|- | |||
| finish | |||
| Execute the rest of the current function. Step <b><em>out of</em></b> the current function. <span class="code2">[finish]</span> | |||
r <em>args</em> | |- | ||
| c | |||
| Continue execution up to the next breakpoint or until termination if no breakpoints are encountered. <span class="code2">[continue]</span> | |||
|- | |||
| p <em>expression</em> | |||
| print the value of <em>expression</em> <span class="code2">[print]</span> | |||
|- | |||
s <em>count</em> | | l <em>optional_line</em> | ||
| List next <em>listsize</em> lines. If <em>optional_line</em> is given, list the lines centered around <em>optional_line</em>. <span class="code2">[list]</span> | |||
|- | |||
<b><em>into</em></b> functions. <span class="code2">[step]</span | | where | ||
| Display the current line and function and the stack of calls that got you there. <span class="code2">[where]</span> | |||
|- | |||
| h <em>optional_topic</em> | |||
| help or help on <em>optional_topic</em> <span class="code2">[help]</span> | |||
n <em>count</em> | |- | ||
| q | |||
| quit gdb <span class="code2">[quit]</span> | |||
<b><em>over</em></b> functions. <span class="code2">[next]</span | |} | ||
Execute the rest of the current function. Step <b><em>out of</em></b> the | |||
current function. <span class="code2">[finish]</span> | |||
c | |||
if no breakpoints are encountered. <span class="code2">[continue]</span> | |||
l <em>optional_line</em> | |||
given, list the lines centered around <em>optional_line</em>. <span class="code2">[list]</span | |||
got you there. <span class="code2">[where]</span | |||
2011년 5월 1일 (일) 15:13 판
- gdb tutorial with FAQ
- gdb simple tutorial
- debugging with gdb
- summary of commands (from here)
| Gdb Command | Description |
|---|---|
| set listsize n | Set the number of lines listed by the list command to n [set listsize] |
| b function | Set a breakpoint at the beginning of function [break] |
| b line number | Set a breakpoint at line number of the current file. [break] |
| info b | List all breakpoints [info] |
| delete n | Delete breakpoint number n [delete] |
| r args | Start the program being debugged, possibly with command line arguments args. [run] |
| s count | Single step the next count statments (default is 1). Step into functions. [step] |
| n count | Single step the next count statments (default is 1). Step over functions. [next] |
| finish | Execute the rest of the current function. Step out of the current function. [finish] |
| c | Continue execution up to the next breakpoint or until termination if no breakpoints are encountered. [continue] |
| p expression | print the value of expression [print] |
| l optional_line | List next listsize lines. If optional_line is given, list the lines centered around optional_line. [list] |
| where | Display the current line and function and the stack of calls that got you there. [where] |
| h optional_topic | help or help on optional_topic [help] |
| q | quit gdb [quit] |