<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>GDB on luanrz's blog</title><link>https://luanrz.github.io/tags/gdb/</link><description>Recent content in GDB on luanrz's blog</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Fri, 02 Apr 2021 09:50:12 +0800</lastBuildDate><atom:link href="https://luanrz.github.io/tags/gdb/index.xml" rel="self" type="application/rss+xml"/><item><title>命令备忘录：GDB</title><link>https://luanrz.github.io/%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7/%E5%91%BD%E4%BB%A4%E5%A4%87%E5%BF%98%E5%BD%95gdb/</link><pubDate>Fri, 02 Apr 2021 09:50:12 +0800</pubDate><guid>https://luanrz.github.io/%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7/%E5%91%BD%E4%BB%A4%E5%A4%87%E5%BF%98%E5%BD%95gdb/</guid><description>&lt;h2 id="编译"&gt;编译&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;gcc Hello.cpp&lt;/code&gt; 生成可执行文件a.out&lt;/p&gt;
&lt;p&gt;&lt;code&gt;gcc -o Hello.o Hello.cpp&lt;/code&gt; 生成可执行文件Hello.o&lt;/p&gt;
&lt;p&gt;&lt;code&gt;gcc -g -o Hello.o Hello.cpp&lt;/code&gt; 生成可调试的可执行文件Hello.o&lt;/p&gt;
&lt;h2 id="调试"&gt;调试&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;gdb Hello.o&lt;/code&gt;&lt;/p&gt;
&lt;h2 id="常用gdb命令"&gt;常用GDB命令&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;break&lt;/code&gt; ：新增断点。后接一个参数，表示在指定位置增加断点，参数格式为：[源文件名:]&amp;lt;方法名&amp;gt; | [源文件名:]&amp;lt;行数&amp;gt;&lt;/p&gt;</description></item></channel></rss>