﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-。。。。。。。。。。-随笔分类-c++ 编译 调试 开发环境</title><link>http://www.cppblog.com/loky/category/9072.html</link><description /><language>zh-cn</language><lastBuildDate>Sun, 28 Dec 2008 01:41:35 GMT</lastBuildDate><pubDate>Sun, 28 Dec 2008 01:41:35 GMT</pubDate><ttl>60</ttl><item><title> g++ 常用编译选项</title><link>http://www.cppblog.com/loky/archive/2008/12/27/70480.html</link><dc:creator>。。。。</dc:creator><author>。。。。</author><pubDate>Fri, 26 Dec 2008 16:36:00 GMT</pubDate><guid>http://www.cppblog.com/loky/archive/2008/12/27/70480.html</guid><wfw:comment>http://www.cppblog.com/loky/comments/70480.html</wfw:comment><comments>http://www.cppblog.com/loky/archive/2008/12/27/70480.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/loky/comments/commentRss/70480.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/loky/services/trackbacks/70480.html</trackback:ping><description><![CDATA[<table style="border-collapse: collapse;" width="760" align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0">
    <tbody>
        <tr>
            <td align="center" height="30"><font style="font-size: 14pt;" color="#02368d"><strong>gcc g++ 常用编译选项</strong></font><br>
            </td>
        </tr>
        <tr>
            <td align="center" height="9"><img src="http://blog.chinaunix.net/templates/default/images/right_line.gif" alt="" width="502" border="0" height="9"></td>
        </tr>
        <tr>
            <td align="center">
            <table style="border-collapse: collapse;" width="740" border="0" cellpadding="0" cellspacing="0">
                <tbody>
                    <tr>
                        <td width="740">
                        <div id="art" width="560" style="margin: 15px;">
                        <div style="text-align: center;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  <font size="4">Linux中gcc，g++常用编译选项</font><br></div>
                        <font style="color: #000166;" size="2">-x language filename <br>
                        设定文件所使用的语言,使后缀名无效,对以后的多个有效.也就是根据约定，C语言的后缀名称是.c的，而C++的后缀名是.C或者.cpp,如果你很个
                        性，决定你的C代码文件的后缀名是.pig
                        哈哈，那你就要用这个参数,这个参数对他后面的文件名都起作用，除非到了下一个参数的使用。可以使用的参数有下面的这些： <br>　　`c', `objective-c', `c-header', `c++', `cpp-output', `assembler', and `a <br>ssembler-with-cpp'. <br>　　看到英文，应该可以理解的。<br>&nbsp;<br>　　例子用法: cd..<br></font>　　gcc -x c hello.pig <br>
                        <p style="color: #000166;"><font size="2">-x none filename <br>　　关掉上一个<a name="baidusnap4"></a>
                        <p style="color: #000166;"><font size="2">/* 注释中的不常用****************************************************<br></font></p>
                        <p style="color: #000166;"><font size="2">-fno-asm <br>　　此选项实现ansi</font><font size="2">选项</font><font size="2">的功能的一部分，它禁止将asm,inline和typeof用作关键字。 <br>　　　　 <br>-fno-strict-prototype <br>　　只对g＋＋起作用,使用这个</font><font size="2">选项</font><font size="2">,g++将对不带参数的函数,都认为是没有显式的对参数的个数和类型说明,而不是没有参数. <br>　　而gcc无论是否使用这个参数,都将对没有带参数的函数,认为没有显式说明的类型 </font></p>
                        <p style="color: #000166;"><font size="2">　　 <br>-fthis-is-varialble <br>　　就是向传统c++看齐,可以使用this当一般变量使用. <br>　　 <br>-fcond-mismatch <br>　　允许条件表达式的第二和第三参数类型不匹配,表达式的值将为void类型 <br>　　 <br>-funsigned-char <br>-fno-signed-char <br>-fsigned-char <br>-fno-unsigned-char <br>　　这四个参数是对char类型进行设置,决定将char类型设置成unsigned char(前两个参 <br>数)或者 signed char(后两个参数) <br></font></p>
                        <p style="color: #000166;"><font size="2">*注释完成*********************************************/　　 <br></font></p>
                        <p style="color: #000166;"><font size="2">-include file <br>　　包含某个代码,简单来说,就是便于某个文件需要另一个文件的时候,就可以用它设 <br>定,功能就相当于在代码中使用＃i nclude&lt;filename&gt; <br>　　例子用法: <br>　　gcc hello.c -include /root/pianopan.h <br>　　 <br>-imacros file <br>　　将file文件的宏,扩展到gcc/<strong style="background-color: #ffff66;">g++</strong>的输入文件,宏定义本身并不出现在输入文件中 <br>　　 <br>-Dmacro <br>　　相当于C语言中的#define macro <br>　　 <br>-Dmacro=defn <br>　　相当于C语言中的#define macro=defn <br>　　 <br>-Umacro <br>　　相当于C语言中的#undef macro <br>-undef <br>　　取消对任何非标准宏的定义 <br>　　 <br>-Idir <br>　　在你是用＃i nclude"file"的时候,gcc/<strong style="background-color: #ffff66;">g++</strong>会先在当前目录查找你所制定的头文件,如 <br>果没有找到,他回到缺省的头文件目录找,如果使用-I制定了目录,他 <br>　　回先在你所制定的目录查找,然后再按常规的顺序去找. <br>　　对于＃i nclude&lt;file&gt;,gcc/<strong style="background-color: #ffff66;">g++</strong>会到-I制定的目录查找,查找不到,然后将到系统的缺 <br>省的头文件目录查找 <br>　　 <br>-I- <br>　　就是取消前一个参数的功能,所以一般在-Idir之后使用 <br>　　 <br>-idirafter dir <br>　　在-I的目录里面查找失败,讲到这个目录里面查找. <br>　　 <br>-iprefix prefix <br>-iwithprefix dir <br>　　一般一起使用,当-I的目录查找失败,会到prefix+dir下查找 <br>　　 <br>-nostdinc <br>　　使编译器不再系统缺省的头文件目录里面找头文件,一般和-I联合使用,明确限定头 <br>文件的位置 <br>　　 <br>-nostdin C++ <br>　　规定不在<strong style="background-color: #ffff66;">g++</strong>指定的标准路经中搜索,但仍在其他路径中搜索,.此<strong style="background-color: #ff66ff;">选项</strong>在创libg++库 <br>使用 <br>　　 <br>-C <br>　　在预处理的时候,不删除注释信息,一般和-E使用,有时候分析程序，用这个很方便的 </font></p>
                        <font style="color: #000166;" size="2"><br>-M <br>　　生成文件关联的信息。包含目标文件所依赖的所有源代码你可以用gcc -M hello.c <br>来测试一下，很简单。 <br>　　 <br>-MM <br>　　和上面的那个一样，但是它将忽略由＃i nclude&lt;file&gt;造成的依赖关系。 <br>　　 <br>-MD <br>　　和-M相同，但是输出将导入到.d的文件里面 <br>　　 <br>-MMD <br>　　和-MM相同，但是输出将导入到.d的文件里面 <br>　　 <br>-Wa,option <br>　　此<strong style="background-color: #ff66ff;">选项</strong>传递option给汇编程序;如果option中间有逗号,就将option分成多个<strong style="background-color: #ff66ff;">选项</strong>,然 <br>后传递给会汇编程序 <br>　　 <br>-Wl.option <br>　　此<strong style="background-color: #ff66ff;">选项</strong>传递option给连接程序;如果option中间有逗号,就将option分成多个<strong style="background-color: #ff66ff;">选项</strong>,然 <br>后传递给会连接程序. <br>　　 <br>-llibrary <br>　　制定编译的时候使用的库 <br>　　例子用法 <br>　　gcc -lcurses hello.c <br>　　使用ncurses库编译程序 <br>　　 <br>-Ldir <br>　　制定编译的时候，搜索库的路径。比如你自己的库，可以用它制定目录，不然 <br>　　编译器将只在标准库的目录找。这个dir就是目录的名称。 <br>　　 <br>-O0 <br>-O1 <br>-O2 <br>-O3 <br>　　编译器的优化<strong style="background-color: #ff66ff;">选项</strong>的4个级别，-O0表示没有优化,-O1为缺省值，-O3优化级别最高　 <br>　 　　 <br>-g <br>　　只是编译器，在编译的时候，产生调试信息。 <br>　　 <br>-gstabs <br>　　此<strong style="background-color: #ff66ff;">选项</strong>以stabs格式声称调试信息,但是不包括gdb调试信息. <br>　　 <br>-gstabs+ <br>　　此<strong style="background-color: #ff66ff;">选项</strong>以stabs格式声称调试信息,并且包含仅供gdb使用的额外调试信息. <br>　　 <br>-ggdb <br>　　此<strong style="background-color: #ff66ff;">选项</strong>将尽可能的生成gdb的可以使用的调试信息. <br>-static <br>　　此<strong style="background-color: #ff66ff;">选项</strong>将禁止使用动态库，所以，编译出来的东西，一般都很大，也不需要什么 <br>动态连接库，就可以运行. <br>-share <br>　　此<strong style="background-color: #ff66ff;">选项</strong>将尽量使用动态库，所以生成文件比较小，但是需要系统由动态库. <br>-traditional <br>　　试图让编译器支持传统的C语言特性</font>
                        </div>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
<br><img src ="http://www.cppblog.com/loky/aggbug/70480.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/loky/" target="_blank">。。。。</a> 2008-12-27 00:36 <a href="http://www.cppblog.com/loky/archive/2008/12/27/70480.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>浅析Linux下core文件 </title><link>http://www.cppblog.com/loky/archive/2008/12/10/69106.html</link><dc:creator>。。。。</dc:creator><author>。。。。</author><pubDate>Wed, 10 Dec 2008 13:23:00 GMT</pubDate><guid>http://www.cppblog.com/loky/archive/2008/12/10/69106.html</guid><wfw:comment>http://www.cppblog.com/loky/comments/69106.html</wfw:comment><comments>http://www.cppblog.com/loky/archive/2008/12/10/69106.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/loky/comments/commentRss/69106.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/loky/services/trackbacks/69106.html</trackback:ping><description><![CDATA[<p><font size="2">当我们的程序崩溃时，内核有可能把该程序当前内存映射到core文件里，方便程序员找到程序出现问题的地方。最常出
现的，几乎所有C程序员都出现过的错误就是&#8220;段错误&#8221;了。也是最难查出问题原因的一个错误。下面我们就针对&#8220;段错误&#8221;来分析core文件的产生、以及我们
如何利用core文件找到出现崩溃的地方。</font></p>
<p><a name="何谓core文件"><strong><font size="2">何谓core文件</font></strong></a></p>
<p><font size="2">当一个程序崩溃时，在进程当前工作目录的core文件中复制了该进程的存储图像。<font face="Times New Roman">core</font>文件仅仅是一个内存映象<font face="Times New Roman">(</font>同时加上调试信息<font face="Times New Roman">)</font>，主要是用来调试的。</font></p>
<p><font size="2">当程序接收到以下UNIX信号会产生core文件：</font></p>
<table border="1" cellpadding="0" cellspacing="0">
    <tbody>
        <tr>
            <td valign="top">
            <p><font size="2">名字</font></p>
            </td>
            <td valign="top">
            <p><font size="2">说明</font></p>
            </td>
            <td valign="top">
            <p><font size="2">ANSI C&nbsp; POSIX.1</font></p>
            </td>
            <td valign="top">
            <p><font size="2">SVR4&nbsp; 4.3+BSD</font></p>
            </td>
            <td valign="top">
            <p><font size="2">缺省动作</font></p>
            </td>
        </tr>
        <tr>
            <td valign="top">
            <p><font size="2">SIGABRT</font></p>
            </td>
            <td valign="top">
            <p><font size="2">异常终止(abort)</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">终止w/core</font></p>
            </td>
        </tr>
        <tr>
            <td valign="top">
            <p><font size="2">SIGBUS</font></p>
            </td>
            <td valign="top">
            <p><font size="2">硬件故障</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">终止w/core</font></p>
            </td>
        </tr>
        <tr>
            <td valign="top">
            <p><font size="2">SIGEMT</font></p>
            </td>
            <td valign="top">
            <p><font size="2">硬件故障</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp;</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">终止w/core</font></p>
            </td>
        </tr>
        <tr>
            <td valign="top">
            <p><font size="2">SIGFPE</font></p>
            </td>
            <td valign="top">
            <p><font size="2">算术异常</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . </font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">终止w/core</font></p>
            </td>
        </tr>
        <tr>
            <td valign="top">
            <p><font size="2">SIGILL</font></p>
            </td>
            <td valign="top">
            <p><font size="2">非法硬件指令</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">终止w/core</font></p>
            </td>
        </tr>
        <tr>
            <td valign="top">
            <p><font size="2">SIGIOT</font></p>
            </td>
            <td valign="top">
            <p><font size="2">硬件故障</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp;</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">终止w/core</font></p>
            </td>
        </tr>
        <tr>
            <td valign="top">
            <p><font size="2">SIGQUIT</font></p>
            </td>
            <td valign="top">
            <p><font size="2">终端退出符</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">终止w/core</font></p>
            </td>
        </tr>
        <tr>
            <td valign="top">
            <p><font size="2">SIGSEGV</font></p>
            </td>
            <td valign="top">
            <p><font size="2">无效存储访问</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">终止w/core</font></p>
            </td>
        </tr>
        <tr>
            <td valign="top">
            <p><font size="2">SIGSYS</font></p>
            </td>
            <td valign="top">
            <p><font size="2">无效系统调用</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp;</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">终止w/core</font></p>
            </td>
        </tr>
        <tr>
            <td valign="top">
            <p><font size="2">SIGTRAP</font></p>
            </td>
            <td valign="top">
            <p><font size="2">硬件故障</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp;</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">终止w/core</font></p>
            </td>
        </tr>
        <tr>
            <td valign="top">
            <p><font size="2">SIGXCPU</font></p>
            </td>
            <td valign="top">
            <p><font size="2">超过CPU限制(setrlimit)</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp;</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">终止w/core</font></p>
            </td>
        </tr>
        <tr>
            <td valign="top">
            <p><font size="2">SIGXFSZ</font></p>
            </td>
            <td valign="top">
            <p><font size="2">超过文件长度限制(setrlimit)</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp;</font></p>
            </td>
            <td valign="top">
            <p><font size="2">&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</font></p>
            </td>
            <td valign="top">
            <p><font size="2">终止w/core</font></p>
            </td>
        </tr>
    </tbody>
</table>
<p><font size="2">在系统默认动作列，&#8220;终止w/core&#8221;表示在进程当前工作目录的core文件中复制了该进程的存储图像（该文件名为core，由此可以看出这种功能很久之前就是UNIX功能的一部分）。大多数UNIX调试程序都使用core文件以检查进程在终止时的状态。</font></p>
<p><font size="2">core文件的产生不是POSIX.1所属部分,而是很多UNIX版本的实现特征。UNIX第6版没有检查条件
(a)和(b)，并且其源代码中包含如下说明：&#8220;如果你正在找寻保护信号，那么当设置-用户-ID命令执行时，将可能产生大量的这种信号&#8221;。4.3 +
BSD产生名为core.prog的文件，其中prog是被执行的程序名的前1 6个字符。它对core文件给予了某种标识，所以是一种改进特征。</font></p>
<p><font size="2">表中&#8220;硬件故障&#8221;对应于实现定义的硬件故障。这些名字中有很多取自UNIX早先在DP-11上的实现。请查看你所使用的系统的手册，以确切地确定这些信号对应于哪些错误类型。</font></p>
<p><font size="2">下面比较详细地说明这些信号。</font></p>
<p><font size="2">&#8226; <strong>SIGABRT</strong> 调用abort函数时产生此信号。进程异常终止。</font></p>
<p><font size="2">&#8226; <strong>SIGBUS</strong> &nbsp;指示一个实现定义的硬件故障。</font></p>
<p><font size="2">&#8226; <strong>SIGEMT</strong> &nbsp;指示一个实现定义的硬件故障。</font></p>
<p><font size="2">EMT这一名字来自PDP-11的emulator trap 指令。</font></p>
<p><font size="2">&#8226; <strong>SIGFPE</strong> &nbsp;此信号表示一个算术运算异常，例如除以0，浮点溢出等。</font></p>
<p><font size="2">&#8226; <strong>SIGILL</strong> &nbsp;此信号指示进程已执行一条非法硬件指令。</font></p>
<p align="left"><font size="2">4.3BSD由abort函数产生此信号。SIGABRT现在被用于此。</font></p>
<p><font size="2">&#8226; <strong>SIGIOT</strong> &nbsp;这指示一个实现定义的硬件故障。</font></p>
<p><font size="2">IOT这个名字来自于PDP-11对于输入／输出TRAP(input/output TRAP)指令的缩写。系统V的早期版本，由abort函数产生此信号。SIGABRT现在被用于此。</font></p>
<p><font size="2">&#8226; <strong>SIGQUIT</strong> 当用户在终端上按退出键（一般采用Ctrl-\）时，产生此信号，并送至前台进</font></p>
<p><font size="2">程组中的所有进程。此信号不仅终止前台进程组（如SIGINT所做的那样），同时产生一个core文件。</font></p>
<p><font size="2">&#8226; <strong>SIGSEGV</strong> 指示进程进行了一次无效的存储访问。</font></p>
<p><font size="2">名字SEGV表示&#8220;段违例（segmentation violation）&#8221;。</font></p>
<p><font size="2">&#8226; <strong>SIGSYS</strong> &nbsp;指示一个无效的系统调用。由于某种未知原因，进程执行了一条系统调用指令，</font></p>
<p><font size="2">但其指示系统调用类型的参数却是无效的。</font></p>
<p><font size="2">&#8226; <strong>SIGTRAP</strong> 指示一个实现定义的硬件故障。</font></p>
<p><font size="2">此信号名来自于PDP-11的TRAP指令。</font></p>
<p><font size="2">&#8226; <strong>SIGXCPU</strong> SVR4和4.3+BSD支持资源限制的概念。如果进程超过了其软C P U时间限制，则产生此信号。</font></p>
<p><font size="2">&#8226; <strong>SIGXFSZ</strong> 如果进程超过了其软文件长度限制，则SVR4和4.3+BSD产生此信号。</font></p>
<p><font size="2">摘自《UNIX环境高级编程》第10章 信号。</font></p>
<p><font size="2">&nbsp;</font></p>
<p><a name="使用core文件调试程序"><strong><font size="2">使用</font></strong></a><font size="2"><strong><font face="Times New Roman">core</font></strong><strong>文件调试程序</strong></font></p>
<p><font size="2">看下面的例子：</font></p>
<p><font size="2" face="Times New Roman">/*core_dump_test.c*/<br></font><font size="2" face="Times New Roman">&nbsp;#include &lt;stdio.h&gt;<br></font><font size="2" face="Times New Roman">const char *str = "test";<br></font><font size="2" face="Times New Roman">void core_test(){<br></font><font size="2" face="Times New Roman">&nbsp;&nbsp;&nbsp; str[1] = 'T';<br></font><font size="2"><font face="Times New Roman">}<br><br></font><font face="Times New Roman">int main()</font></font><font size="2" face="Times New Roman">{<br></font><font size="2" face="Times New Roman">&nbsp;&nbsp;&nbsp; core_test();<br></font><font size="2"><font face="Times New Roman">&nbsp;&nbsp;&nbsp; return 0;<br></font><font face="Times New Roman">}</font></font></p>
<p><font size="2"><strong>编译：<br></strong>gcc <strong> </strong> <font face="Times New Roman">&#8211;g core_dump_test.c -o core_dump_test</font></font></p>
<p><font size="2">如果需要调试程序的话，使用<font face="Times New Roman">gcc</font>编译时加上<font face="Times New Roman">-g</font>选项，这样调试<font face="Times New Roman">core</font>文件的时候比较容易找到错误的地方。</font></p>
<p><strong><font size="2">执行：<br></font></strong><font size="2"><font face="Times New Roman">&nbsp;./core_dump_test<br></font>段错误</font></p>
<p><font size="2">运行<font face="Times New Roman">core_dump_test</font>程序出现了&#8220;段错误&#8221;，但没有产生<font face="Times New Roman">core</font>文件。这是因为系统默认<font face="Times New Roman">core</font>文件的大小为<font face="Times New Roman">0</font>，所以没有创建。可以用<font face="Times New Roman">ulimit</font>命令查看和修改<font face="Times New Roman">core</font>文件的大小。<br><font face="Times New Roman">ulimit -c </font></font><font size="2" face="Times New Roman">0<br></font><font size="2"><font face="Times New Roman">ulimit -c 1000<br></font><font face="Times New Roman">ulimit -c </font><font face="Times New Roman">1000</font></font></p>
<p><font size="2"><font face="Times New Roman">-c </font>指定修改<font face="Times New Roman">core</font>文件的大小，<font face="Times New Roman">1000</font>指定了<font face="Times New Roman">core</font>文件大小。也可以对<font face="Times New Roman">core</font>文件的大小不做限制，如：</font></p>
<p><font size="2"><font face="Times New Roman">ulimit -c unlimited<br></font><font face="Times New Roman">ulimit -c </font><font face="Times New Roman">unlimited</font></font></p>
<p><font size="2">如果想让修改永久生效，则需要修改配置文件，如<font face="Times New Roman"> .bash_profile</font>、<font face="Times New Roman">/etc/profile</font>或<font face="Times New Roman">/etc/security/limits.conf</font>。</font></p>
<p><strong><font size="2">再次执行：<br></font></strong><font size="2"><font face="Times New Roman">./core_dump_test<br></font>段错误</font><font size="2" face="Times New Roman"> (core dumped)<br></font><font size="2"><font face="Times New Roman">ls core.*<br></font><font face="Times New Roman">core.6133</font></font></p>
<p><font size="2">可以看到已经创建了一个<font face="Times New Roman">core.6133</font>的文件<font face="Times New Roman">.6133</font>是<font face="Times New Roman">core_dump_test</font>程序运行的进程<font face="Times New Roman">ID</font>。</font></p>
<p><font size="2"><strong>调式</strong><strong><font face="Times New Roman">core</font></strong></font><font size="2"><strong>文件<br></strong><font face="Times New Roman">core</font>文件是个二进制文件，需要用相应的工具来分析程序崩溃时的内存映像。</font></p>
<p><font size="2" face="Times New Roman">file core.6133</font></p>
<p><font size="2" face="Times New Roman">core.6133: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style, from 'core_dump_test'</font></p>
<p><font size="2">在<font face="Times New Roman">Linux</font>下可以用<font face="Times New Roman">GDB</font>来调试<font face="Times New Roman">core</font>文件。</font></p>
<p><font size="2" face="Times New Roman">gdb core_dump_test core.6133</font></p>
<p><font size="2" face="Times New Roman">GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)<br></font><font size="2" face="Times New Roman">Copyright 2003 Free Software Foundation, Inc.<br></font><font size="2" face="Times New Roman">GDB is free software, covered by the GNU General Public License, and you are<br></font><font size="2" face="Times New Roman">welcome to change it and/or distribute copies of it under certain conditions.<br></font><font size="2" face="Times New Roman">Type "show copying" to see the conditions.<br></font><font size="2" face="Times New Roman">There is absolutely no warranty for GDB.&nbsp; Type "show warranty" for details.<br></font><font size="2" face="Times New Roman">This GDB was configured as "i386-redhat-linux-gnu"...<br></font><font size="2" face="Times New Roman">Core was generated by `./core_dump_test'.<br></font><font size="2" face="Times New Roman">Program terminated with signal 11, Segmentation fault.<br></font><font size="2" face="Times New Roman">Reading symbols from /lib/tls/libc.so.6...done.<br></font><font size="2" face="Times New Roman">Loaded symbols for /lib/tls/libc.so.6<br></font><font size="2" face="Times New Roman">Reading symbols from /lib/ld-linux.so.2...done.<br></font><font size="2" face="Times New Roman">Loaded symbols for /lib/ld-linux.so.2<br></font><font size="2" face="Times New Roman">#0&nbsp; 0x080482fd in core_test () at core_dump_test.c:7<br></font><font size="2" face="Times New Roman">7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str[1] = 'T';<br></font><font size="2" face="Times New Roman">(gdb) where<br></font><font size="2" face="Times New Roman">#0&nbsp; 0x080482fd in core_test () at core_dump_test.c:7<br></font><font size="2"><font face="Times New Roman">#1&nbsp; 0x08048317 in main () at core_dump_test.c:12<br></font><font face="Times New Roman">#2&nbsp; 0x42015574 in __libc_start_main () from /lib/tls/libc.so.6</font></font></p>
<p><font size="2"><font face="Times New Roman">GDB</font>中键入<font face="Times New Roman">where</font>，就会看到程序崩溃时堆栈信息（当前函数之前的所有已调用函数的列表（包括当前函数），<font face="Times New Roman">gdb</font>只显示最近几个），我们很容易找到我们的程序在最后崩溃的时候调用了<font face="Times New Roman">core_dump_test.c </font>第<font face="Times New Roman">7</font>行的代码，导致程序崩溃。注意：在编译程序的时候要加入选项<font face="Times New Roman">-g</font>。您也可以试试其他命令，　如　<font face="Times New Roman">fram</font>、<font face="Times New Roman">list</font>等。更详细的用法，请查阅<font face="Times New Roman">GDB</font>文档。</font></p>
<p><a name="core文件创建在什么位置"><strong><font size="2" face="Times New Roman">core</font></strong></a><font size="2"><strong>文件创建在什么位置</strong></font></p>
<p><font size="2">在进程当前工作目录的下创建。通常与程序在相同的路径下。但如果程序中调用了chdir函数，则有可能改变了当前工
作目录。这时core文件创建在chdir指定的路径下。有好多程序崩溃了，我们却找不到core文件放在什么位置。和chdir函数就有关系。当然程序
崩溃了不一定都产生core文件。</font></p>
<p><a name="什么时候不产生core文件"><strong><font size="2">什么时候不产生core文件</font></strong></a></p>
<p><font size="2">在下列条件下不产生core文件：<br>( a )进程是设置-用户-ID，而且当前用户并非程序文件的所有者；<br>( b )进程是设置-组-ID，而且当前用户并非该程序文件的组所有者；<br>( c )用户没有写当前工作目录的许可权；<br>( d )文件太大。core文件的许可权(假定该文件在此之前并不存在)通常是用户读/写，组读和其他读。</font></p>
<p><font size="2">利用<font face="Times New Roman">GDB</font>调试<font face="Times New Roman">core</font>文件，当遇到程序崩溃时我们不再束手无策。</font></p>
<br><img src ="http://www.cppblog.com/loky/aggbug/69106.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/loky/" target="_blank">。。。。</a> 2008-12-10 21:23 <a href="http://www.cppblog.com/loky/archive/2008/12/10/69106.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>便利的开发编辑工具-vim </title><link>http://www.cppblog.com/loky/archive/2008/12/09/68978.html</link><dc:creator>。。。。</dc:creator><author>。。。。</author><pubDate>Tue, 09 Dec 2008 13:13:00 GMT</pubDate><guid>http://www.cppblog.com/loky/archive/2008/12/09/68978.html</guid><wfw:comment>http://www.cppblog.com/loky/comments/68978.html</wfw:comment><comments>http://www.cppblog.com/loky/archive/2008/12/09/68978.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/loky/comments/commentRss/68978.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/loky/services/trackbacks/68978.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 便利的开发编辑工具-vimmounton @ www.ihere.org ( mount0n@yahoo.com)2003年6月&#160;0. 序言编程人员花费最长时间的开发工具可能就是编辑器了，一个非常方便、高效的编辑器对开发人员来说是非常有效的。在unix/linux下，甚至windows下，vim都可以说是个非常优秀的编辑器。虽然许多朋友开发过程中都在使用vim，但通常...&nbsp;&nbsp;<a href='http://www.cppblog.com/loky/archive/2008/12/09/68978.html'>阅读全文</a><img src ="http://www.cppblog.com/loky/aggbug/68978.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/loky/" target="_blank">。。。。</a> 2008-12-09 21:13 <a href="http://www.cppblog.com/loky/archive/2008/12/09/68978.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用GDB调试程序(8)──查看栈信息 zz</title><link>http://www.cppblog.com/loky/archive/2008/12/09/68977.html</link><dc:creator>。。。。</dc:creator><author>。。。。</author><pubDate>Tue, 09 Dec 2008 13:06:00 GMT</pubDate><guid>http://www.cppblog.com/loky/archive/2008/12/09/68977.html</guid><wfw:comment>http://www.cppblog.com/loky/comments/68977.html</wfw:comment><comments>http://www.cppblog.com/loky/archive/2008/12/09/68977.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/loky/comments/commentRss/68977.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/loky/services/trackbacks/68977.html</trackback:ping><description><![CDATA[<h2 class="cjk">查看栈信息</h2>
<p style="margin-bottom: 0cm;"><font style="font-size: 9pt;" size="2">当程序被停住了，你需要做的第一件事就是查看程序是在哪里停住的。当你的程序调用了一个函数，函数的地址，函数参数，函数内的局部变量都会被压入&#8220;栈&#8221;（</font><font face="文鼎PL简报宋, serif"><font style="font-size: 9pt;" size="2">Stack</font></font><font style="font-size: 9pt;" size="2">）中。你可以用</font><font face="文鼎PL简报宋, serif"><font style="font-size: 9pt;" size="2">GDB</font></font><font style="font-size: 9pt;" size="2">命令来查看当前的栈中的信息。</font></p>
<p style="margin-bottom: 0cm;"><font style="font-size: 9pt;" size="2">下面是一些查看函数调用栈信息的</font><font face="文鼎PL简报宋, serif"><font style="font-size: 9pt;" size="2">GDB</font></font><font style="font-size: 9pt;" size="2">命令：</font></p>
<p style="margin-bottom: 0cm;">&nbsp;&nbsp;&nbsp;  <font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">Backtrace</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">，</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">bt  </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">打印当前的函数调用栈的所有信息。</font></font><font style="font-size: 9pt;" size="2">如：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  </font><font face="文鼎PL简报宋, serif"><font style="font-size: 9pt;" size="2"><br>
</font><font face="Consolas, monospace"><font style="font-size: 9pt;" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  (gdb) bt<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  #0  func (n=250) at tst.c:6<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  #1  0x08048524 in main (argc=1, argv=0xbffff674) at tst.c:30<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  #2  0x400409ed in __libc_start_main () from /lib/libc.so.6</font></font><font style="font-size: 9pt;" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <br>
</font></font><font style="font-size: 9pt;" size="2">从上可以看出函数的调用栈信息：</font><font face="文鼎PL简报宋, serif"><font style="font-size: 9pt;" size="2">__libc_start_main --&gt; main() --&gt; func()&nbsp;&nbsp;&nbsp;  <br>
</font><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">&nbsp;&nbsp;&nbsp;  backtrace &lt;n&gt;</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">， </font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">bt &lt;n&gt;     n</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">是一个正整数，表示只打印栈顶上</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">n</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">层的栈信息。</font></font></p>
<p style="margin-bottom: 0cm;">&nbsp;&nbsp;&nbsp;  <font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">backtrace &lt;-n&gt; </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">，</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">bt &lt;-n&gt;   -n</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">表一个负整数，表示只打印栈底下</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">n</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">层的栈信息。&nbsp;&nbsp;&nbsp;&nbsp;</font></font><font style="font-size: 9pt;" size="2">&nbsp;&nbsp;&nbsp;  </font><font face="文鼎PL简报宋, serif"><font style="font-size: 9pt;" size="2"><br>
</font></font><font style="font-size: 9pt;" size="2">如果你要查看某一层的信息，你需要在切换当前的栈，一般来说，程序停止时，最顶层的栈就是当前栈，如果你要查看栈下面层的详细信息，首先要做的是切换当前栈。</font></p>
<p style="text-indent: 0.48cm; margin-bottom: 0cm;"><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">frame &lt;n&gt;</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">，</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">f &lt;n&gt;   n</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">是一个从</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">0</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">开始的整数，是栈中的层编号。比如：</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">frame 0</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">，表示栈顶，</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">frame 1</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">，表示栈的第二层。</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2"><br>
&nbsp;&nbsp;   up &lt;n&gt;       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">表示向栈的上面移动</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">n</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">层，可以不打</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">n</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">，表示向上移动一层。</font></font></p>
<p style="text-indent: 0.48cm; margin-bottom: 0cm;"><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">down &lt;n&gt;         </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">表示向栈的下面移动</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">n</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">层，可以不打</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">n</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">，表示向下移动一层。 </font></font></p>
<p style="margin-bottom: 0cm;"><font style="font-size: 9pt;" size="2">上面的命令，都会打印出移动到的栈层的信息。如果你不想让其打出信息。你可以使用这三个命令：</font></p>
<p style="margin-bottom: 0cm;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">select-frame &lt;n&gt; </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">对应于 </font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">frame </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">命令。</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; up-silently &lt;n&gt; </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">对应于 </font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">up </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">命令。</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; down-silently &lt;n&gt; </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">对应于 </font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">down </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">命令。</font></font></p>
<p style="margin-bottom: 0cm;"><font style="font-size: 9pt;" size="2">查看当前栈层的信息，你可以用以下</font><font face="文鼎PL简报宋, serif"><font style="font-size: 9pt;" size="2">GDB</font></font><font style="font-size: 9pt;" size="2">命令：</font></p>
<p style="text-indent: 0.4cm; margin-bottom: 0cm;"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">frame </font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">或 </font></font><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  </font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">会打印出这些信息：栈的层编号，当前的函数名，函数参数值，函数所在文件及行号，函数执行到的语句。</font></font></p>
<font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">info frame</font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">，</font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">info f  </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">这个命令会打印出更为详细的当前栈层的信息，只不过，大多数都是运行时的内内地址。比如：函数地址，调用函数的地址，被调用函数的地址，目前的函数是由什么样的程序语言写成的、函数参数地址及值、局部变量的地址等等。</font></font><font style="font-size: 9pt;" size="2">如：</font><font face="文鼎PL简报宋, serif"><font style="font-size: 9pt;" size="2"><br>
</font><font face="Consolas, monospace"><font style="font-size: 9pt;" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    (gdb) info f<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    Stack level 0, frame at 0xbffff5d4:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  eip = 0x804845d in func (tst.c:6); saved eip 0x8048524<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  called by frame at 0xbffff60c<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  source language c.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Arglist at 0xbffff5d4, args: n=250<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Locals at 0xbffff5d4, Previous frame's sp is 0x0<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Saved registers:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  ebp at 0xbffff5d4, eip at 0xbffff5d8</font></font><font style="font-size: 9pt;" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <br>
</font><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2">&nbsp;&nbsp;&nbsp;&nbsp;  info args&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">打印出当前函数的参数名及其值。&nbsp;&nbsp;&nbsp;&nbsp;  </font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2"><br>
&nbsp;&nbsp;&nbsp;&nbsp;  info locals&nbsp;&nbsp;&nbsp;&nbsp;  </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">打印出当前函数中所有局部变量及其值。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  </font></font><font face="文鼎PL简报宋, serif"><font face="Arial, sans-serif"><font style="font-size: 9pt;" size="2"><br>
&nbsp;&nbsp;&nbsp;&nbsp;  info catch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  </font></font></font><font face="楷体_GB2312, monospace"><font style="font-size: 9pt;" size="2">打印出当前的函数中的异常处理信息。</font></font> <img src ="http://www.cppblog.com/loky/aggbug/68977.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/loky/" target="_blank">。。。。</a> 2008-12-09 21:06 <a href="http://www.cppblog.com/loky/archive/2008/12/09/68977.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>