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])
<table border cellpadding=3>
{| class="wikitable"
<tr>
|-
<th>Gdb Command</th><th>Description</th>
! Gdb Command !! Description  
</tr>
|-
<tr>
| set listsize <em>n</em>  
<td>set listsize <em>n</em></td>  
| Set the number of lines listed by the list command to <em>n</em> <span class="code2">[set listsize]</span>
<td>Set the number of lines listed by the list command to <em>n</em> <span class="code2">[set listsize]</span></td>
|-
</tr>  
| b <em>function</em>
<tr>
| Set a breakpoint at the beginning of <em>function</em> <span class="code2">[break]</span>  
<td>b <em>function</em></td>  
|-
<td>Set a breakpoint at the beginning of <em>function</em> <span class="code2">[break]</span></td>
| b <em>line number</em>
</tr>
| Set a breakpoint at <em>line number</em> of the current file. <span class="code2">[break]</span>
|-
<tr>
| info b
<td>b <em>line number</em></td>  
| List all breakpoints <span class="code2">[info]</span>
<td>Set a breakpoint at <em>line number</em> of the current file. <span class="code2">[break]</span></td>  
|-
</tr>
| delete <em>n</em>
| Delete breakpoint number <em>n</em> <span class="code2">[delete]</span>
<tr>
|-
<td>info b</td>
| r <em>args</em>  
<td>List all breakpoints <span class="code2">[info]</span></td>
| Start the program being debugged, possibly with  command line arguments <em>args</em>. <span class="code2">[run]</span>
</tr>  
|-
| s <em>count</em>  
<tr>
| Single step the next <em>count</em> statments (default is 1). Step <b><em>into</em></b> functions. <span class="code2">[step]</span>
<td>delete <em>n</em></td>  
|-
<td>Delete breakpoint number <em>n</em> <span class="code2">[delete]</span></td>
| n <em>count</em>  
</tr>  
| Single step the next <em>count</em> statments (default is 1). Step <b><em>over</em></b> functions. <span class="code2">[next]</span>
|-
<tr>
| finish
<td>
| 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>  
|-
</td>
| c
<td> Start the program being debugged, possibly with  command line arguments <em>args</em>. <span class="code2">[run]</span> </td>
| Continue execution up to the next breakpoint or until termination if no breakpoints are encountered. <span class="code2">[continue]</span>
</tr>
|-
| p <em>expression</em>  
<tr>  
| print the value of <em>expression</em> <span class="code2">[print]</span>
<td>
|-
s <em>count</em>  
| l <em>optional_line</em>  
</td>
| 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>
<td>Single step the next <em>count</em> statments (default is 1). Step
|-
<b><em>into</em></b> functions. <span class="code2">[step]</span></td>  
| where
</tr>
| Display the current line and function and the stack of calls that got you there. <span class="code2">[where]</span>
|-
<tr>
| h <em>optional_topic</em>
<td>
| help or help on <em>optional_topic</em> <span class="code2">[help]</span>
n <em>count</em>  
|-
</td>
| q
<td>Single step the next <em>count</em> statments (default is 1). Step
| quit gdb <span class="code2">[quit]</span>
<b><em>over</em></b> functions. <span class="code2">[next]</span></td>
|}
</tr>  
<tr>
<td>finish</td>
<td>
Execute the rest of the current function. Step <b><em>out of</em></b> the
current function. <span class="code2">[finish]</span>  
</td>
</tr>
<tr>
<td>
c
</td>
<td>Continue execution up to the next breakpoint or until termination
if no breakpoints are encountered. <span class="code2">[continue]</span></td>
</tr>
<tr>
<td>p <em>expression</em></td>  
<td>print the value of <em>expression</em> <span class="code2">[print]</span></td>  
</tr>
<tr>
<td>
l <em>optional_line</em>  
</td>
<td>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></td>
</tr>  
<tr>
<td>where</td>
<td>Display the current line and function and the stack of calls that
got you there. <span class="code2">[where]</span></td>  
</tr>
<tr>
<td>h <em>optional_topic</em></td><td>help or help on <em>optional_topic</em> <span class="code2">[help]</span></td>  
</tr>
<tr>
<td>q</td><td>quit gdb <span class="code2">[quit]</span></td>  
</tr>
</table>

2011년 5월 1일 (일) 15:13 판

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]