⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 用gdb调试程序.htm

📁 GDB相关资料,整理的真的很辛苦,希望大家好好珍惜
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">(gdb) n</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">8<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>sum+=i;</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">(gdb) n</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">6<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>for(i=1; i&lt;=n; i++)</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">(gdb) p sum</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">$2 = 1</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">(gdb) n</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">8<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>sum+=i;</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">(gdb) p i</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">$3 = 2</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">(gdb) n</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">6<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>for(i=1; i&lt;=n; i++)</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">(gdb) p sum</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">$4 = 3</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><FONT style="BACKGROUND-COLOR: #cccccc"><SPAN lang=EN-US><FONT face="Courier New">(gdb) bt<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;--------------------- </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">查看函数堆栈。</SPAN></FONT></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">#0<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>func (n=250) at tst.c:5</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">#1<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>0x080484e4 in main () at tst.c:24</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">#2<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>0x400409ed in __libc_start_main () from /lib/libc.so.6</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><FONT style="BACKGROUND-COLOR: #cccccc"><SPAN lang=EN-US><FONT face="Courier New">(gdb) finish<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>&lt;--------------------- </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">退出函数。</SPAN></FONT></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">Run till exit from #0<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>func (n=250) at tst.c:5</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">0x080484e4 in main () at tst.c:24</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">24<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>printf("result[1-250] = %d \n", func(250) );</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">Value returned is $6 = 31375</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><FONT style="BACKGROUND-COLOR: #cccccc"><SPAN lang=EN-US><FONT face="Courier New">(gdb) c<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;--------------------- </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">继续运行。</SPAN></FONT></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">Continuing.</FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><FONT style="BACKGROUND-COLOR: #cccccc"><SPAN lang=EN-US><FONT face="Courier New">result[1-250] = 31375<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>&lt;----------</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">程序输出。</SPAN></FONT></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><FONT style="BACKGROUND-COLOR: #cccccc"><SPAN lang=EN-US><FONT face="Courier New">Program exited with code 027. &lt;--------</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">程序退出,调试结束。</SPAN></FONT></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><FONT style="BACKGROUND-COLOR: #cccccc"><SPAN lang=EN-US><FONT face="Courier New">(gdb) q<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;--------------------- </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">退出</SPAN><SPAN lang=EN-US><FONT face="Courier New">gdb</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">。</SPAN></FONT></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc" face="Courier New">hchen/test&gt;</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">好了,有了以上的感性认识,还是让我们来系统地认识一下</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">gdb</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">吧。</SPAN></FONT></P>
<H1 style="MARGIN: 17pt 0cm 16.5pt 17pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman"><FONT size=5>3、</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN><FONT size=5><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">GDB</FONT></SPAN></FONT></H1>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一般来说</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">GDB</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">主要调试的是</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">C/C++</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的程序。要调试</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">C/C++</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的程序,首先在编译时,我们必须要把调试信息加到可执行文件中。使用编译器(</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">cc/gcc/g++</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">)的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> -g </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">参数可以做到这一点。如:</SPAN></FONT></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc"><FONT face="Courier New"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>&gt; cc -g hello.c -o hello</FONT></FONT></SPAN></P>
<P class=020 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT style="BACKGROUND-COLOR: #cccccc"><FONT face="Courier New"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>&gt; g++ -g hello.cpp -o hello</FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如果没有</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">-g</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,你将看不见程序的函数名、变量名,所代替的全是运行时的内存地址。当你用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">-g</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">把调试信息加入之后,并成功编译目标代码以后,让我们来看看如何用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">gdb</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来调试他。</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">启动</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">GDB</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的方法有以下几种:</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><FONT face="Times New Roman"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US>gdb &lt;program&gt;</SPAN></B><SPAN lang=EN-US> </SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>program</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也就是你的执行文件,一般在当前目录下。</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US><FONT face="Times New Roman">gdb &lt;program&gt; core</FONT></SPAN></B></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><SPAN style="mso-spacerun: yes"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">gdb</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">同时调试一个运行程序和</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">core</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件,</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">core</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是程序非法执行后</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">core dump</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">后产生的文件。</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>3</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US><FONT face="Times New Roman">gdb &lt;program&gt; &lt;PID&gt;</FONT></SPAN></B></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如果你的程序是一个服务程序,那么你可以指定这个服务程序运行时的进程</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">ID</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">gdb</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">会自动</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">attach</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上去,并调试他。</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">program</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应该在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">PATH</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">环境变量中搜索得到。</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><FONT size=3><SPAN lang=EN-US><FONT face="Times New Roman">GDB</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">启动时,可以加上一些</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">GDB</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的启动开关,详细的开关可以用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">gdb -help</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">查看。我在下面只例举一些比较常用的参数:</SPAN></FONT></P>
<DIV align=center>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 480; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellSpacing=0 cellPadding=0 border=1>
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 102.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top width=137>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">-symbols &lt;file&gt; </FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">-s &lt;file&gt; </FONT></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ebebe6; WIDTH: 325.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=434>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从指定文件中读取符号表。</SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 1">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ebebe6; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 102.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=137>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">-se file</FONT></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ebebe6; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ebebe6; WIDTH: 325.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=434>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从指定文件中读取符号表信息,并把他用在可执行文件中。</SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 2">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ebebe6; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 102.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=137>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">-core &lt;file&gt;</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">-c &lt;file&gt;</FONT></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ebebe6; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ebebe6; WIDTH: 325.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=434>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">调试时</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">core dump</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">core</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件。</SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 3; mso-yfti-lastrow: yes">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ebebe6; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 102.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=137>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">-directory &lt;directory&gt;</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">-d &lt;directory&gt;</FONT></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ebebe6; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ebebe6; WIDTH: 325.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=434>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">加入一个源文件的搜索路径。默认搜索路径是环境变量中</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">PATH</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所定义的路径。</SPAN></P></TD></TR></TBODY></TABLE></DIV>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -