<?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 Yu-Cheng's Notes</title><link>https://linkingmon.github.io/blog/tags/gdb/</link><description>Recent content in Gdb on Yu-Cheng's Notes</description><generator>Hugo -- 0.166.0</generator><language>en-us</language><lastBuildDate>Tue, 17 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://linkingmon.github.io/blog/tags/gdb/index.xml" rel="self" type="application/rss+xml"/><item><title>Gdb skills - part 2</title><link>https://linkingmon.github.io/blog/note/gdb2/</link><pubDate>Tue, 17 Mar 2026 00:00:00 +0000</pubDate><guid>https://linkingmon.github.io/blog/note/gdb2/</guid><description>&lt;p&gt;Keep sharing some gdb skills, more advanced.&lt;/p&gt;
&lt;h2 id="xgdb"&gt;x.gdb&lt;/h2&gt;
&lt;p&gt;Writing the gdb commands inside the x.gdb file so that we don&amp;rsquo;t need to spedify the commands every time.&lt;/p&gt;
&lt;h2 id="set-logging-on"&gt;set logging on&lt;/h2&gt;
&lt;p&gt;Usually the gdb outcome would not be stored, we can use &lt;code&gt;set loging on&lt;/code&gt;, then the output would be stored in &lt;code&gt;gdb.txt&lt;/code&gt;, this is useful when we need to print a lot of things, we can print them all in the log, then review the output later, or we can compare log in different runs.&lt;/p&gt;</description></item><item><title>Gdb skills - part 1</title><link>https://linkingmon.github.io/blog/note/gdb/</link><pubDate>Fri, 13 Mar 2026 00:00:00 +0000</pubDate><guid>https://linkingmon.github.io/blog/note/gdb/</guid><description>&lt;p&gt;Today I like to share some gdb skills that I&amp;rsquo;ve learned in the pass few years.&lt;/p&gt;
&lt;h2 id="break"&gt;Break&lt;/h2&gt;
&lt;p&gt;I think the most widely use is the breakpoint.
We can do break in some function (as &lt;code&gt;b funcA&lt;/code&gt;), or break at some line (as &lt;code&gt;b classA.cpp:99&lt;/code&gt;).
Some times adding hte condition for breaking is also useful (as &lt;code&gt;b funcA if cnt == 10&lt;/code&gt;). Also this can ne done by &lt;code&gt;cond&lt;/code&gt;, say this breakpoint is the third, we can do &lt;code&gt;cond 3 cnt ==10&lt;/code&gt;.&lt;/p&gt;</description></item></channel></rss>