"Gdb"의 두 판 사이의 차이

ph
이동: 둘러보기, 검색
잔글
잔글
2번째 줄: 2번째 줄:
 
* [http://www.cs.cmu.edu/~gilpin/tutorial/ gdb simple tutorial]
 
* [http://www.cs.cmu.edu/~gilpin/tutorial/ gdb simple tutorial]
 
* '''[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])
 +
<table border cellpadding=3>
 +
<tr>
 +
<th>Gdb Command</th><th>Description</th>
 +
</tr>
 +
<tr>
 +
<td>set listsize <em>n</em></td>
 +
<td>Set the number of lines listed by the list command to <em>n</em> <span class="code2">[set listsize]</span></td>
 +
</tr>
 +
<tr>
 +
<td>b <em>function</em></td>
 +
<td>Set a breakpoint at the beginning of <em>function</em> <span class="code2">[break]</span></td>
 +
</tr>
 +
 +
<tr>
 +
<td>b <em>line number</em></td>
 +
<td>Set a breakpoint at <em>line number</em> of the current file. <span class="code2">[break]</span></td>
 +
</tr>
 +
 +
<tr>
 +
<td>info b</td>
 +
<td>List all breakpoints <span class="code2">[info]</span></td>
 +
</tr>
 +
 +
<tr>
 +
<td>delete <em>n</em></td>
 +
<td>Delete breakpoint number <em>n</em> <span class="code2">[delete]</span></td>
 +
</tr>
 +
 +
<tr>
 +
<td>
 +
r <em>args</em>
 +
</td>
 +
<td> Start the program being debugged, possibly with  command line arguments <em>args</em>. <span class="code2">[run]</span> </td>
 +
</tr>
 +
 +
<tr>
 +
<td>
 +
s <em>count</em>
 +
</td>
 +
<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>
 +
</tr>
 +
 +
<tr>
 +
<td>
 +
n <em>count</em>
 +
</td>
 +
<td>Single step the next <em>count</em> statments (default is 1). Step
 +
<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년 4월 30일 (토) 22:52 판

Gdb CommandDescription
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_topichelp or help on optional_topic [help]
qquit gdb [quit]