<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Debugging Archives - NeuralLantern.com</title>
	<atom:link href="https://www.NeuralLantern.com/category/debugging/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.NeuralLantern.com/category/debugging/</link>
	<description></description>
	<lastBuildDate>Sun, 16 Nov 2025 11:52:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://www.NeuralLantern.com/wp-content/uploads/2025/04/cropped-2025-04-04-Lantern-03-32x32.png</url>
	<title>Debugging Archives - NeuralLantern.com</title>
	<link>https://www.NeuralLantern.com/category/debugging/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>x86-64 Assembly Segfault on printf? Fix Stack Alignment (Yasm + GCC Demo)</title>
		<link>https://www.NeuralLantern.com/x86-64-assembly-segfault-on-printf-fix-stack-alignment-yasm-gcc-demo/</link>
					<comments>https://www.NeuralLantern.com/x86-64-assembly-segfault-on-printf-fix-stack-alignment-yasm-gcc-demo/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Sun, 16 Nov 2025 11:52:51 +0000</pubDate>
				<category><![CDATA[Assembly Language]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[assembly crash]]></category>
		<category><![CDATA[assembly debug]]></category>
		<category><![CDATA[c from assembly]]></category>
		<category><![CDATA[epilogue]]></category>
		<category><![CDATA[function prologue]]></category>
		<category><![CDATA[gcc hybrid]]></category>
		<category><![CDATA[hybrid program]]></category>
		<category><![CDATA[linux assembly]]></category>
		<category><![CDATA[low level programming]]></category>
		<category><![CDATA[printf segfault]]></category>
		<category><![CDATA[push pop]]></category>
		<category><![CDATA[stack alignment]]></category>
		<category><![CDATA[system v abi]]></category>
		<category><![CDATA[x86_64 abi]]></category>
		<category><![CDATA[x86-64 assembly]]></category>
		<category><![CDATA[yasm]]></category>
		<category><![CDATA[yasm printf]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=251</guid>

					<description><![CDATA[<p>x86-64 assembly crashes on printf due to stack alignment. Yasm + GCC hybrid program fixed with push/pop in prologue and epilogue. Live Linux demo.</p>
<p>The post <a href="https://www.NeuralLantern.com/x86-64-assembly-segfault-on-printf-fix-stack-alignment-yasm-gcc-demo/">x86-64 Assembly Segfault on printf? Fix Stack Alignment (Yasm + GCC Demo)</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="x86-64 Assembly Segfault on printf? Fix Stack Alignment (Yasm + GCC Demo)" width="1380" height="776" src="https://www.youtube.com/embed/g7EstvrU0pE?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p class="wp-block-paragraph">Your x86-64 assembly program looks correct, links with GCC, calls printf, and then crashes with a segfault. This video shows exactly why it happens and how to fix it.</p>



<p class="wp-block-paragraph">We build a hybrid program using Yasm and GCC on Linux, print a message from C++, call an assembly function, and hit the crash. Then we fix it with a push and pop of RAX, move the fix into the function prologue and epilogue, and run experiments to prove it works.</p>



<p class="wp-block-paragraph">No long lectures, just code, a real crash, and a real solution that stops the problem for good.</p>



<p class="wp-block-paragraph">Introduction 00:00:00<br>Hybrid Programs 00:00:09<br>Stack Alignment Problem 00:00:33<br>GCC Stack Expectations 00:01:14<br>Makefile Overview 00:02:22<br>Driver Code 00:03:16<br>Assembly Module Setup 00:04:12<br>Calling printf 00:05:20<br>Program Crash Demo 00:07:17<br>Diagnosing Segfault 00:07:56<br>Fix with Push-Pop 00:09:08<br>Prologue Epilogue Fix 00:11:18<br>Experiments Confirm 00:12:54<br>Conclusion 00:13:32<br>Outro Thanks 00:13:52</p>



<p class="wp-block-paragraph">Thanks for watching!</p>



<p class="wp-block-paragraph">Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>
</ul>



<p class="wp-block-paragraph">Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p class="wp-block-paragraph">Hello there. Let&#8217;s talk about stack alignment.</p>



<p class="wp-block-paragraph">When you&#8217;re linking and running a program for x86-64 using a Yasm assembler,</p>



<p class="wp-block-paragraph">and also you have a hybrid program, so you&#8217;re using the GCC libraries in order to get some</p>



<p class="wp-block-paragraph">extra functions or extra functionality, or just so you can have different types of source code</p>



<p class="wp-block-paragraph">is not about how to make a hybrid program look for my other video for that topic this video is</p>



<p class="wp-block-paragraph">only about solving a common problem which costs people tons of time called stack alignment imagine</p>



<p class="wp-block-paragraph">this you&#8217;re writing a program a hybrid program and every once in a while you call on a function</p>



<p class="wp-block-paragraph">within the gcc libraries or perhaps you call another function that you don&#8217;t control or or</p>



<p class="wp-block-paragraph">something that might in turn call on a gcc library and you can&#8217;t figure out why but your program</p>



<p class="wp-block-paragraph">figure out why but your program keeps crashing for no reason seemingly you&#8217;ve spent hours and hours</p>



<p class="wp-block-paragraph">debugging your program it appears to be correct but it still crashes if that happens to you there&#8217;s</p>



<p class="wp-block-paragraph">a chance that you&#8217;re suffering from stack alignment issues so what do i mean by by this i mean uh</p>



<p class="wp-block-paragraph">basically the gcc libraries they expect that your stack which is the data structure you use</p>



<p class="wp-block-paragraph">uh you know when you&#8217;re calling a function or returning from a function or you&#8217;re making local</p>



<p class="wp-block-paragraph">or you&#8217;re making local variables uh where you&#8217;re like pushing you know when you&#8217;re pushing and</p>



<p class="wp-block-paragraph">popping stuff onto the stack uh gcc expects that the stack is aligned to eight bytes</p>



<p class="wp-block-paragraph">um so that means basically every time you do a push or a pop the stack kind of goes out of</p>



<p class="wp-block-paragraph">alignment and goes into alignment so like i do a push the stack goes out of alignment i do another</p>



<p class="wp-block-paragraph">I pop later it gets out of alignment I pop again it goes into alignment every</p>



<p class="wp-block-paragraph">time you do a function call every time you modify the stack by you know a</p>



<p class="wp-block-paragraph">certain number of bytes it could potentially be going out of alignment I</p>



<p class="wp-block-paragraph">think it stays into the same alignment if you push twice as far as I recall or</p>



<p class="wp-block-paragraph">if you jump quickly twice but the point is this is kind of a precarious thing</p>



<p class="wp-block-paragraph">and maybe sometimes you&#8217;re not sure am I suffering from stack alignment well</p>



<p class="wp-block-paragraph">and make sure that it&#8217;s not happening.</p>



<p class="wp-block-paragraph">So first off, I just want to show you my make file real fast.</p>



<p class="wp-block-paragraph">This is not a make file video, so I&#8217;m going to just really,</p>



<p class="wp-block-paragraph">I&#8217;m going to very quickly go through it.</p>



<p class="wp-block-paragraph">This is a hybrid program, so I just have some variables at the top</p>



<p class="wp-block-paragraph">for C++ compilation and some variables over here for assembly in Yasm.</p>



<p class="wp-block-paragraph">And then I&#8217;m going to link using G++.</p>



<p class="wp-block-paragraph">Anytime you&#8217;re linking with G++, that means the G++ libraries are there.</p>



<p class="wp-block-paragraph">You should already think to yourself, maybe it&#8217;s at least possible</p>



<p class="wp-block-paragraph">maybe it&#8217;s at least possible stack alignment could be some of my crashes,</p>



<p class="wp-block-paragraph">especially if you&#8217;re actually calling GCC libraries or a library that you don&#8217;t</p>



<p class="wp-block-paragraph">control or a library that you don&#8217;t know what the source is inside of it.</p>



<p class="wp-block-paragraph">So I&#8217;m just, you know,</p>



<p class="wp-block-paragraph">I have a little menu here and then there&#8217;s like a run target.</p>



<p class="wp-block-paragraph">And then all I&#8217;m doing is I&#8217;m just compiling a driver and an assembly module</p>



<p class="wp-block-paragraph">called whoops,</p>



<p class="wp-block-paragraph">which will do the stack alignment issues for us or which will show us the</p>



<p class="wp-block-paragraph">issues. The driver is pretty simple.</p>



<p class="wp-block-paragraph">simple it&#8217;s the entry point for the program it&#8217;s got a main function it just prints a message and</p>



<p class="wp-block-paragraph">then it calls our whoops function just to prove to you we&#8217;re in a hybrid program we&#8217;ve got an</p>



<p class="wp-block-paragraph">extern c block to disable name mangling on the whoops program so that the c plus plus module</p>



<p class="wp-block-paragraph">can call on the assembly module that&#8217;s not what this video is about check my other videos if you&#8217;re</p>



<p class="wp-block-paragraph">interested in more of that or if you&#8217;re still trying to figure out what to do but basically in</p>



<p class="wp-block-paragraph">You know define some stuff so that I can print string messages. This is all covered in other videos that I&#8217;ve made</p>



<p class="wp-block-paragraph">but we&#8217;re just gonna say there&#8217;s gonna be a welcome message and</p>



<p class="wp-block-paragraph">Then I&#8217;m gonna actually call on a GCC library a regular like C standard library print F</p>



<p class="wp-block-paragraph">To just kind of print something for us</p>



<p class="wp-block-paragraph">Then we&#8217;re gonna do a goodbye message and then</p>



<p class="wp-block-paragraph">We sort of enter up here. So the first thing you</p>



<p class="wp-block-paragraph">probably are wondering is wait a minute can you call printf from assembly yeah you can if you&#8217;re</p>



<p class="wp-block-paragraph">linking with the gcc libraries there are a lot of functions out there that provide extra</p>



<p class="wp-block-paragraph">functionality just be very careful that you don&#8217;t uh accidentally like if you&#8217;re doing homework at</p>



<p class="wp-block-paragraph">home be careful you don&#8217;t actually you don&#8217;t accidentally get in trouble for using a function</p>



<p class="wp-block-paragraph">that was pre-written in order to accomplish something in your homework that you were</p>



<p class="wp-block-paragraph">supposed to do so be careful about that you could you know depending on your professor you could</p>



<p class="wp-block-paragraph">professor you could lose a lot of points or all the points or whatever so anyway you can call</p>



<p class="wp-block-paragraph">printf and other c and c++ library functions all you have to do is number one make a hybrid program</p>



<p class="wp-block-paragraph">that links against the gcc libraries and number two name the functions with extern so i want to</p>



<p class="wp-block-paragraph">call printf in this program so i&#8217;m just going to say extern printf to indicate to the linker that</p>



<p class="wp-block-paragraph">symbol which you know it should should link to it because it&#8217;s like in another module somewhere it&#8217;ll</p>



<p class="wp-block-paragraph">be inside the gcc library then the entry point for this particular module it&#8217;s just a function that</p>



<p class="wp-block-paragraph">i expose as global so that other places in the program can call on it and i&#8217;m just calling it</p>



<p class="wp-block-paragraph">whoops i am let&#8217;s see writing this as a function not a regular assembly label that has to be sys</p>



<p class="wp-block-paragraph">function where I have to actually return when I&#8217;m finished. This is not a functions video,</p>



<p class="wp-block-paragraph">but again, if I was using any Kali preserved registers per the ABI, then I would do like a</p>



<p class="wp-block-paragraph">push pop pair on the top and the bottom, but I&#8217;m not. So first thing that happens is we just print</p>



<p class="wp-block-paragraph">a welcome message. No problem. This is not a printing tutorial video. So check out my other</p>



<p class="wp-block-paragraph">videos. And then we&#8217;ll actually just call on printf. We&#8217;ll ask printf, could you print this</p>



<p class="wp-block-paragraph">We&#8217;ll ask printf, could you print this string for us?</p>



<p class="wp-block-paragraph">And then we&#8217;ll say goodbye with just another print.</p>



<p class="wp-block-paragraph">So this is the problem here, the call to printf.</p>



<p class="wp-block-paragraph">It seems good.</p>



<p class="wp-block-paragraph">I mean, all we&#8217;re doing is we are respecting the ABI by saying,</p>



<p class="wp-block-paragraph">all right, printf wants a pointer to the C string that we wish to print.</p>



<p class="wp-block-paragraph">And so I&#8217;m just going to load up the first integer argument,</p>



<p class="wp-block-paragraph">which also could be a pointer argument, RDI,</p>



<p class="wp-block-paragraph">with a pointer to my string, just printf message.</p>



<p class="wp-block-paragraph">printf message and then I&#8217;m going to call printf. Should work. Let me show you what is actually in</p>



<p class="wp-block-paragraph">the string just for your information. The string is just a message in quotes that says you know</p>



<p class="wp-block-paragraph">this is a string printed by printf and then I add a carriage return line feed to the end of it so</p>



<p class="wp-block-paragraph">printf will do the new lining all for me without me having to call another function and then I give</p>



<p class="wp-block-paragraph">it a null terminator. I&#8217;m not going to explain null terminators too much in this video but just</p>



<p class="wp-block-paragraph">this kind of thing is required for printf because printf will scan printf doesn&#8217;t actually need the</p>



<p class="wp-block-paragraph">length of the message so i don&#8217;t even know why i put this in here so line 24 totally useless</p>



<p class="wp-block-paragraph">anyway so this feels like it should work but it&#8217;s not going to work let&#8217;s see what happens</p>



<p class="wp-block-paragraph">if i do well i&#8217;ll do clear and make run then you can see that the program gets compiled and then</p>



<p class="wp-block-paragraph">We get the welcome message from the driver.</p>



<p class="wp-block-paragraph">It says, my name is Miles Pepperdraut.</p>



<p class="wp-block-paragraph">That&#8217;s not my real name.</p>



<p class="wp-block-paragraph">I just love those names.</p>



<p class="wp-block-paragraph">And then it says, I will now call the whoops module.</p>



<p class="wp-block-paragraph">That&#8217;s the driver talking.</p>



<p class="wp-block-paragraph">And then now we&#8217;re inside of the whoops module and it says,</p>



<p class="wp-block-paragraph">hello, this is the whoops module.</p>



<p class="wp-block-paragraph">And then we get a segfault.</p>



<p class="wp-block-paragraph">Program crashes.</p>



<p class="wp-block-paragraph">Your program doesn&#8217;t work for your customers</p>



<p class="wp-block-paragraph">or you don&#8217;t get your points on your homework or whatever it is</p>



<p class="wp-block-paragraph">because we have a segmentation fault.</p>



<p class="wp-block-paragraph">fault this is not good and this happens to lots of people they&#8217;re coding and</p>



<p class="wp-block-paragraph">they&#8217;re debugging for hours and hours and hours not understanding where the</p>



<p class="wp-block-paragraph">seg fault is coming from it might be coming from stack alignment in this case</p>



<p class="wp-block-paragraph">I know for sure it&#8217;s coming from stack alignment just because I wrote the</p>



<p class="wp-block-paragraph">program on purpose the crash so let&#8217;s let&#8217;s look at a way to I mean first to</p>



<p class="wp-block-paragraph">debug this your first clue is I am sure that it&#8217;s working it&#8217;s still crashing</p>



<p class="wp-block-paragraph">and I&#8217;m calling something that is GCC or I&#8217;m calling something that I don&#8217;t know what the</p>



<p class="wp-block-paragraph">code is inside it could be calling GCC like if you have a library from somewhere else maybe it&#8217;s</p>



<p class="wp-block-paragraph">calling GCC you don&#8217;t really know so that&#8217;s my first clue I&#8217;ll go into the source code and I&#8217;ll</p>



<p class="wp-block-paragraph">just kind of try something so at the beginning of my function we know that every time you jump into</p>



<p class="wp-block-paragraph">a function or do a function call then the stack changes a little bit because the stack has to</p>



<p class="wp-block-paragraph">store the return address of where you&#8217;re going to return to later. So that means there&#8217;s a potential</p>



<p class="wp-block-paragraph">here for stack alignment issues. And I&#8217;m going to go ahead and try something to see if I can</p>



<p class="wp-block-paragraph">prove to myself that this is a stack alignment issue. What I&#8217;m going to do is I&#8217;m just going to</p>



<p class="wp-block-paragraph">move the stack by eight bytes. So how do we do that? You could either move the stack pointer</p>



<p class="wp-block-paragraph">forward and back if you wanted to, like we have add or subtract. I think subtract would be what</p>



<p class="wp-block-paragraph">I think subtract would be what we want to do just to the let&#8217;s see where is it rsp the stack register</p>



<p class="wp-block-paragraph">I&#8217;m not going to do that here</p>



<p class="wp-block-paragraph">I&#8217;m just going to prove a point and make things a little bit easier</p>



<p class="wp-block-paragraph">We&#8217;ll push the number or sorry we won&#8217;t push a number we&#8217;ll push rax and then after that we&#8217;ll pop rax</p>



<p class="wp-block-paragraph">And what&#8217;s happening is i&#8217;m changing the alignment of the stack and then i&#8217;m calling on printf</p>



<p class="wp-block-paragraph">And then i&#8217;m changing the alignment of the stack again</p>



<p class="wp-block-paragraph">I&#8217;m sort of like</p>



<p class="wp-block-paragraph">you can imagine I&#8217;m just like pushing a dummy value onto the stack.</p>



<p class="wp-block-paragraph">Like we don&#8217;t really care what&#8217;s inside of RAX.</p>



<p class="wp-block-paragraph">We&#8217;re not trying to preserve RAX.</p>



<p class="wp-block-paragraph">We&#8217;re not going to use the stack or anything like that.</p>



<p class="wp-block-paragraph">So I&#8217;m just saying, well, let&#8217;s just put something on there.</p>



<p class="wp-block-paragraph">I don&#8217;t even care what it is.</p>



<p class="wp-block-paragraph">And then when we&#8217;re done, we&#8217;ll just pop it right back off.</p>



<p class="wp-block-paragraph">That way, when we&#8217;re finished, the stack is really unchanged.</p>



<p class="wp-block-paragraph">But inside of that push pop pair, the stack is differently aligned by about eight bytes</p>



<p class="wp-block-paragraph">Well, this right here is an 8-byte register, a 64-bit register.</p>



<p class="wp-block-paragraph">So we&#8217;re moving the stack, then we&#8217;re doing the call, and then we&#8217;re moving the stack back.</p>



<p class="wp-block-paragraph">With only that one change, you don&#8217;t want to make the mistake of making a bunch of changes</p>



<p class="wp-block-paragraph">because then it&#8217;s hard to figure out which change actually worked.</p>



<p class="wp-block-paragraph">With just that one change, I&#8217;m going to run the program again.</p>



<p class="wp-block-paragraph">Notice how the program finishes correctly.</p>



<p class="wp-block-paragraph">So, of course, nothing in life is 100%, but at this point, I would be pretty sure that my issue was stack alignment.</p>



<p class="wp-block-paragraph">was stack alignment. I don&#8217;t know where the stack alignment came from. Maybe it came from the</p>



<p class="wp-block-paragraph">function call. Maybe it came from some push pops I had at the top or the bottom. I don&#8217;t really know.</p>



<p class="wp-block-paragraph">You can probably bet that if you call on another function that respects the ABI, that when your</p>



<p class="wp-block-paragraph">function comes, when your call comes back, the stack&#8217;s not going to be in a different alignment,</p>



<p class="wp-block-paragraph">which means let&#8217;s say I had like many, many calls to print F here. I wouldn&#8217;t necessarily want to</p>



<p class="wp-block-paragraph">every single time I called on a function,</p>



<p class="wp-block-paragraph">I probably would want to put this push pop pair</p>



<p class="wp-block-paragraph">like at the very top in the prologue.</p>



<p class="wp-block-paragraph">Maybe let&#8217;s say prologue.</p>



<p class="wp-block-paragraph">I&#8217;ll do like just push R-A-X</p>



<p class="wp-block-paragraph">and then leave myself a comment</p>



<p class="wp-block-paragraph">because it&#8217;s easy to forget assembly in assembly</p>



<p class="wp-block-paragraph">like what you&#8217;re doing.</p>



<p class="wp-block-paragraph">So I&#8217;m just going to leave myself a note</p>



<p class="wp-block-paragraph">and I&#8217;m just going to say stack alignment</p>



<p class="wp-block-paragraph">just to remind myself not to accidentally remove it later.</p>



<p class="wp-block-paragraph">And then I&#8217;m going to do a pop R-A-X at the end.</p>



<p class="wp-block-paragraph">So I&#8217;m going to do like an epilogue.</p>



<p class="wp-block-paragraph">epilog I thought I spelled that right epilog I am sure that I&#8217;m spelling it</p>



<p class="wp-block-paragraph">right okay so then I&#8217;m gonna pop RAX and and hilariously since you don&#8217;t really</p>



<p class="wp-block-paragraph">care about the value of RAX you could pop a different register as long as it</p>



<p class="wp-block-paragraph">wasn&#8217;t call he saved but just so this is a little bit easier to understand and</p>



<p class="wp-block-paragraph">more stable I&#8217;m gonna do it this way so then I&#8217;m gonna say stack alignments</p>



<p class="wp-block-paragraph">stack alignment and maybe I want to like line up these comments so I&#8217;ll just kind</p>



<p class="wp-block-paragraph">of like line up the comments so now the whole entire function because if you</p>



<p class="wp-block-paragraph">look inside of them the you know the body of my function I&#8217;m not really</p>



<p class="wp-block-paragraph">changing the stack alignment I&#8217;m not modifying the stack register I&#8217;m not</p>



<p class="wp-block-paragraph">doing any more push pop pairs I&#8217;m not doing anything so probably the stack is</p>



<p class="wp-block-paragraph">out of alignment during the entire function which means I can make my</p>



<p class="wp-block-paragraph">now by removing these push pop pairs that are surrounding that surround the</p>



<p class="wp-block-paragraph">printf calls so you know I have like half the number of push pop pairs at</p>



<p class="wp-block-paragraph">this point so let&#8217;s see if that works notice how the program still runs no</p>



<p class="wp-block-paragraph">problem and just as another experiment I&#8217;m gonna comment out the push and the</p>



<p class="wp-block-paragraph">pop pair you got to comment out the pair not just one push and not the pop</p>



<p class="wp-block-paragraph">push and not the pop or vice versa. Otherwise the whole program is not going to work.</p>



<p class="wp-block-paragraph">So if I commented it out, now it should crash for sure. Notice how it crashes.</p>



<p class="wp-block-paragraph">All right. So if I put it back one more experiment just to be, you know,</p>



<p class="wp-block-paragraph">just to be like really obsessed with the specificity and make sure that the program works</p>



<p class="wp-block-paragraph">just to be really robust and it works. Okay. So this is a stack alignment in x86-64</p>



<p class="wp-block-paragraph">GCC library dependent hybrid programs in Yasm. I&#8217;m sure this applies to a lot of other areas, but</p>



<p class="wp-block-paragraph">Yasm x86-64 on Linux is what I&#8217;m doing. So I hope this was helpful to you. I hope you learned a</p>



<p class="wp-block-paragraph">little bit and had a little bit of fun. I&#8217;ll see you in the next video.</p>



<p class="wp-block-paragraph">Hey everybody. Thanks for watching this video again from the bottom of my heart. I really</p>



<p class="wp-block-paragraph">appreciate it. I do hope you did learn something and have some fun. If you could do me a please</p>



<p class="wp-block-paragraph">If you could do me a please a small little favor, could you please subscribe and follow this channel or these videos or whatever it is you do on the current social media website that you&#8217;re looking at right now?</p>



<p class="wp-block-paragraph">It would really mean the world to me and it&#8217;ll help make more videos and grow this community.</p>



<p class="wp-block-paragraph">So we&#8217;ll be able to do more videos, longer videos, better videos, or just I&#8217;ll be able to keep making videos in general.</p>



<p class="wp-block-paragraph">So please do me a kindness and subscribe.</p>



<p class="wp-block-paragraph">I&#8217;m sleeping in the middle of the night and I just wake up because I know somebody subscribed or followed.</p>



<p class="wp-block-paragraph">It just wakes me up and I get filled with joy.</p>



<p class="wp-block-paragraph">That&#8217;s exactly what happens every single time.</p>



<p class="wp-block-paragraph">So you could do it as a nice favor to me or you could troll me if you want to just wake me up in the middle of the night.</p>



<p class="wp-block-paragraph">Just subscribe and then I&#8217;ll just wake up.</p>



<p class="wp-block-paragraph">I promise that&#8217;s what will happen.</p>



<p class="wp-block-paragraph">Also, if you look at the middle of the screen right now, you should see a QR code which you can scan in order to go to the website,</p>



<p class="wp-block-paragraph">which I think is also named somewhere at the bottom of this video.</p>



<p class="wp-block-paragraph">it&#8217;ll take you to my main website where you can just kind of like see all the videos i published</p>



<p class="wp-block-paragraph">and the services and tutorials and things that i offer and all that good stuff and uh</p>



<p class="wp-block-paragraph">if you have a suggestion for uh uh clarifications or errata or just future videos that you want to</p>



<p class="wp-block-paragraph">see please leave a comment or if you just want to say hey what&#8217;s up what&#8217;s going on you know just</p>



<p class="wp-block-paragraph">send me a comment whatever i also wake up for those in the middle of the night i get i wake</p>



<p class="wp-block-paragraph">it would really mean the world to me.</p>



<p class="wp-block-paragraph">I would really appreciate it.</p>



<p class="wp-block-paragraph">So again, thank you so much for watching this video</p>



<p class="wp-block-paragraph">and enjoy the cool music</p>



<p class="wp-block-paragraph">as I fade into the darkness,</p>



<p class="wp-block-paragraph">which is coming for us all.</p>



<p class="wp-block-paragraph">Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/x86-64-assembly-segfault-on-printf-fix-stack-alignment-yasm-gcc-demo/">x86-64 Assembly Segfault on printf? Fix Stack Alignment (Yasm + GCC Demo)</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/x86-64-assembly-segfault-on-printf-fix-stack-alignment-yasm-gcc-demo/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Master Debugging with xxd: Inspect Program Output at a Byte Level for Automation &#038; Clean Code!</title>
		<link>https://www.NeuralLantern.com/master-debugging-with-xxd-inspect-program-output-at-a-byte-level-for-automation-clean-code/</link>
					<comments>https://www.NeuralLantern.com/master-debugging-with-xxd-inspect-program-output-at-a-byte-level-for-automation-clean-code/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Mon, 23 Jun 2025 02:41:27 +0000</pubDate>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[assembly programming]]></category>
		<category><![CDATA[automation debugging]]></category>
		<category><![CDATA[binary file inspection]]></category>
		<category><![CDATA[byte level debugging]]></category>
		<category><![CDATA[clean code]]></category>
		<category><![CDATA[coding tips]]></category>
		<category><![CDATA[coding tutorial]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[linux tools]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[programming errors]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[terminal commands]]></category>
		<category><![CDATA[text file debugging]]></category>
		<category><![CDATA[xxd]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=165</guid>

					<description><![CDATA[<p>Debug program output with xxd! Learn to inspect text/binary files at byte level, fix hidden issues, and ensure clean code. Perfect for automation &#038; assignments.</p>
<p>The post <a href="https://www.NeuralLantern.com/master-debugging-with-xxd-inspect-program-output-at-a-byte-level-for-automation-clean-code/">Master Debugging with xxd: Inspect Program Output at a Byte Level for Automation &amp; Clean Code!</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Master Debugging with xxd: Inspect Program Output at a Byte Level for Automation &amp; Clean Code!" width="1380" height="776" src="https://www.youtube.com/embed/UyE5t01Vnd0?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p class="wp-block-paragraph">Hey coders, ever wonder why your program’s acting funky? Join me to master debugging with xxd! This vid walks you through inspecting text or binary file output at the byte level, catching sneaky characters like null bytes that mess up automation or school assignments. From assembly to redirects, learn practical tips to ensure clean output. Perfect for beginners and pros alike! Hit subscribe for more coding tutorials, and check my site for extra goodies. Let’s debug smarter, not harder!</p>



<p class="wp-block-paragraph">Introduction to xxd 00:00:00<br>Purpose of debugging 00:00:12<br>Why debug output 00:00:23<br>Example assembly program 00:00:56<br>Running the program 00:01:26<br>Corrupting the message 00:01:45<br>Terminal vs automation 00:02:27<br>Installing xxd 00:03:16<br>Redirecting output 00:03:29<br>Using xxd to debug 00:04:33<br>Identifying newline issue 00:05:36<br>Finding zero in string 00:06:04<br>Debugging conclusion 00:06:32<br>Weird symbols warning 00:06:47<br>Debugging standard error 00:07:23<br>Closing remarks 00:07:40<br>Call to subscribe 00:07:56<br>QR code and website 00:08:45<br>Request for comments 00:09:09<br>Fade out 00:09:31</p>



<p class="wp-block-paragraph">Thanks for watching!</p>



<p class="wp-block-paragraph">Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>
</ul>



<p class="wp-block-paragraph">Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p class="wp-block-paragraph">Hey there, I&#8217;d like to talk to you about debugging your program&#8217;s output with xxd.</p>



<p class="wp-block-paragraph">What am I talking about? Well, there&#8217;s a program called xxd that can sort of inspect</p>



<p class="wp-block-paragraph">at the byte level the output of some text file or binary file. It&#8217;s really useful for</p>



<p class="wp-block-paragraph">inspecting things. Why would you want to debug the output of your program? Well, I don&#8217;t know.</p>



<p class="wp-block-paragraph">print a message from your program the program might be printing some extra characters somewhere</p>



<p class="wp-block-paragraph">or some garbage and maybe maybe you don&#8217;t notice because you&#8217;re sort of looking at your program&#8217;s</p>



<p class="wp-block-paragraph">output in the terminal but then maybe if your output is being sent to another program</p>



<p class="wp-block-paragraph">for the purposes of automation or like you&#8217;re getting a grade from a class or something like</p>



<p class="wp-block-paragraph">that then um well it can it can sort of it can sort of get you without you realizing what&#8217;s wrong</p>



<p class="wp-block-paragraph">you an example real fast of what i&#8217;m talking about i have a simple assembly program here this is not</p>



<p class="wp-block-paragraph">a video about how to write assembly code so just assume that you know if you want to know assembly</p>



<p class="wp-block-paragraph">see my other videos but um i&#8217;m just going to print a simple message i&#8217;m just going to print</p>



<p class="wp-block-paragraph">hello i feel awesome and then the length of the message i&#8217;m specifying here you don&#8217;t know you</p>



<p class="wp-block-paragraph">don&#8217;t need to know too much about this for this particular video i&#8217;m just printing a string in</p>



<p class="wp-block-paragraph">assembly that&#8217;s all i&#8217;m doing and then here you can see i&#8217;m just kind of like printing it and then</p>



<p class="wp-block-paragraph">I&#8217;m just kind of like printing it and then I&#8217;m like exiting.</p>



<p class="wp-block-paragraph">So if we go back to the terminal here, I can type make run.</p>



<p class="wp-block-paragraph">This is not a make file video.</p>



<p class="wp-block-paragraph">See my other videos.</p>



<p class="wp-block-paragraph">I want to type make run just to compile and run the program.</p>



<p class="wp-block-paragraph">And then here&#8217;s the message that it prints, right?</p>



<p class="wp-block-paragraph">Hello, I feel awesome.</p>



<p class="wp-block-paragraph">It looks good in the terminal.</p>



<p class="wp-block-paragraph">I can&#8217;t be 100% sure though, because think about this.</p>



<p class="wp-block-paragraph">What if I corrupted the message on purpose?</p>



<p class="wp-block-paragraph">This can happen in assembly all the time.</p>



<p class="wp-block-paragraph">Wrong or if you add extra characters at the end of it or even if you have you know a corrupted register somewhere</p>



<p class="wp-block-paragraph">That either reads from the wrong spot</p>



<p class="wp-block-paragraph">To get a string or maybe it it writes over the string for some reason. There&#8217;s a lot of things that can go wrong</p>



<p class="wp-block-paragraph">So for now just suppose that I&#8217;ve corrupted my message somehow by I don&#8217;t know. Let&#8217;s put a zero</p>



<p class="wp-block-paragraph">In between the string so I&#8217;m gonna say is that it&#8217;s gonna be like H E L</p>



<p class="wp-block-paragraph">0 L O and what that should do is</p>



<p class="wp-block-paragraph">lo and what that should do uh well it should look like just the word hello but if i&#8217;m automating</p>



<p class="wp-block-paragraph">this program or sending it in to get a grade at a school somewhere then this should you know not</p>



<p class="wp-block-paragraph">match what is expected if i&#8217;m automating with like another system in some way but it should look okay</p>



<p class="wp-block-paragraph">in the terminal let&#8217;s see i&#8217;m going to do clear and make run notice how the message looks the same</p>



<p class="wp-block-paragraph">I feel awesome. So if I was automating, you know, if I was sending this string to another program</p>



<p class="wp-block-paragraph">for automation, I might be convinced that I&#8217;m not doing anything wrong. And I&#8217;ll, I&#8217;ll think it&#8217;s</p>



<p class="wp-block-paragraph">the other side that is wrong or, or our computers are just buggy or something like that. But actually</p>



<p class="wp-block-paragraph">I&#8217;ve outputted a corrupted message for some reason. So how can I really be sure that my</p>



<p class="wp-block-paragraph">message is what I think I&#8217;m seeing in the terminal? That&#8217;s the XXD program. Pretty easy.</p>



<p class="wp-block-paragraph">apt install xxd let me see if I have it on this system oh it&#8217;s already installed</p>



<p class="wp-block-paragraph">okay good so I&#8217;m gonna do clear and make run again so there it is I would like to</p>



<p class="wp-block-paragraph">just redirect the standard output pipe to a file with a special command in the</p>



<p class="wp-block-paragraph">shell let me just show you real fast I am definitely printing to std out the</p>



<p class="wp-block-paragraph">standard pipe which is just a number one file descriptor if you don&#8217;t understand</p>



<p class="wp-block-paragraph">If you don&#8217;t understand that, I have other videos, but I&#8217;m going to run the program again,</p>



<p class="wp-block-paragraph">but then I&#8217;m going to redirect the output to a file and I&#8217;m going to call it stdout.txt.</p>



<p class="wp-block-paragraph">It&#8217;s probably a good idea to eliminate spaces.</p>



<p class="wp-block-paragraph">I think I&#8217;ve made mistakes in other videos where I didn&#8217;t put a space before or after</p>



<p class="wp-block-paragraph">this little redirector symbol and I ended up creating a file just called the number</p>



<p class="wp-block-paragraph">two or the number one.</p>



<p class="wp-block-paragraph">But pipe number one is standard output.</p>



<p class="wp-block-paragraph">So I&#8217;m going to say anything that comes to pipe one, which is standard output, I&#8217;m just</p>



<p class="wp-block-paragraph">output I&#8217;m just going to redirect it to a text file. So when I hit enter notice</p>



<p class="wp-block-paragraph">how nothing prints to the screen but the standard output text file that I</p>



<p class="wp-block-paragraph">specified is now created. If I spill the contents of std out it still looks</p>



<p class="wp-block-paragraph">normal so don&#8217;t let that trick you but watch what happens if I use xxd.</p>



<p class="wp-block-paragraph">xxd std out basically xxd is going to read it as a binary file and tell me</p>



<p class="wp-block-paragraph">every single character in there while I oh I forgot to change the title of that</p>



<p class="wp-block-paragraph">that&#8217;s not this video but notice right here where it says H E L L O and then</p>



<p class="wp-block-paragraph">right before that there&#8217;s like a little dot if you look at the dot let&#8217;s see</p>



<p class="wp-block-paragraph">what is the dot it&#8217;s one two three four five six it&#8217;s the sixth thing one two</p>



<p class="wp-block-paragraph">one two three four five six seven eight nine ten twelve thirteen fourteen fifteen oh there&#8217;s</p>



<p class="wp-block-paragraph">fifteen characters but there&#8217;s not that many i think probably they&#8217;re packing them by two here</p>



<p class="wp-block-paragraph">let me see if that makes more sense now one two three four five six one two three four five six</p>



<p class="wp-block-paragraph">yeah that makes a lot more sense so the sixth uh byte not the sixth uh word uh is basically</p>



<p class="wp-block-paragraph">to this dot right here and if you recall oa is a decimal 10 which is uh the beginning of a new line</p>



<p class="wp-block-paragraph">you know like a carriage return line feed um 13 comma 10 so that&#8217;s what it is right there</p>



<p class="wp-block-paragraph">and then so now we know that there&#8217;s xxd is figuring out here or helping us understand</p>



<p class="wp-block-paragraph">that there&#8217;s a new line between slash main and then the message which if you recall that&#8217;s</p>



<p class="wp-block-paragraph">exactly what happened and then when we look into our hello string there&#8217;s a dot in the middle here</p>



<p class="wp-block-paragraph">string there&#8217;s a dot in the middle here what is that dot well we just have to figure out what</p>



<p class="wp-block-paragraph">number that corresponds to so the oa was that dot right there so we just got to go a couple more</p>



<p class="wp-block-paragraph">bytes forward one two three four bytes forward one two three four bytes forward it&#8217;s this zero right</p>



<p class="wp-block-paragraph">so xxd even though the terminal didn&#8217;t help us originally xxd has helped us realize that we&#8217;re</p>



<p class="wp-block-paragraph">that we&#8217;re actually printing a zero under the hood and we can&#8217;t see it in the terminal.</p>



<p class="wp-block-paragraph">So we have now debugged our output. You know, depending on where you print this,</p>



<p class="wp-block-paragraph">you might see nothing like in the terminal. It didn&#8217;t really show anything. But if you&#8217;re on a</p>



<p class="wp-block-paragraph">webpage somewhere or some other type of thing that&#8217;s going to print the data for you, you might</p>



<p class="wp-block-paragraph">see a weird symbol. I mean, it really depends. This is not something you&#8217;ll see everywhere, but</p>



<p class="wp-block-paragraph">you might see a weird symbol that kind of looks like a black diamond with a question mark inside</p>



<p class="wp-block-paragraph">mark inside of it or some other weird symbol.</p>



<p class="wp-block-paragraph">If you start seeing weird symbols all over the place or just in a place where you know</p>



<p class="wp-block-paragraph">there&#8217;s not supposed to be a weird symbol, that might be an indication to you that you</p>



<p class="wp-block-paragraph">have weird values sitting inside of your string.</p>



<p class="wp-block-paragraph">And then you should probably try to debug with XXD.</p>



<p class="wp-block-paragraph">So that&#8217;s it.</p>



<p class="wp-block-paragraph">That&#8217;s the basics for debugging with XXD.</p>



<p class="wp-block-paragraph">Just, you know, file output anyway, for your information.</p>



<p class="wp-block-paragraph">If you wanted to debug the standard error pipe, you could also do this.</p>



<p class="wp-block-paragraph">you know because the error pipe is just a two um and that&#8217;s basically it i&#8217;m not going to</p>



<p class="wp-block-paragraph">debug right now because that&#8217;s that&#8217;s too easy but i hope you enjoyed this video thank you for</p>



<p class="wp-block-paragraph">watching i hope you learned a little bit and had a little bit of fun i&#8217;ll see you in the next video</p>



<p class="wp-block-paragraph">hey everybody thanks for watching this video again from the bottom of my heart i really</p>



<p class="wp-block-paragraph">appreciate it i do hope you did learn something and have some fun uh if you could do me a please</p>



<p class="wp-block-paragraph">If you could do me a please, a small little favor, could you please subscribe and follow this channel or these videos or whatever it is you do on the current social media website that you&#8217;re looking at right now.</p>



<p class="wp-block-paragraph">It would really mean the world to me and it&#8217;ll help make more videos and grow this community.</p>



<p class="wp-block-paragraph">So we&#8217;ll be able to do more videos, longer videos, better videos, or just I&#8217;ll be able to keep making videos in general.</p>



<p class="wp-block-paragraph">So please do me a kindness and subscribe.</p>



<p class="wp-block-paragraph">the middle of the night and i just wake up because i know somebody subscribed or followed</p>



<p class="wp-block-paragraph">it just wakes me up and i get filled with joy that&#8217;s exactly what happens every single time</p>



<p class="wp-block-paragraph">so you could do it as a nice favor to me or you could you could troll me if you want to just wake</p>



<p class="wp-block-paragraph">me up in the middle of the night just subscribe and then i&#8217;ll i&#8217;ll just wake up i promise that&#8217;s</p>



<p class="wp-block-paragraph">what will happen also uh if you look at the middle of the screen right now you should see a qr code</p>



<p class="wp-block-paragraph">which you can scan in order to go to the website which i think is also named somewhere at the</p>



<p class="wp-block-paragraph">you to my main website where you can just kind of like see all the videos I published and the</p>



<p class="wp-block-paragraph">services and tutorials and things that I offer and all that good stuff and uh if you have a</p>



<p class="wp-block-paragraph">suggestion for uh uh clarifications or errata or just future videos that you want to see please</p>



<p class="wp-block-paragraph">leave a comment or if you just want to say hey what&#8217;s up what&#8217;s going on you know just send me</p>



<p class="wp-block-paragraph">a comment whatever I also wake up for those in the middle of the night I get I wake up in a cold</p>



<p class="wp-block-paragraph">it would really mean the world to me. I would really appreciate it. So again,</p>



<p class="wp-block-paragraph">thank you so much for watching this video and enjoy the cool music as I fade</p>



<p class="wp-block-paragraph">into the darkness, which is coming for us all.</p>



<p class="wp-block-paragraph">Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/master-debugging-with-xxd-inspect-program-output-at-a-byte-level-for-automation-clean-code/">Master Debugging with xxd: Inspect Program Output at a Byte Level for Automation &amp; Clean Code!</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/master-debugging-with-xxd-inspect-program-output-at-a-byte-level-for-automation-clean-code/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>DDD Debugger Tutorial: Fast Guide to Debugging C++ &#038; C Code</title>
		<link>https://www.NeuralLantern.com/ddd-debugger-tutorial-fast-guide-to-debugging-c-c-code/</link>
					<comments>https://www.NeuralLantern.com/ddd-debugger-tutorial-fast-guide-to-debugging-c-c-code/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Sun, 22 Jun 2025 13:42:41 +0000</pubDate>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[C debugging]]></category>
		<category><![CDATA[c++ debugging]]></category>
		<category><![CDATA[coding for beginners]]></category>
		<category><![CDATA[Data Display Debugger]]></category>
		<category><![CDATA[DDD debugger]]></category>
		<category><![CDATA[debugger GUI]]></category>
		<category><![CDATA[debugging tutorial]]></category>
		<category><![CDATA[GDB debugger]]></category>
		<category><![CDATA[learn to code]]></category>
		<category><![CDATA[programming tips]]></category>
		<category><![CDATA[programming tutorial]]></category>
		<category><![CDATA[set breakpoints]]></category>
		<category><![CDATA[software debugging]]></category>
		<category><![CDATA[source code debugging]]></category>
		<category><![CDATA[Ubuntu debugging]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=161</guid>

					<description><![CDATA[<p>Learn DDD debugging fast! This tutorial covers breakpoints, source code, and GDB console for C++ &#038; C. Watch our GDB video first for better skills!</p>
<p>The post <a href="https://www.NeuralLantern.com/ddd-debugger-tutorial-fast-guide-to-debugging-c-c-code/">DDD Debugger Tutorial: Fast Guide to Debugging C++ &amp; C Code</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="DDD Debugger Tutorial: Fast Guide to Debugging C++ &amp; C Code" width="1380" height="776" src="https://www.youtube.com/embed/jRsoOosxWuc?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p class="wp-block-paragraph">Hey coders! Dive into this quick DDD tutorial to learn the Data Display Debugger for C++ and C programs. See how to launch DDD, set breakpoints, view source code, and use the GDB console. I’ll walk you through the basics, but check my GDB video first for a better debugging foundation. If you’re new to GUI debuggers or just curious, this is for you! Subscribe for more programming tips, and let me know in the comments if you want advanced DDD content. Scan the QR code for more tutorials!</p>



<p class="wp-block-paragraph">Introduction to DDD 00:00:00<br>DDD vs GDB Comparison 00:00:04<br>Installation Instructions 00:00:56<br>Launching DDD 00:01:20<br>Source Code Window 00:01:57<br>Setting Breakpoints 00:03:16<br>Running and Debugging 00:04:08<br>GDB Console Commands 00:04:21<br>Modifying Breakpoints 00:05:20<br>Closing DDD 00:05:36<br>Recommendation to Learn GDB 00:05:48<br>Call to Subscribe 00:06:32<br>Website and Comments 00:07:17</p>



<p class="wp-block-paragraph">Thanks for watching!</p>



<p class="wp-block-paragraph">Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>
</ul>



<p class="wp-block-paragraph">Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p class="wp-block-paragraph">DDD debugger, Data Display Debugger, debugging tutorial, C++ debugging, C debugging, GDB debugger, programming tutorial, software debugging, coding for beginners, debugger GUI, set breakpoints, source code debugging, Ubuntu debugging, learn to code, programming tips</p>



<p class="wp-block-paragraph">hey there in this video i&#8217;m going to give you a very very quick overview</p>



<p class="wp-block-paragraph">of a program called ddd which you can use to debug your programs</p>



<p class="wp-block-paragraph">disclaimer you should see my gdb video first before you watch this one because it&#8217;s much more</p>



<p class="wp-block-paragraph">useful and in my personal opinion gdb is a much better debugger than ddd ddd ddd is actually</p>



<p class="wp-block-paragraph">over GDB so it doesn&#8217;t really add any more functionality it&#8217;s sort of for</p>



<p class="wp-block-paragraph">people who like to use GUI&#8217;s but the GUI is not it&#8217;s not very good but it&#8217;s</p>



<p class="wp-block-paragraph">there if you&#8217;re still struggling with the command line anyway so yeah see my</p>



<p class="wp-block-paragraph">other video if you want to learn about make files if you want to learn about</p>



<p class="wp-block-paragraph">C++ C assembly GDB debugging all that stuff are in other videos but assuming</p>



<p class="wp-block-paragraph">that you know how to use GDB we can start on DDD now DDD anyway if you don&#8217;t</p>



<p class="wp-block-paragraph">Anyway, if you don&#8217;t have DDD on your system, you can go sudo apt install DDD.</p>



<p class="wp-block-paragraph">I&#8217;m on Ubuntu.</p>



<p class="wp-block-paragraph">You could use whatever package manage you have on your system like DNF or whatever.</p>



<p class="wp-block-paragraph">So sudo apt install DDD.</p>



<p class="wp-block-paragraph">I don&#8217;t have to do that because I already have it on my system, unfortunately.</p>



<p class="wp-block-paragraph">Anyway, so the first thing that you can do is you can sort of launch it with DDD up here.</p>



<p class="wp-block-paragraph">It&#8217;s called the data display debugger.</p>



<p class="wp-block-paragraph">You can launch it and then you can attach it to your program for me.</p>



<p class="wp-block-paragraph">attach it to your program for me i like to just launch it uh from the command line i&#8217;ll type ddd</p>



<p class="wp-block-paragraph">and then the name of my executable i&#8217;ll build my executable real fast again this all this stuff is</p>



<p class="wp-block-paragraph">in another video how to build and you know what so forth so i&#8217;m going to build my uh executable</p>



<p class="wp-block-paragraph">and there it is main so i&#8217;m going to go ddd main and this is the uh i can&#8217;t remember the name of</p>



<p class="wp-block-paragraph">display debugger yeah I don&#8217;t really like to use this anyway you can see that</p>



<p class="wp-block-paragraph">right away there is a source code window visible which sort of looks at your</p>



<p class="wp-block-paragraph">program&#8217;s source code if that&#8217;s not visible you can click on the view menu</p>



<p class="wp-block-paragraph">item up here and start you know enabling and disabling windows there&#8217;s a data</p>



<p class="wp-block-paragraph">window to let you look at data there&#8217;s a machine code window I&#8217;m just gonna</p>



<p class="wp-block-paragraph">basically make sure that the GDB console is up and that the source window is up</p>



<p class="wp-block-paragraph">when I closed both windows hoping that I could show you that I opened both of them it just shut</p>



<p class="wp-block-paragraph">down the whole program okay anyway so yeah click view and make sure that the source windows open</p>



<p class="wp-block-paragraph">so we can see our source code and then also make sure that the gdb console window is open so we can</p>



<p class="wp-block-paragraph">type gdb commands and then um well you know probably if you know gdb you&#8217;ll you&#8217;ll you&#8217;ll</p>



<p class="wp-block-paragraph">want to start typing commands here you know enter a breakpoint at main.cpp line you know</p>



<p class="wp-block-paragraph">dot cpp line you know whatever but once you start doing that a lot you&#8217;ll realize maybe you don&#8217;t</p>



<p class="wp-block-paragraph">need to be inside of ddd with ddd you can right click on a line and add a breakpoint manually so</p>



<p class="wp-block-paragraph">that&#8217;s a little convenient i think we can do can we do control mouse no there&#8217;s a lot of obscure</p>



<p class="wp-block-paragraph">areas here well you can go to the preferences and change the font size i think i&#8217;m not going to deal</p>



<p class="wp-block-paragraph">with that in this video but so suppose for the sake of argument i wanted to break at this line</p>



<p class="wp-block-paragraph">line right here I could just right click on it and I have to hold down the right</p>



<p class="wp-block-paragraph">mouse and say set breakpoint and then I could do the same thing for this set</p>



<p class="wp-block-paragraph">breakpoint and then for this set breakpoint so it&#8217;s a little more</p>



<p class="wp-block-paragraph">convenient a little bit faster if you like looking at the text in this way to</p>



<p class="wp-block-paragraph">set breakpoints and then you can disable breakpoints and you can delete breakpoints</p>



<p class="wp-block-paragraph">and you can reset the execution position if you&#8217;re absolutely sure you know what</p>



<p class="wp-block-paragraph">know what you&#8217;re doing you can have your program skip an area and jump somewhere and then once</p>



<p class="wp-block-paragraph">i&#8217;ve kind of set up my break points i can go up here at the top this is the uh i forgot what</p>



<p class="wp-block-paragraph">window this is called but i can basically hit run which i accidentally already clicked when i was</p>



<p class="wp-block-paragraph">trying to resize the window there we go oh i can&#8217;t resize it okay so we&#8217;ll go run and uh</p>



<p class="wp-block-paragraph">well now we&#8217;ve already hit a breakpoint right away notice how at the bottom in the gdb uh</p>



<p class="wp-block-paragraph">GDB console area it says breakpoint 2 at line 36 and then there&#8217;s a green arrow here letting</p>



<p class="wp-block-paragraph">us know that we hit one of our breakpoints already so then we can do normal GDB stuff</p>



<p class="wp-block-paragraph">we can go info breakpoints just to kind of see what&#8217;s in there and you can resize with this</p>



<p class="wp-block-paragraph">handle on the very right side I don&#8217;t think it works in the middle here I&#8217;ve tried it many times</p>



<p class="wp-block-paragraph">but so you can kind of resize with this handle on the right side to get more real estate for</p>



<p class="wp-block-paragraph">panel and so it&#8217;s telling me all right I did info breakpoints just to see the</p>



<p class="wp-block-paragraph">breakpoints I can go info locals to see my local variables like a print a</p>



<p class="wp-block-paragraph">variable you know all that all the normal GDB commands I&#8217;m gonna hit</p>



<p class="wp-block-paragraph">continue and five to skip the next five times this breakpoints get hit this</p>



<p class="wp-block-paragraph">breakpoint gets hit now the next breakpoint that gets hit is this other</p>



<p class="wp-block-paragraph">one over here I can do the same thing info locals I can see the state of all</p>



<p class="wp-block-paragraph">what is b you know what is i what is a what is whatever and when i&#8217;m finished i can say continue</p>



<p class="wp-block-paragraph">and i can also modify my breakpoints by just sort of like deleting them enabling them disabling them</p>



<p class="wp-block-paragraph">but that&#8217;s me trying to type everything in the terminal of course with ddd you can right click</p>



<p class="wp-block-paragraph">on a breakpoint and disable it or delete it and so forth when you&#8217;re eventually done let&#8217;s see</p>



<p class="wp-block-paragraph">kill the process and then you can just kind of exit DDD at this point or you can exit</p>



<p class="wp-block-paragraph">the GDB console with Q and that&#8217;s it that&#8217;s the basics for DDD.</p>



<p class="wp-block-paragraph">However again I strongly encourage you to learn GDB first and by the time you do that</p>



<p class="wp-block-paragraph">you will probably not want to use DDD.</p>



<p class="wp-block-paragraph">But I have to put up this video regardless.</p>



<p class="wp-block-paragraph">Let me know if you&#8217;re interested in very advanced stuff covering DDD.</p>



<p class="wp-block-paragraph">20 years, I might upload another DDD video. You never know.</p>



<p class="wp-block-paragraph">Okay, thanks for watching this video.</p>



<p class="wp-block-paragraph">I hope you learned a little bit, and I hope you go directly to the GDB video after this.</p>



<p class="wp-block-paragraph">See you in the next one.</p>



<p class="wp-block-paragraph">Hey everybody, thanks for watching this video again from the bottom of my heart. I really</p>



<p class="wp-block-paragraph">appreciate it. I do hope you did learn something and have some fun. If you could do me a please,</p>



<p class="wp-block-paragraph">Could you please subscribe and follow this channel or these videos or whatever it is you do on the current social media</p>



<p class="wp-block-paragraph">Website that you&#8217;re looking at right now</p>



<p class="wp-block-paragraph">It would really mean the world to me and it&#8217;ll help make more videos and grow this community</p>



<p class="wp-block-paragraph">So we&#8217;ll be able to do more videos longer videos better videos or just I&#8217;ll be able to keep making videos in general</p>



<p class="wp-block-paragraph">So please do do me a kindness and and subscribe</p>



<p class="wp-block-paragraph">You know sometimes I&#8217;m sleeping in the middle of the night and I just wake up because I know somebody subscribed or followed</p>



<p class="wp-block-paragraph">subscribed or followed. It just wakes me up and I get filled with joy. That&#8217;s exactly what happens</p>



<p class="wp-block-paragraph">every single time. So you could do it as a nice favor to me or you could you could troll me if</p>



<p class="wp-block-paragraph">you want to just wake me up in the middle of the night just subscribe and then I&#8217;ll just wake up.</p>



<p class="wp-block-paragraph">I promise that&#8217;s what will happen. Also if you look at the middle of the screen right now you</p>



<p class="wp-block-paragraph">should see a QR code which you can scan in order to go to the website which I think is also named</p>



<p class="wp-block-paragraph">somewhere at the bottom of this video and it&#8217;ll take you to my main website where you can just</p>



<p class="wp-block-paragraph">all the videos i published and the services and tutorials and things that i offer and all that</p>



<p class="wp-block-paragraph">good stuff and uh if you have a suggestion for uh uh clarifications or errata or just future videos</p>



<p class="wp-block-paragraph">that you want to see please leave a comment or if you just want to say hey what&#8217;s up what&#8217;s going on</p>



<p class="wp-block-paragraph">you know just send me a comment whatever i also wake up for those in the middle of the night i</p>



<p class="wp-block-paragraph">get i wake up in a cold sweat and i&#8217;m like it would really it really mean the world to me i</p>



<p class="wp-block-paragraph">really appreciate it. So again, thank you so much for watching this video and enjoy the cool music</p>



<p class="wp-block-paragraph">as I fade into the darkness, which is coming for us all.</p>



<p class="wp-block-paragraph">Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/ddd-debugger-tutorial-fast-guide-to-debugging-c-c-code/">DDD Debugger Tutorial: Fast Guide to Debugging C++ &amp; C Code</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/ddd-debugger-tutorial-fast-guide-to-debugging-c-c-code/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Master CGDB: Boost Your Debugging with GDB’s Curses Interface in Terminal</title>
		<link>https://www.NeuralLantern.com/master-cgdb-boost-your-debugging-with-gdbs-curses-interface-in-terminal/</link>
					<comments>https://www.NeuralLantern.com/master-cgdb-boost-your-debugging-with-gdbs-curses-interface-in-terminal/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Sun, 15 Jun 2025 23:08:57 +0000</pubDate>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[assembly debugging]]></category>
		<category><![CDATA[C debugging]]></category>
		<category><![CDATA[c++ debugging]]></category>
		<category><![CDATA[CGDB]]></category>
		<category><![CDATA[coding tutorial]]></category>
		<category><![CDATA[curses interface]]></category>
		<category><![CDATA[debugging tools]]></category>
		<category><![CDATA[GDB]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[terminal debugging]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=158</guid>

					<description><![CDATA[<p>Learn CGDB, a GDB curses layer for terminal debugging. View source code &#038; breakpoints in one window. Ideal for C++, C, &#038; assembly!</p>
<p>The post <a href="https://www.NeuralLantern.com/master-cgdb-boost-your-debugging-with-gdbs-curses-interface-in-terminal/">Master CGDB: Boost Your Debugging with GDB’s Curses Interface in Terminal</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Master CGDB: Boost Your Debugging with GDB&#039;s Curses Interface in Terminal" width="1380" height="776" src="https://www.youtube.com/embed/grU1mA3W8K4?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p class="wp-block-paragraph">Hey coders! In this video, I’m diving into CGDB, a powerful curses layer on top of GDB that makes terminal debugging a breeze. See your source code and breakpoints side-by-side in one clean interface. I’ll walk you through setup, breakpoints, and why CGDB rocks for C++, C, and assembly projects. Watch my GDB video first for the basics (link in comments)! If you dig this, subscribe and drop a comment for more coding tips. Let’s debug smarter! #CGDB #GDB #Debugging #Coding</p>



<p class="wp-block-paragraph">Introduction to CGDB 00:00:00<br>Recommendation to Watch GDB Video 00:00:05<br>Explanation of CGDB and Curses 00:00:23<br>Building and Running CGDB 00:01:03<br>CGDB Interface Overview 00:01:56<br>Setting Breakpoints in CGDB 00:02:18<br>Managing Breakpoints 00:02:53<br>Benefits of CGDB 00:03:47<br>Closing Remarks and Subscription Request 00:04:00<br>Call for Comments and Suggestions 00:05:30</p>



<p class="wp-block-paragraph">Thanks for watching!</p>



<p class="wp-block-paragraph">Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>
</ul>



<p class="wp-block-paragraph">Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p class="wp-block-paragraph">Hey everybody! In this video I&#8217;m going to talk about CGDB which is just a debugging program.</p>



<p class="wp-block-paragraph">If you haven&#8217;t seen my other video on GDB please watch that first because</p>



<p class="wp-block-paragraph">I go over all the concepts of debugging an assembly program, a C++ program, a C program</p>



<p class="wp-block-paragraph">and it&#8217;ll be much more useful than this video.</p>



<p class="wp-block-paragraph">This video is just about CGDB which is really a curses layer on top of GDB.</p>



<p class="wp-block-paragraph">on top of GDB. Curses is a library that allows programmers to kind of make</p>



<p class="wp-block-paragraph">graphical interfaces in the terminal so the point of this video is just to show</p>



<p class="wp-block-paragraph">you a slightly different way to use GDB that&#8217;s why I&#8217;m saying go check out the</p>



<p class="wp-block-paragraph">previous GDB video first but you know I think you know sometimes people like CG</p>



<p class="wp-block-paragraph">to be so what am I talking about for starters pretend that I have a program</p>



<p class="wp-block-paragraph">I&#8217;ve got an assembly module a C++ module and a make file you don&#8217;t know</p>



<p class="wp-block-paragraph">or C++, see my other videos.</p>



<p class="wp-block-paragraph">This video is only about CGDB.</p>



<p class="wp-block-paragraph">But I can do, you know, make build,</p>



<p class="wp-block-paragraph">just to build my objects and my executable.</p>



<p class="wp-block-paragraph">And then normally, if you know GDB,</p>



<p class="wp-block-paragraph">you can go GDB main and just enter the GDB terminal, right?</p>



<p class="wp-block-paragraph">This is great, you can do a lot of commands from here,</p>



<p class="wp-block-paragraph">but it&#8217;s not very graphical.</p>



<p class="wp-block-paragraph">It does have a graphical mode, to be honest,</p>



<p class="wp-block-paragraph">but it seems to be kind of glitchy,</p>



<p class="wp-block-paragraph">so I&#8217;m not really gonna talk about it.</p>



<p class="wp-block-paragraph">going to talk about it anyway so instead of launching your program inside of gdb you can</p>



<p class="wp-block-paragraph">launch your program with c gdb c standing for curses i don&#8217;t think this is installed on the</p>



<p class="wp-block-paragraph">current system so i&#8217;ll probably have to install it right okay so you can go sudo apt install c gdb</p>



<p class="wp-block-paragraph">and then just enter your password</p>



<p class="wp-block-paragraph">Let me do clear and then we&#8217;ll do CGDB main.</p>



<p class="wp-block-paragraph">And I just want you to see that it&#8217;s got two windows.</p>



<p class="wp-block-paragraph">This is the whole point for me anyway.</p>



<p class="wp-block-paragraph">The bottom window is actually GDB.</p>



<p class="wp-block-paragraph">So anything you&#8217;ve learned there is going to apply here.</p>



<p class="wp-block-paragraph">But the difference is that there&#8217;s a top panel that shows your source code.</p>



<p class="wp-block-paragraph">So I don&#8217;t know.</p>



<p class="wp-block-paragraph">Let&#8217;s suppose for the sake of argument, I&#8217;m going to hit escape so I can go up to the top panel and kind of scroll my source code.</p>



<p class="wp-block-paragraph">Let&#8217;s suppose for the sake of argument, I want to break every time I hit line 36.</p>



<p class="wp-block-paragraph">time I hit line 36 okay I&#8217;m kind of scrolling I just hit escape to get into the top panel</p>



<p class="wp-block-paragraph">I&#8217;m gonna hit I for interactive mode which lets me go back down to the bottom panel</p>



<p class="wp-block-paragraph">and then I&#8217;ll just say B for breakpoints main.cpp line 36 and then just double check that I entered</p>



<p class="wp-block-paragraph">my breakpoints correctly and then I&#8217;ll run the program again if you don&#8217;t know GDB see my other</p>



<p class="wp-block-paragraph">video but notice how I started to run the program and then it immediately hit a breakpoint and then</p>



<p class="wp-block-paragraph">the top pointed to that line where it broke if you don&#8217;t believe me i&#8217;ll do another breakpoint</p>



<p class="wp-block-paragraph">at line let&#8217;s see main.cpp line maybe uh 32 and then another one at uh 39 well maybe i should</p>



<p class="wp-block-paragraph">have done 40. yeah i should have done 40 and then 33 so that means i probably want to uh</p>



<p class="wp-block-paragraph">delete that one at 32 so i&#8217;m gonna delete whichever one shows up at 32 that&#8217;s number two</p>



<p class="wp-block-paragraph">and then info breakpoints again okay so now if i continue the program also by the way notice how</p>



<p class="wp-block-paragraph">the top panel is showing red line numbers for my breakpoints if i hit c for continue</p>



<p class="wp-block-paragraph">and it hits the same breakpoint again if i hit enter to continue one more time it&#8217;ll do that</p>



<p class="wp-block-paragraph">eventually it hits a different breakpoint and notice how the source code</p>



<p class="wp-block-paragraph">moves down to the appropriate breakpoint so for me personally i kind of like to just regularly you</p>



<p class="wp-block-paragraph">and then go back and forth between that and my code window.</p>



<p class="wp-block-paragraph">But some people really love having both their code and GDB in the same terminal</p>



<p class="wp-block-paragraph">so they don&#8217;t have to go back and forth between windows.</p>



<p class="wp-block-paragraph">So if that&#8217;s you, then maybe CGDB is for you.</p>



<p class="wp-block-paragraph">My little doggy wants to go pee.</p>



<p class="wp-block-paragraph">Okay, that&#8217;s all I have for this video.</p>



<p class="wp-block-paragraph">Thank you so much for watching,</p>



<p class="wp-block-paragraph">and I hope you learned a little bit of stuff and had a little bit of fun.</p>



<p class="wp-block-paragraph">I&#8217;ll see you in the next video.</p>



<p class="wp-block-paragraph">Hey, everybody.</p>



<p class="wp-block-paragraph">Hey everybody!</p>



<p class="wp-block-paragraph">Thanks for watching this video again from the bottom of my heart.</p>



<p class="wp-block-paragraph">I really appreciate it.</p>



<p class="wp-block-paragraph">I do hope you did learn something and have some fun.</p>



<p class="wp-block-paragraph">If you could do me a please, a small little favor,</p>



<p class="wp-block-paragraph">could you please subscribe and follow this channel or these videos</p>



<p class="wp-block-paragraph">or whatever it is you do on the current social media website</p>



<p class="wp-block-paragraph">that you&#8217;re looking at right now.</p>



<p class="wp-block-paragraph">It would really mean the world to me and it&#8217;ll help make more videos</p>



<p class="wp-block-paragraph">and grow this community.</p>



<p class="wp-block-paragraph">So we&#8217;ll be able to do more videos, longer videos, better videos,</p>



<p class="wp-block-paragraph">or just i&#8217;ll be able to keep making videos in general so please do do me a kindness and uh and</p>



<p class="wp-block-paragraph">subscribe you know sometimes i&#8217;m sleeping in the middle of the night and i just wake up because i</p>



<p class="wp-block-paragraph">know somebody subscribed or followed it just wakes me up and i get filled with joy that&#8217;s exactly what</p>



<p class="wp-block-paragraph">happens every single time so you could do it as a nice favor to me or you could you control me if</p>



<p class="wp-block-paragraph">you want to just wake me up in the middle of the night just subscribe and then i&#8217;ll i&#8217;ll just wake</p>



<p class="wp-block-paragraph">up i promise that&#8217;s what will happen also uh if you look at the middle of the screen right now you</p>



<p class="wp-block-paragraph">of the screen right now you should see a qr code which you can scan in order to go to the website</p>



<p class="wp-block-paragraph">which i think is also named somewhere at the bottom of this video and it&#8217;ll take you to my</p>



<p class="wp-block-paragraph">main website where you can just kind of like see all the videos i published and the services and</p>



<p class="wp-block-paragraph">tutorials and things that i offer and all that good stuff and uh if you have a suggestion for uh</p>



<p class="wp-block-paragraph">clarifications or errata or just future videos that you want to see please leave a comment or</p>



<p class="wp-block-paragraph">up what&#8217;s going on you know just send me a comment whatever i also wake up for those in the middle of</p>



<p class="wp-block-paragraph">the night i get i wake up in a cold sweat and i&#8217;m like it would really it really mean the world to</p>



<p class="wp-block-paragraph">me i would really appreciate it so again thank you so much for watching this video and um enjoy the</p>



<p class="wp-block-paragraph">cool music as as i fade into the darkness which is coming for us all</p>



<p class="wp-block-paragraph">Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/master-cgdb-boost-your-debugging-with-gdbs-curses-interface-in-terminal/">Master CGDB: Boost Your Debugging with GDB’s Curses Interface in Terminal</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/master-cgdb-boost-your-debugging-with-gdbs-curses-interface-in-terminal/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Master GNU Debugger: Debug C++ &#038; Assembly Programs with GDB Like a Pro</title>
		<link>https://www.NeuralLantern.com/master-gnu-debugger-debug-c-assembly-programs-with-gdb-like-a-pro/</link>
					<comments>https://www.NeuralLantern.com/master-gnu-debugger-debug-c-assembly-programs-with-gdb-like-a-pro/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Sat, 14 Jun 2025 23:53:13 +0000</pubDate>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[assembly debugging]]></category>
		<category><![CDATA[assembly programming]]></category>
		<category><![CDATA[breakpoints]]></category>
		<category><![CDATA[c++ debugging]]></category>
		<category><![CDATA[C++ programming]]></category>
		<category><![CDATA[call stack]]></category>
		<category><![CDATA[coding for beginners]]></category>
		<category><![CDATA[coding tutorial]]></category>
		<category><![CDATA[debug symbols]]></category>
		<category><![CDATA[debugging tools]]></category>
		<category><![CDATA[GDB]]></category>
		<category><![CDATA[GNU Debugger]]></category>
		<category><![CDATA[null pointer]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software development]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=155</guid>

					<description><![CDATA[<p>Master GDB to debug C++ &#038; assembly! Learn breakpoints, call stacks, &#038; crash fixes in this fun guide for coders.</p>
<p>The post <a href="https://www.NeuralLantern.com/master-gnu-debugger-debug-c-assembly-programs-with-gdb-like-a-pro/">Master GNU Debugger: Debug C++ &amp; Assembly Programs with GDB Like a Pro</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Master GNU Debugger: Debug C++ &amp; Assembly Programs with GDB Like a Pro" width="1380" height="776" src="https://www.youtube.com/embed/lPcwsvSWak0?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p class="wp-block-paragraph">Hey everybody! Ready to crush those pesky bugs in your C++ and assembly programs? In this video, we’re diving deep into the GNU Debugger (GDB) – the ultimate tool for tracking down crashes, inspecting variables, and mastering your code. From setting up debug symbols to navigating call stacks, setting breakpoints, and even debugging assembly registers, this fun and relatable guide has you covered. Whether you’re a beginner coder or a seasoned dev, you’ll learn practical tips to level up your debugging game. We’ll also tackle null pointers, create GDB scripts, and explore why your program might be misbehaving. Stick around for a few laughs and some serious skills! Don’t forget to subscribe, hit that like button, and check out my website for more coding tutorials. Let’s debug like pros together!</p>



<p class="wp-block-paragraph">Introduction to GNU Debugger 00:00:00<br>What is a Debugger 00:00:20<br>Debug Symbols Explanation 00:02:08<br>Compiling with Debug Symbols 00:03:13<br>File Size Comparison 00:05:30<br>Installing and Launching GDB 00:06:21<br>GDB Console Basics 00:06:55<br>Attaching GDB to Program 00:08:12<br>Running Program in GDB 00:09:09<br>Handling Program Crash 00:13:02<br>Understanding Call Stack 00:14:05<br>Navigating Call Stack 00:18:13<br>Inspecting Variables 00:19:08<br>Null Pointer Issues 00:21:25<br>Using GDB Script 00:25:10<br>Setting Breakpoints 00:27:04<br>Managing Breakpoints 00:28:37<br>Continuing Execution 00:30:41<br>Debugging Assembly 00:33:24<br>Global Variables in Assembly 00:35:43<br>Advanced GDB Commands 00:38:31<br>Conclusion and Call to Action 00:40:22</p>



<p class="wp-block-paragraph">Thanks for watching!</p>



<p class="wp-block-paragraph">Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>
</ul>



<p class="wp-block-paragraph">Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p class="wp-block-paragraph">Hey everybody! In this video I&#8217;m going to show you how to use the GNU Debugger to</p>



<p class="wp-block-paragraph">debug your C++ and assembly programs.</p>



<p class="wp-block-paragraph">You can also use it for C and some other stuff but we&#8217;re just going to focus on</p>



<p class="wp-block-paragraph">C++ and assembly. What is the GNU Debugger and what is a debugger in the</p>



<p class="wp-block-paragraph">first place? So for starters the GNU Debugger it&#8217;s like it&#8217;s called GDB and</p>



<p class="wp-block-paragraph">the db you can imagine that stands for debugger something like that and the g stands for gnu i</p>



<p class="wp-block-paragraph">personally don&#8217;t know how to uh pronounce gnu so i just say gnu because it it feels more fun to do</p>



<p class="wp-block-paragraph">it that way it&#8217;s more interesting i think probably some people just say new but i don&#8217;t like that</p>



<p class="wp-block-paragraph">because the gdb debugger is really old and robust and powerful it&#8217;s not a new tool it&#8217;s it&#8217;s an old</p>



<p class="wp-block-paragraph">new debugger someone&#8217;s always going to ask what was the old debugger and then I say this is the</p>



<p class="wp-block-paragraph">old debugger the new debugger is the old debugger anyway so we&#8217;re going to use the GNU debugger</p>



<p class="wp-block-paragraph">if you haven&#8217;t yet watched my video on caveman debugging you probably want to watch that first</p>



<p class="wp-block-paragraph">just for like some basics of you know why you might want to look at information in your program</p>



<p class="wp-block-paragraph">but for now we&#8217;ll just assume that you already know what&#8217;s going on with just like why you would</p>



<p class="wp-block-paragraph">know how to make make files see my other videos but here i just have a basic make file all it&#8217;s</p>



<p class="wp-block-paragraph">really going to do is just sort of compile a very simple program and add debug symbols into it so</p>



<p class="wp-block-paragraph">let&#8217;s double check that i&#8217;m actually doing that here yeah there we go okay so the first thing</p>



<p class="wp-block-paragraph">that i should probably show you is uh we are compiling a c plus plus source module so i&#8217;ve</p>



<p class="wp-block-paragraph">actually using c but i i have that left over in there anyway and then we&#8217;re assembling something</p>



<p class="wp-block-paragraph">in yasm we&#8217;re linking with g plus plus because we want to have a hybrid program and we&#8217;ve got</p>



<p class="wp-block-paragraph">all these flags here those are just variables and so uh so now before i can debug with gdb</p>



<p class="wp-block-paragraph">i&#8217;ve got to talk about something called debug symbols what are debug symbols imagine just a</p>



<p class="wp-block-paragraph">bunch of extra information explaining all of the design and variables and everything inside of your</p>



<p class="wp-block-paragraph">about your code stuffed directly into the executable.</p>



<p class="wp-block-paragraph">So imagine, you know, when we compile a C++ source module</p>



<p class="wp-block-paragraph">into an object file, usually that&#8217;s just, you know,</p>



<p class="wp-block-paragraph">assembly at that point.</p>



<p class="wp-block-paragraph">But when we add debug symbols, we&#8217;ll have a bunch of information</p>



<p class="wp-block-paragraph">that can help the debugger figure out where we are in the program,</p>



<p class="wp-block-paragraph">what the variables look like, you know,</p>



<p class="wp-block-paragraph">a bunch of extra information to help the debugger pretty much.</p>



<p class="wp-block-paragraph">The assembler will put debug symbols into the object code</p>



<p class="wp-block-paragraph">symbols into the object code that you generate the compilers will do that the linker will do that</p>



<p class="wp-block-paragraph">and so it&#8217;s important to understand if you don&#8217;t generate debug symbols when you&#8217;re compiling and</p>



<p class="wp-block-paragraph">linking your code then your debugger won&#8217;t actually be able to do anything it won&#8217;t understand what&#8217;s</p>



<p class="wp-block-paragraph">going on you can debug it but like you&#8217;re not going to see anything that&#8217;s very uh that&#8217;s useful</p>



<p class="wp-block-paragraph">so let me show you real fast i&#8217;m going to do make clean and then i&#8217;m going to say make build</p>



<p class="wp-block-paragraph">that I do not have debug symbols.</p>



<p class="wp-block-paragraph">All right, okay, if you don&#8217;t know how to compile and link from the command line, see</p>



<p class="wp-block-paragraph">my other videos, but for now it looks like we&#8217;re not generating debug symbols.</p>



<p class="wp-block-paragraph">So if I list the contents of my directory here, just note the size is real fast.</p>



<p class="wp-block-paragraph">I have an assembly module here that I&#8217;m calling ASI.asm, ASI for assembly, and then we&#8217;re</p>



<p class="wp-block-paragraph">assembling it down to an object file.</p>



<p class="wp-block-paragraph">Notice how it&#8217;s just 656 bytes, very small.</p>



<p class="wp-block-paragraph">plus plus module that I&#8217;m creating here is compiling to an object file that is</p>



<p class="wp-block-paragraph">about four and a half kilobytes so you know not too big the final executable is</p>



<p class="wp-block-paragraph">called main and it&#8217;s about 17 kilobytes so this is without debug symbols when</p>



<p class="wp-block-paragraph">you&#8217;re compiling something on your own you need to add extra switches to enable</p>



<p class="wp-block-paragraph">debug symbols so you can see here in this make file that I&#8217;ve made and again if</p>



<p class="wp-block-paragraph">you don&#8217;t know how to make a make file or compile or link or anything see my</p>



<p class="wp-block-paragraph">But for now, I&#8217;m just going to assume you kind of know your way around to makefile,</p>



<p class="wp-block-paragraph">or at least you can kind of infer what&#8217;s going on.</p>



<p class="wp-block-paragraph">So I&#8217;ve commented out a different version of this variable for the flags of my C++ compiler.</p>



<p class="wp-block-paragraph">If I uncomment this and then comment out the other one,</p>



<p class="wp-block-paragraph">you&#8217;ll notice the only real difference is this part right here, dash G dwarf 2.</p>



<p class="wp-block-paragraph">Usually in C++ compilation, it&#8217;ll just be dash G to generate debug symbols,</p>



<p class="wp-block-paragraph">and then the symbol format will default to a format called dwarf2 so I don&#8217;t know for these</p>



<p class="wp-block-paragraph">tutorials I like to just specify the full format but you can just say dash g in your c++ compiler</p>



<p class="wp-block-paragraph">and linker we do the same thing for the linker down here so I&#8217;m going to uncomment this</p>



<p class="wp-block-paragraph">and comment that and the only difference is just g dwarf2 so I&#8217;m just telling my linker that I also</p>



<p class="wp-block-paragraph">want debug symbols in there too then we do the same thing for the assembler so I&#8217;m going to</p>



<p class="wp-block-paragraph">So I&#8217;m going to uncomment that and comment this other one.</p>



<p class="wp-block-paragraph">And the only difference is that in the assembler,</p>



<p class="wp-block-paragraph">we kind of have to specify it a little bit differently.</p>



<p class="wp-block-paragraph">Instead of G dwarf dash two,</p>



<p class="wp-block-paragraph">it&#8217;s just G dwarf two as just one string.</p>



<p class="wp-block-paragraph">And I think with Yasm, you have to specify the debug symbol format.</p>



<p class="wp-block-paragraph">So just keep that in mind.</p>



<p class="wp-block-paragraph">So now I&#8217;ve turned on all the debug symbols.</p>



<p class="wp-block-paragraph">I&#8217;m going to do real fast, make clean and make build one more time.</p>



<p class="wp-block-paragraph">And then if I list everything,</p>



<p class="wp-block-paragraph">list everything let me just double check that it&#8217;s building the symbols now right okay good</p>



<p class="wp-block-paragraph">notice that the files are bigger so this asio um file is now 1.8 kilobytes instead of you know</p>



<p class="wp-block-paragraph">half a kilobyte the main.o object file is now 36 kilobytes instead of only 4.5 and the executable</p>



<p class="wp-block-paragraph">main is 36 kilobytes instead of just 17. so you can feel it already right like there&#8217;s a bunch</p>



<p class="wp-block-paragraph">extra information sitting inside the object files and the binary which allows us to debug our program</p>



<p class="wp-block-paragraph">okay so now that we&#8217;ve generated debug symbols in our program we can actually think about starting</p>



<p class="wp-block-paragraph">to use gdb so gdb is a program just gdb by the command line if you don&#8217;t have it in your system</p>



<p class="wp-block-paragraph">already you can go sudo apt install gdb or depending on what system you&#8217;re on maybe a or</p>



<p class="wp-block-paragraph">or whatever your package management program is,</p>



<p class="wp-block-paragraph">but we just need to install GDB.</p>



<p class="wp-block-paragraph">On Ubuntu and Debian, I think,</p>



<p class="wp-block-paragraph">there is a meta package called build essential,</p>



<p class="wp-block-paragraph">which will give you a bunch of compilation tools</p>



<p class="wp-block-paragraph">and make file stuff and whatever.</p>



<p class="wp-block-paragraph">So I&#8217;m just going to assume at this point</p>



<p class="wp-block-paragraph">you already have GDB on your system.</p>



<p class="wp-block-paragraph">To launch GDB and go into its console,</p>



<p class="wp-block-paragraph">just type GDB by itself.</p>



<p class="wp-block-paragraph">So now we&#8217;re inside of the GDB console or terminal.</p>



<p class="wp-block-paragraph">console or terminal. We&#8217;re no longer inside of a bash terminal. We can&#8217;t type normal commands.</p>



<p class="wp-block-paragraph">Let me show you real fast. Here&#8217;s the first command you want to learn on GDB. It&#8217;s called</p>



<p class="wp-block-paragraph">quit. Never quit. Never surrender. So, you know, normally if you&#8217;re at the command line,</p>



<p class="wp-block-paragraph">you can do something like cat, etc. OS release just to see what operating system you&#8217;re using.</p>



<p class="wp-block-paragraph">So you can see for this virtual machine that I&#8217;m using right now, I&#8217;ve got like Ubuntu 22 on there.</p>



<p class="wp-block-paragraph">If we go inside of GDB, we can&#8217;t use regular bash commands anymore or regular operating</p>



<p class="wp-block-paragraph">system commands.</p>



<p class="wp-block-paragraph">We can&#8217;t say cat, et cetera, OS release because we can now only use GDB commands.</p>



<p class="wp-block-paragraph">We&#8217;re inside of GDB already.</p>



<p class="wp-block-paragraph">Notice how it says undefined catch command.</p>



<p class="wp-block-paragraph">I don&#8217;t know what you&#8217;re talking about, dude.</p>



<p class="wp-block-paragraph">Okay.</p>



<p class="wp-block-paragraph">So remember we do a Q or quit to get out.</p>



<p class="wp-block-paragraph">You can actually just type Q.</p>



<p class="wp-block-paragraph">A lot of commands that I&#8217;m going to be talking about.</p>



<p class="wp-block-paragraph">going to be talking about you can abbreviate them with one or two or three letters and it totally</p>



<p class="wp-block-paragraph">works just for speed so now that we know how to enter gdb and now that we also know that we have</p>



<p class="wp-block-paragraph">already compiled our program with debug symbols we can attach gdb to our program i mean what&#8217;s the</p>



<p class="wp-block-paragraph">whole point of a debugger we most of the time we will just have our debugger attached to our program</p>



<p class="wp-block-paragraph">and launch it or i guess launch it while it&#8217;s attached you can also attach to a running program</p>



<p class="wp-block-paragraph">but we&#8217;re going to launch a program and stay attached to it.</p>



<p class="wp-block-paragraph">And then we can sort of catch crashes and see what&#8217;s going on.</p>



<p class="wp-block-paragraph">Or we could also tell the debugger to stop the program at certain points in time,</p>



<p class="wp-block-paragraph">like when we hit a certain line number or when a variable changes or something like that.</p>



<p class="wp-block-paragraph">And then we can look around.</p>



<p class="wp-block-paragraph">We can look at all the variables, look at the state of the program,</p>



<p class="wp-block-paragraph">even change things if we wanted to.</p>



<p class="wp-block-paragraph">We can look at all the registers if you&#8217;re coding in assembly.</p>



<p class="wp-block-paragraph">So it&#8217;s pretty useful.</p>



<p class="wp-block-paragraph">Anyway, I&#8217;m going to go gdb and the next command we&#8217;re going to learn is file, which just tells</p>



<p class="wp-block-paragraph">gdb to attach to a program so that we can run it.</p>



<p class="wp-block-paragraph">So, you know, the name of our program here that we compiled is just called main.</p>



<p class="wp-block-paragraph">And so if I type file main, then gdb should load up that file and try to parse its debug</p>



<p class="wp-block-paragraph">symbols so it can begin debugging for you.</p>



<p class="wp-block-paragraph">Notice how it says reading symbols from main.</p>



<p class="wp-block-paragraph">you know if we did a typo or we had something with no debug symbols it will give us some sort</p>



<p class="wp-block-paragraph">of an error message so for now i&#8217;m just going to quit and then go back in just to make sure that</p>



<p class="wp-block-paragraph">it&#8217;s all clean and we&#8217;re going to do file main now it attaches once it&#8217;s attached that&#8217;s not i guess</p>



<p class="wp-block-paragraph">it&#8217;s not technically attached because the program&#8217;s not running but once it has loaded the debug</p>



<p class="wp-block-paragraph">symbols for that program we can run the program with the run command in gdb also kind of interesting</p>



<p class="wp-block-paragraph">If you have debug symbols that are generated separately from your executable,</p>



<p class="wp-block-paragraph">you could tell GDB to load the symbols file and then run your program.</p>



<p class="wp-block-paragraph">That happens a lot in Linux where people release the non-debug friendly version of a program</p>



<p class="wp-block-paragraph">and then they&#8217;ll release the debug symbols separately if you&#8217;re interested.</p>



<p class="wp-block-paragraph">Anyway, so I&#8217;m going to type run and it&#8217;ll run the program.</p>



<p class="wp-block-paragraph">Notice how GDB kind of tells us that it&#8217;s starting up now.</p>



<p class="wp-block-paragraph">here&#8217;s like a thread debugger that&#8217;s being enabled and it says we&#8217;re using this library to do it and</p>



<p class="wp-block-paragraph">then it says hello you know here&#8217;s the hello message so the program is actually running that&#8217;s</p>



<p class="wp-block-paragraph">not my name i wish it was and then it prints the final result and then gdb says your program exited</p>



<p class="wp-block-paragraph">normally on newer versions of gdb there&#8217;s a setting i think by default where it&#8217;ll ask you</p>



<p class="wp-block-paragraph">if you want to start a debug daemon a debug info daemon or something yes or no you can usually just</p>



<p class="wp-block-paragraph">without actually having to type n.</p>



<p class="wp-block-paragraph">It&#8217;s a little bit faster.</p>



<p class="wp-block-paragraph">So the whole program ran and finished.</p>



<p class="wp-block-paragraph">If I type run again, it does the same thing.</p>



<p class="wp-block-paragraph">In GDB, if you hit enter without typing anything,</p>



<p class="wp-block-paragraph">it ends up repeating the previous command.</p>



<p class="wp-block-paragraph">So I&#8217;m not going to type run.</p>



<p class="wp-block-paragraph">If I just hit enter, are you serious?</p>



<p class="wp-block-paragraph">GDB made me into a liar.</p>



<p class="wp-block-paragraph">Well, most of the commands will repeat if you hit enter.</p>



<p class="wp-block-paragraph">I guess not the run command.</p>



<p class="wp-block-paragraph">So I&#8217;ll type run again.</p>



<p class="wp-block-paragraph">And okay, I mean, the program is pretty good, right?</p>



<p class="wp-block-paragraph">So if you watched my…</p>



<p class="wp-block-paragraph">It&#8217;s not pretty good.</p>



<p class="wp-block-paragraph">watched my it&#8217;s not pretty good it&#8217;s a nonsense program I mean it it doesn&#8217;t crash is what I&#8217;m</p>



<p class="wp-block-paragraph">saying if you watched my previous video which you should on caveman debugging I had this uh you know</p>



<p class="wp-block-paragraph">nonsense portion of code that just sort of updated a variable and we pretended that we were confused</p>



<p class="wp-block-paragraph">and we didn&#8217;t understand what was happening and uh we used gdb to debug it so what I&#8217;m going to do</p>



<p class="wp-block-paragraph">either let&#8217;s say we&#8217;ll start off with throwing an exception and then we&#8217;ll try to use a no pointer</p>



<p class="wp-block-paragraph">and then we&#8217;ll see a crash and then after that I&#8217;m going to start using breakpoints where we can stop</p>



<p class="wp-block-paragraph">automatically inside of our program to print the state of the program print the variables</p>



<p class="wp-block-paragraph">and then I&#8217;m going to do that first in C++ and then hopefully I&#8217;ll remember to do that in</p>



<p class="wp-block-paragraph">assembly right after it&#8217;s basically the same thing only with assembly you don&#8217;t really have</p>



<p class="wp-block-paragraph">you know a bunch of variables everywhere you just kind of have registers and maybe some globals</p>



<p class="wp-block-paragraph">globals but it&#8217;s going to be the same deal okay so let&#8217;s pretend that uh we are gonna have a crash</p>



<p class="wp-block-paragraph">okay so this program just kind of runs later on we&#8217;ll figure out why the result is wrong we&#8217;ll</p>



<p class="wp-block-paragraph">just pretend that it&#8217;s wrong but for now we&#8217;ll just say how about we uncomment this line right</p>



<p class="wp-block-paragraph">here and what will happen is when we&#8217;re running the main loop at some point in the loop we get</p>



<p class="wp-block-paragraph">When F gets called, the input will be looked at here.</p>



<p class="wp-block-paragraph">And if the input is more than one,</p>



<p class="wp-block-paragraph">which is definitely gonna happen like right away,</p>



<p class="wp-block-paragraph">then we&#8217;ll call on the G function.</p>



<p class="wp-block-paragraph">Then the G function will just throw an exception.</p>



<p class="wp-block-paragraph">We&#8217;ll just pretend that something really bad happened.</p>



<p class="wp-block-paragraph">You crashed or you actually did throw</p>



<p class="wp-block-paragraph">and you didn&#8217;t catch your throw,</p>



<p class="wp-block-paragraph">or maybe the system threw something at you</p>



<p class="wp-block-paragraph">or another library threw something at you</p>



<p class="wp-block-paragraph">and you didn&#8217;t catch it.</p>



<p class="wp-block-paragraph">So just basically a program crash.</p>



<p class="wp-block-paragraph">Let me run this real fast.</p>



<p class="wp-block-paragraph">So make run just to show you that the program crashes.</p>



<p class="wp-block-paragraph">Make run at this point is the same thing as just kind of executing the program.</p>



<p class="wp-block-paragraph">But you can see that it says terminate called after throwing an instance of runtime error.</p>



<p class="wp-block-paragraph">And then there&#8217;s the message, oh my gosh, and then aborted core dumped.</p>



<p class="wp-block-paragraph">That&#8217;s not good.</p>



<p class="wp-block-paragraph">So now let&#8217;s try to understand why.</p>



<p class="wp-block-paragraph">Why did that crash?</p>



<p class="wp-block-paragraph">Pretend you don&#8217;t know that it happened in G. You know, you&#8217;re trying to investigate.</p>



<p class="wp-block-paragraph">So we could type GDB and then we could type a file to load the debug symbols, but it&#8217;s a little bit faster just to type GDB main and just sort of name the file that you want to load right away.</p>



<p class="wp-block-paragraph">So if I do that, notice how it automatically tries to load the debug symbols from main.</p>



<p class="wp-block-paragraph">Then I can just type run and then the program tries to run and notice how it actually catches the crash.</p>



<p class="wp-block-paragraph">If you look down here, terminate called after throwing an instance of runtime error.</p>



<p class="wp-block-paragraph">throwing an instance of runtime error so that&#8217;s what the program thinks is going on but then the</p>



<p class="wp-block-paragraph">program is trying to terminate but then down here gdb is like wait wait wait i just caught you know</p>



<p class="wp-block-paragraph">a termination uh getting invoked here and you can see this is sort of system code like we did not</p>



<p class="wp-block-paragraph">create this source file p thread kill we didn&#8217;t write that that&#8217;s the standard library and there&#8217;s</p>



<p class="wp-block-paragraph">a function here called p thread kill implementation with those you know fun c underscore prefixes</p>



<p class="wp-block-paragraph">prefixes everywhere and so this is like some sort of a c source file and we don&#8217;t have that file on</p>



<p class="wp-block-paragraph">the system so we can&#8217;t really debug that file lucky for you most of these standard libraries</p>



<p class="wp-block-paragraph">work all the time so you don&#8217;t really need to debug them you need to debug your code instead</p>



<p class="wp-block-paragraph">of the standard library code so the question really is how did i get here how did i get to</p>



<p class="wp-block-paragraph">this crash so the next command we&#8217;ll learn in gdb is just the where command the where command will</p>



<p class="wp-block-paragraph">I&#8217;m going to release a video in the future that kind of explains call stacks, but basically</p>



<p class="wp-block-paragraph">imagine a abstract data type, a data structure called a stack. And every time you want to add</p>



<p class="wp-block-paragraph">data to the stack, it just sort of stacks up on top of the last piece of data. So like if I add</p>



<p class="wp-block-paragraph">something, let&#8217;s say I want to add the number five, then I would just add the number five on top of</p>



<p class="wp-block-paragraph">the stack, right? If I wanted to add the number 11, then I would just add the number 11 onto the</p>



<p class="wp-block-paragraph">off of the stack and the stack is a really good data structure to uh sort of give you a trail of</p>



<p class="wp-block-paragraph">breadcrumbs to know where you got where did you come from so we call this the call stack because</p>



<p class="wp-block-paragraph">what&#8217;s happening is every single time you call a function then the new scope and then you know the</p>



<p class="wp-block-paragraph">new function that you&#8217;re invoking um it has something called a call frame full of information</p>



<p class="wp-block-paragraph">current address is and all that stuff.</p>



<p class="wp-block-paragraph">And we&#8217;ll just call that chunk of data that belongs to one instance of a function call.</p>



<p class="wp-block-paragraph">We&#8217;ll just call that a call frame.</p>



<p class="wp-block-paragraph">And so if you&#8217;re stacking call frames one on top of the other,</p>



<p class="wp-block-paragraph">then we call that whole entire thing the call stack.</p>



<p class="wp-block-paragraph">And this is what allows us to use recursion and all these complicated call graphs and everything.</p>



<p class="wp-block-paragraph">It&#8217;s really simple, but it&#8217;s really powerful.</p>



<p class="wp-block-paragraph">So you&#8217;re looking at the call stack.</p>



<p class="wp-block-paragraph">Each one of these lines is the call frame or is a call frame.</p>



<p class="wp-block-paragraph">And so for example, if you just look at number zero here, you&#8217;re looking at call frame zero,</p>



<p class="wp-block-paragraph">which is the closest frame to wherever the crash occurred, which is if you look at it,</p>



<p class="wp-block-paragraph">that&#8217;s exactly what we were looking at when we saw that original message, right? Call frame zero.</p>



<p class="wp-block-paragraph">So that&#8217;s not really useful. You want to go down to higher numbered call frames or I guess</p>



<p class="wp-block-paragraph">physically lowered number call frames and just kind of scan it until you find some code that</p>



<p class="wp-block-paragraph">raise no abort no none of this stuff is ours live standard c plus plus no the first frame that</p>



<p class="wp-block-paragraph">contains code that is ours is call frame number nine or i guess like nine away from our current</p>



<p class="wp-block-paragraph">position so i guess find the physically highest call frame that is your code or the lowest numbered</p>



<p class="wp-block-paragraph">call frame that is your code and it&#8217;s telling us right here all right we uh we actually seem to</p>



<p class="wp-block-paragraph">So if I go to 65, right there, it tells you exactly where the crash happened.</p>



<p class="wp-block-paragraph">If you&#8217;re still trying to figure out, well, how did I get to that crash?</p>



<p class="wp-block-paragraph">I don&#8217;t know how that actually happened.</p>



<p class="wp-block-paragraph">Just keep looking down further in the call frames.</p>



<p class="wp-block-paragraph">The next one, call frame 10, says, well, we were inside of function f with input equals</p>



<p class="wp-block-paragraph">three at main.cpb line 46.</p>



<p class="wp-block-paragraph">So if I just go to 46, I can get another clue.</p>



<p class="wp-block-paragraph">I can go, all right, so for some reason we called g.</p>



<p class="wp-block-paragraph">Imagine again, this program is much more complicated.</p>



<p class="wp-block-paragraph">And then if we&#8217;re still confused, we just look down at another one and it&#8217;s like, well, this all this whole mess started at CPP main dot CPP line 28.</p>



<p class="wp-block-paragraph">So if we look at line 28, it&#8217;s like, well, we were inside of this loop and we we called the F function and then the F function called the G function.</p>



<p class="wp-block-paragraph">And then G just kind of did a throw. So that gives us a lot of information.</p>



<p class="wp-block-paragraph">All right. Next thing we can do is we can sort of move up and down the call stack, because right now we&#8217;re sitting at call frame zero, which is just the system code.</p>



<p class="wp-block-paragraph">which is just the system code, but maybe we don&#8217;t understand why the throw actually happened at,</p>



<p class="wp-block-paragraph">let&#8217;s say, line 65, right? So we can use up to go up in the call stack to a different call frame.</p>



<p class="wp-block-paragraph">So if I hit up, notice how it mentions that we&#8217;re now in frame number one instead of zero.</p>



<p class="wp-block-paragraph">And if I do up again, we&#8217;re now in frame two, which is a little bit closer. We can use the</p>



<p class="wp-block-paragraph">trick finally where we hit the enter key instead of repeating the command. So I&#8217;m just going to</p>



<p class="wp-block-paragraph">and hit enter a couple times until we eventually get to our code,</p>



<p class="wp-block-paragraph">which I think was supposed to be at frame nine.</p>



<p class="wp-block-paragraph">So I&#8217;m just going to hit it a bunch of times until we get to frame nine.</p>



<p class="wp-block-paragraph">Now we&#8217;re looking sort of back in time at that point</p>



<p class="wp-block-paragraph">because all these other frames actually did get invoked,</p>



<p class="wp-block-paragraph">but we don&#8217;t really care about what was going on inside of them</p>



<p class="wp-block-paragraph">because they probably did their job correctly.</p>



<p class="wp-block-paragraph">We&#8217;re looking at our code, so we&#8217;re going back in time</p>



<p class="wp-block-paragraph">right when we were doing this throw.</p>



<p class="wp-block-paragraph">Oh no, we threw. Why did we throw?</p>



<p class="wp-block-paragraph">well there&#8217;s another command in gdb called info locals</p>



<p class="wp-block-paragraph">okay the info locals uh there&#8217;s there&#8217;s really not much to this maybe maybe let me do this again</p>



<p class="wp-block-paragraph">a equals five and uh then i&#8217;ll just say a plus plus just so that we have a local variable</p>



<p class="wp-block-paragraph">i forgot that gdb doesn&#8217;t consider the incoming arguments as locals so there was nothing there</p>



<p class="wp-block-paragraph">real fast uh gdp oh let&#8217;s do make build and then gdp main and then run and then we have a throw</p>



<p class="wp-block-paragraph">and then i say where and then i go up up up up to a frame you can also use the keyword down if you</p>



<p class="wp-block-paragraph">go too far if you want to go you know back down in the call stack but i&#8217;m just going to use up</p>



<p class="wp-block-paragraph">okay so now we have it here now finally i think i can do info locals just to see the local variables</p>



<p class="wp-block-paragraph">notice how the a variable is there now because I just added a local variable a a moment ago</p>



<p class="wp-block-paragraph">you can also print things directly you can say print the input incoming variable if you&#8217;re in</p>



<p class="wp-block-paragraph">assembly you can also print registers you can say info registers like that and you&#8217;ll get a nice</p>



<p class="wp-block-paragraph">print out of all the registers you could print individual registers you can say let&#8217;s print</p>



<p class="wp-block-paragraph">register r12 you can print register r12 as binary by saying I think it&#8217;s p slash t</p>



<p class="wp-block-paragraph">or print slash t yeah we can probably just do print slash t also</p>



<p class="wp-block-paragraph">t stands for two because they&#8217;re it&#8217;s a base two number system</p>



<p class="wp-block-paragraph">does that mean there&#8217;s a p slash h or a p slash f for 15 or 16 s for 16 i don&#8217;t know i haven&#8217;t</p>



<p class="wp-block-paragraph">tried that is it going to work hang on p slash s bar 12 it&#8217;s not going to work nope didn&#8217;t work</p>



<p class="wp-block-paragraph">i think it thinks it&#8217;s a character point or something but anyway so we can print a lot of</p>



<p class="wp-block-paragraph">So we can print a lot of stuff.</p>



<p class="wp-block-paragraph">And like I said before, we can go up and down the call stack.</p>



<p class="wp-block-paragraph">So I can go down a couple times and then go back up again.</p>



<p class="wp-block-paragraph">And now we can assume that we&#8217;ve kind of debugged, you know, where the source of the error was.</p>



<p class="wp-block-paragraph">So I&#8217;m going to comment that call out to G and run the program again one more time with a different error.</p>



<p class="wp-block-paragraph">So I&#8217;ve commented this code out from before, but just imagine now that we&#8217;re going to use some pointers.</p>



<p class="wp-block-paragraph">We&#8217;re going to start off with a pointer called P.</p>



<p class="wp-block-paragraph">a pointer called p we&#8217;re going to set it to null at the beginning and then we&#8217;re going to just</p>



<p class="wp-block-paragraph">kind of allocate it and then we&#8217;re going to set you know a value and then we&#8217;re going to dereference</p>



<p class="wp-block-paragraph">it and dereferencing a pointer just kind of sets the first value in an array you can do that and</p>



<p class="wp-block-paragraph">then we&#8217;re going to deallocate the pointer and then how about right after that we do something</p>



<p class="wp-block-paragraph">really really naughty we say p at some index is equal to a five this should be this should be a</p>



<p class="wp-block-paragraph">a program crash because we deallocated p already at that point we would be dealing with junk data</p>



<p class="wp-block-paragraph">if we tried to dereference p but to make it even more clear that it&#8217;s naughty we&#8217;ll set it to a no</p>



<p class="wp-block-paragraph">pointer and then we&#8217;ll try to actually use it so let me let me just restart the program real fast</p>



<p class="wp-block-paragraph">i&#8217;m gonna do quit yes and then we&#8217;ll do make a debug just so you know my make debug is just a</p>



<p class="wp-block-paragraph">Let&#8217;s see, where&#8217;s that? Where&#8217;s that? Where&#8217;s that? Do I not have a debug shortcut yet?</p>



<p class="wp-block-paragraph">Oh dear. I need to add that before this video is over. You know what? I&#8217;ll add it right now.</p>



<p class="wp-block-paragraph">We&#8217;ll do this run and we&#8217;ll say debug, make debug, and it needs to build first. And then I&#8217;ll say</p>



<p class="wp-block-paragraph">debugging the program. And then we will do the GDB binary and give it an argument of</p>



<p class="wp-block-paragraph">the executable and then later we can we can upgrade this to take a little script of commands</p>



<p class="wp-block-paragraph">because the commands are going to start getting out of control so now if i do make debug if i</p>



<p class="wp-block-paragraph">didn&#8217;t screw it up now it at least goes in there and i&#8217;ll do run and then we have a seg fault and</p>



<p class="wp-block-paragraph">notice how it tells us right away hey you have a seg fault right here you&#8217;re accessing invalid</p>



<p class="wp-block-paragraph">memory let&#8217;s do info locals just to see what&#8217;s up oh the p is actually a zero that&#8217;s a null pointer</p>



<p class="wp-block-paragraph">explicitly oh whoops you know oh what have I done but it&#8217;s a really good idea to set your</p>



<p class="wp-block-paragraph">pointers to null after you deallocate because if you don&#8217;t you might end up with undefined</p>



<p class="wp-block-paragraph">behavior where sometimes the program doesn&#8217;t crash while you&#8217;re overriding junk data or reading junk</p>



<p class="wp-block-paragraph">data but sometimes it does and you&#8217;re not really sure like why does it work sometimes and why does</p>



<p class="wp-block-paragraph">it not work sometimes so let me comment this out and see if it&#8217;ll crash uh let&#8217;s just let&#8217;s just</p>



<p class="wp-block-paragraph">make debug and then i&#8217;ll do run and then if we do info locals oh yeah okay so this is uh</p>



<p class="wp-block-paragraph">it did seg fault so that&#8217;s good uh if we were unlucky then the program wouldn&#8217;t have crashed</p>



<p class="wp-block-paragraph">it would have just started behaving strangely and um when we print out the value of p notice how it</p>



<p class="wp-block-paragraph">looks like a pointer still like if we were to debug the program and print the pointer value</p>



<p class="wp-block-paragraph">then it doesn&#8217;t really it looks the same it looks the same after we deallocated it right so that</p>



<p class="wp-block-paragraph">this is called a dangling pointer meaning you deallocated the pointer but you forgot to set</p>



<p class="wp-block-paragraph">it to null afterwards so then later when you&#8217;re trying to debug the program it&#8217;s a little confusing</p>



<p class="wp-block-paragraph">because you&#8217;re like that looks like a regular pointer what did i do wrong so um it&#8217;s really</p>



<p class="wp-block-paragraph">good practice to set your pointers to null right after you deallocate them that way when you&#8217;re</p>



<p class="wp-block-paragraph">debugging later because something crashed instead of seeing a memory location on p you&#8217;ll see</p>



<p class="wp-block-paragraph">On P, you&#8217;ll see something that looks definitely like a null pointer and print P.</p>



<p class="wp-block-paragraph">Then it&#8217;s way easier to realize, oh, whoops, I was trying to use a dead pointer, a pointer that I deallocated.</p>



<p class="wp-block-paragraph">Hopefully that makes sense so far.</p>



<p class="wp-block-paragraph">Next thing I want to do is a small upgrade.</p>



<p class="wp-block-paragraph">I can&#8217;t remember if it&#8217;s dash X or dash EX.</p>



<p class="wp-block-paragraph">I think it&#8217;s dash X.</p>



<p class="wp-block-paragraph">But you can write a little script.</p>



<p class="wp-block-paragraph">I have a little script here called Good Doggo.</p>



<p class="wp-block-paragraph">called good doggo you can just make any file name it anything you want i&#8217;m so i&#8217;m just naming it</p>



<p class="wp-block-paragraph">good doggo.txt because my dog&#8217;s taking a little nap behind me as usual um but you could name this</p>



<p class="wp-block-paragraph">gdb.txt or whatever it is you want so you can put inside of this script file any command that you</p>



<p class="wp-block-paragraph">want gdb to execute when it launches so let&#8217;s just comment this stuff out real fast and i&#8217;ll do</p>



<p class="wp-block-paragraph">I&#8217;ll just do run maybe for starters.</p>



<p class="wp-block-paragraph">Because whenever I&#8217;ve been launching for debug,</p>



<p class="wp-block-paragraph">I launch with GDB and then I type run manually, right?</p>



<p class="wp-block-paragraph">So I want to save a little time.</p>



<p class="wp-block-paragraph">So good doggo is the name of the script.</p>



<p class="wp-block-paragraph">So when I invoke GDB, I am going to,</p>



<p class="wp-block-paragraph">where is it right there?</p>



<p class="wp-block-paragraph">Okay, it&#8217;s GDB.</p>



<p class="wp-block-paragraph">And then I&#8217;m going to go dot, I think it&#8217;s X.</p>



<p class="wp-block-paragraph">And then I&#8217;m going to say good doggo.txt.</p>



<p class="wp-block-paragraph">If it&#8217;s not dash x, then it&#8217;s dash ex.</p>



<p class="wp-block-paragraph">One of those executes the command that comes after,</p>



<p class="wp-block-paragraph">and one of those executes the command script that comes after.</p>



<p class="wp-block-paragraph">Let me just double check that this actually is going to work.</p>



<p class="wp-block-paragraph">So make debug.</p>



<p class="wp-block-paragraph">All right, okay, so it was dash x.</p>



<p class="wp-block-paragraph">Dash x specifies a script that will be run.</p>



<p class="wp-block-paragraph">Dash ex just specifies a command that you can put right in there.</p>



<p class="wp-block-paragraph">Like I could have said dash ex run, and it would have ran right away.</p>



<p class="wp-block-paragraph">But the script is more convenient, right?</p>



<p class="wp-block-paragraph">Because we can save typing.</p>



<p class="wp-block-paragraph">So notice how it ran right away and then there&#8217;s a seg fault.</p>



<p class="wp-block-paragraph">Okay, so now let&#8217;s go a little bit deeper.</p>



<p class="wp-block-paragraph">Let&#8217;s change this to false again now that we understand like null pointers and all that</p>



<p class="wp-block-paragraph">stuff.</p>



<p class="wp-block-paragraph">So we can just basically deal a little bit more with only what the main loop is doing.</p>



<p class="wp-block-paragraph">Suppose we just still don&#8217;t really understand what the loop is doing, why our answer is</p>



<p class="wp-block-paragraph">you know, good or bad.</p>



<p class="wp-block-paragraph">So maybe I want to do a breakpoint at the top of that for loop.</p>



<p class="wp-block-paragraph">loop gets to the top of its iteration, I want the program to pause so I can look around.</p>



<p class="wp-block-paragraph">So I&#8217;m going to set up a breakpoint on line 22. And here&#8217;s how you set up breakpoints</p>



<p class="wp-block-paragraph">in GDB. I&#8217;m going to go ahead and maybe do the terminal for now. And then I&#8217;ll stick that into</p>



<p class="wp-block-paragraph">the script next. I will not remember that it&#8217;s line 22. That&#8217;s okay. I&#8217;m going to do quit.</p>



<p class="wp-block-paragraph">And I&#8217;m going to do make build. Then I&#8217;m going to go GDB main just to jump in there.</p>



<p class="wp-block-paragraph">and then i&#8217;m going to say break or just the letter b just to make a break point you type the name of</p>



<p class="wp-block-paragraph">the source code file that you want to break in and then a colon and then the line number where</p>



<p class="wp-block-paragraph">you want it to break so i think i think it actually was line 22 oh i can see it and then</p>



<p class="wp-block-paragraph">maybe i want to have it break at line i don&#8217;t know maybe right here line 25 right before it increases</p>



<p class="wp-block-paragraph">And then so I&#8217;m going to do an up arrow to just repeat the command so I can edit it real fast.</p>



<p class="wp-block-paragraph">And then I&#8217;ll break again at line 28 and then maybe 30 and then 32.</p>



<p class="wp-block-paragraph">So I&#8217;m going to go 28, 30 and 32.</p>



<p class="wp-block-paragraph">30 and I&#8217;m just making up break points.</p>



<p class="wp-block-paragraph">I just want to inspect the program and then maybe I&#8217;ll break at line 36 so I can see what the final answer is.</p>



<p class="wp-block-paragraph">So I just have a bunch of break points set up.</p>



<p class="wp-block-paragraph">Remember when the program is running now under GDB, every time it hits one of those lines,</p>



<p class="wp-block-paragraph">every time it hits one of those lines the program will pause and i&#8217;ll have a chance to look around</p>



<p class="wp-block-paragraph">at the variables and things so i&#8217;m not sure if i&#8217;ve set up the breakpoints correctly i can say</p>



<p class="wp-block-paragraph">info breakpoints and it&#8217;ll show me all of my breakpoints notice how you can enable them and</p>



<p class="wp-block-paragraph">disable them so let&#8217;s say for the sake of argument i want to disable the breakpoint at line 30 because</p>



<p class="wp-block-paragraph">maybe i don&#8217;t really need that right now but i kind of want to keep it in the system for later</p>



<p class="wp-block-paragraph">disable four because it&#8217;s number four.</p>



<p class="wp-block-paragraph">It&#8217;s breakpoint number four.</p>



<p class="wp-block-paragraph">So I can say disable four.</p>



<p class="wp-block-paragraph">Then if I do info breakpoints again,</p>



<p class="wp-block-paragraph">notice how there&#8217;s a little N on there,</p>



<p class="wp-block-paragraph">meaning breakpoint four is disabled.</p>



<p class="wp-block-paragraph">So I could re-enable it with a four</p>



<p class="wp-block-paragraph">and then go info breakpoints again.</p>



<p class="wp-block-paragraph">So now they&#8217;re all enabled.</p>



<p class="wp-block-paragraph">I am going to maybe copy this into the script file real fast</p>



<p class="wp-block-paragraph">so I don&#8217;t have to keep typing this over and over and over again.</p>



<p class="wp-block-paragraph">Imagine if every single time you changed your program and recompiled it you had to type all of the breakpoints from scratch</p>



<p class="wp-block-paragraph">That&#8217;s why I want you to use this little breakpoint script</p>



<p class="wp-block-paragraph">So we&#8217;re going to do B to break at main.cpp line 22 and 25 and</p>



<p class="wp-block-paragraph">28 and</p>



<p class="wp-block-paragraph">30 and 32. I should have copy pasted the three dang it 36</p>



<p class="wp-block-paragraph">And after we&#8217;re done setting up all the breakpoints</p>



<p class="wp-block-paragraph">show me the breakpoints just so I can have a visual reminder. Keep in mind if you change too</p>



<p class="wp-block-paragraph">much of your source code then you&#8217;re probably going to have to update these lines and that&#8217;s</p>



<p class="wp-block-paragraph">okay but it&#8217;s a good idea to just at least you know kind of look at them a little bit so that&#8217;s</p>



<p class="wp-block-paragraph">why I&#8217;m saying info breakpoints. And so then remember again the makefile all it&#8217;s doing when</p>



<p class="wp-block-paragraph">I type make debug is it&#8217;s just launching this command right here it&#8217;s just saying gdb with the</p>



<p class="wp-block-paragraph">with my gdb script so let me quit to get out of this and then i&#8217;m going to say clear and make</p>



<p class="wp-block-paragraph">debug and notice how it did all that stuff for me it added the breakpoints it showed me the break</p>



<p class="wp-block-paragraph">points and then it ran the program like i told it to and then it already broke on a breakpoint it</p>



<p class="wp-block-paragraph">already break it break breakened it&#8217;s broken i don&#8217;t know i don&#8217;t think it&#8217;s broken uh so we&#8217;re</p>



<p class="wp-block-paragraph">So we&#8217;re on breakpoint number one on line 22.</p>



<p class="wp-block-paragraph">And here&#8217;s the for loop.</p>



<p class="wp-block-paragraph">I can type all of my inspection stuff.</p>



<p class="wp-block-paragraph">I can say info locals.</p>



<p class="wp-block-paragraph">I can say print I, I can say print A, I can print whatever I want.</p>



<p class="wp-block-paragraph">And then when I&#8217;m done kind of looking around and inspecting things,</p>



<p class="wp-block-paragraph">I want to continue the program.</p>



<p class="wp-block-paragraph">I don&#8217;t want to just stop it here.</p>



<p class="wp-block-paragraph">So I&#8217;m just going to use the command continue.</p>



<p class="wp-block-paragraph">And it goes right to the next breakpoint.</p>



<p class="wp-block-paragraph">If I want to, you know, continue again, I can hit C.</p>



<p class="wp-block-paragraph">continue again i can hit c or i can just hit enter you know to just sort of keep continuing as i</p>



<p class="wp-block-paragraph">inspect and print things let&#8217;s see when can i get to break point number one is that what&#8217;s going on</p>



<p class="wp-block-paragraph">here hang on a second what is break point number one oh i know what to do info break points</p>



<p class="wp-block-paragraph">break point number one is that main.cpp line 22 is that actually going to get hit oh it&#8217;s</p>



<p class="wp-block-paragraph">having issues here with my GUI. Okay. Line 22. Okay. So it&#8217;s not really hitting that anymore.</p>



<p class="wp-block-paragraph">I guess it&#8217;s not going to think that it hits the top of the forelip. Okay. So I guess breakpoint</p>



<p class="wp-block-paragraph">two is where we&#8217;re always going to be hitting. So let&#8217;s just suppose that I&#8217;m continuing until</p>



<p class="wp-block-paragraph">I hit breakpoint number two. Suppose that the next 10 times I see breakpoint two, I don&#8217;t</p>



<p class="wp-block-paragraph">actually want to stop and break on it. I just want to skip the next 10 iterations for some reason.</p>



<p class="wp-block-paragraph">some reason you can say continue 10 and it&#8217;ll skip the next 10 times that it hits the number two</p>



<p class="wp-block-paragraph">notice how if i hit continue a bunch of times we&#8217;re not really seeing the break point number</p>



<p class="wp-block-paragraph">two anymore we&#8217;re seeing other break points and then eventually if i hit it enough times</p>



<p class="wp-block-paragraph">we&#8217;ll probably see two again oh my god oh my god are we seeing it yet no</p>



<p class="wp-block-paragraph">Okay, wait, are we seeing I&#8217;m freaking myself out.</p>



<p class="wp-block-paragraph">Okay, so let&#8217;s continue 10 times on breakpoint three, then we&#8217;ll only see</p>



<p class="wp-block-paragraph">breakpoint four, I guess.</p>



<p class="wp-block-paragraph">So we can do continue 10 times on breakpoint four.</p>



<p class="wp-block-paragraph">What is going on here?</p>



<p class="wp-block-paragraph">Did I write this program in a weird way?</p>



<p class="wp-block-paragraph">Hmm.</p>



<p class="wp-block-paragraph">Well, trust me on this.</p>



<p class="wp-block-paragraph">Let&#8217;s continue 100 on breakpoint three and then continue 100 on breakpoint four.</p>



<p class="wp-block-paragraph">breakpoint 4. Okay, so now we&#8217;re just done with the whole entire program. I guess there must have</p>



<p class="wp-block-paragraph">been a 2 there that I missed. So now we&#8217;re finally on breakpoint 6, which is when everything is</p>



<p class="wp-block-paragraph">finished. Let me show you real fast that we can add more breakpoints in assembly just to prove</p>



<p class="wp-block-paragraph">that we can debug assembly real fast. So if I want to debug assembly, I just have to type the name of</p>



<p class="wp-block-paragraph">that source code file. If it was nested in a folder, like if you had like a complicated hierarchy of</p>



<p class="wp-block-paragraph">of source code files you would just need to type the relative path but for now I&#8217;m just going to</p>



<p class="wp-block-paragraph">be able to type the name of the file so assy.asm and let&#8217;s suppose that I want to break at line</p>



<p class="wp-block-paragraph">16 just so I can see the registers that I set up so I&#8217;m going to do 16 and then I&#8217;m going to break</p>



<p class="wp-block-paragraph">at assy.asm line 16 and then I&#8217;m going to run and that actually never gets called does it no no it</p>



<p class="wp-block-paragraph">called does it no no it gets called I think I have a call up here somewhere</p>



<p class="wp-block-paragraph">nope I don&#8217;t have a call okay let&#8217;s make a call this is gonna throw off all of my</p>



<p class="wp-block-paragraph">C++ breakpoints so I&#8217;ll just comment them all out right now comment them all</p>



<p class="wp-block-paragraph">out so I don&#8217;t have to redo them and this is a hybrid program so I&#8217;m gonna go</p>



<p class="wp-block-paragraph">extern what is it extern C make a block where I name the function the reason we</p>



<p class="wp-block-paragraph">name mangling so the AC symbol is going to show up as just its regular function</p>



<p class="wp-block-paragraph">name rather than a bunch of extra stuff indicating the prototype so that we can</p>



<p class="wp-block-paragraph">do overloading so we&#8217;re just going to disable that and then at the very top of</p>



<p class="wp-block-paragraph">the program I&#8217;m just going to call it this should hopefully work let me just</p>



<p class="wp-block-paragraph">do a regular make run just to make sure the whole program compiles okay now</p>



<p class="wp-block-paragraph">debug script we&#8217;re gonna break on line 16 which is going to be letting us see</p>



<p class="wp-block-paragraph">the registers okay so I&#8217;m gonna go make debug notice how it hit the breakpoint</p>



<p class="wp-block-paragraph">in the assembly just the same as the C++ and we can print whatever we want now so</p>



<p class="wp-block-paragraph">I&#8217;m just gonna say info registers and if we look carefully we can kind of see</p>



<p class="wp-block-paragraph">that we modified racks REX is 15 so that&#8217;s expected RDI is 20 which is</p>



<p class="wp-block-paragraph">R12 should be a giant number. Where&#8217;s R12? Right there. So you can see the state of your program at any point in time just by breaking on it.</p>



<p class="wp-block-paragraph">I&#8217;m breaking on a certain line. So this is tremendously useful for debugging not just for higher level languages but also assembly.</p>



<p class="wp-block-paragraph">What else can I do? Oh let&#8217;s put a global in the data section. So I&#8217;m gonna do, I don&#8217;t know, my thing or something like that and we&#8217;ll call it a byte array and I&#8217;ll just go hello.</p>



<p class="wp-block-paragraph">I&#8217;ll say we have a thing one and a thing two.</p>



<p class="wp-block-paragraph">Something like that.</p>



<p class="wp-block-paragraph">And maybe thing two is a null terminated string,</p>



<p class="wp-block-paragraph">whereas thing one is a regular thing.</p>



<p class="wp-block-paragraph">We should be able to print those symbols.</p>



<p class="wp-block-paragraph">If that&#8217;s not true, I&#8217;ll come back at a later time</p>



<p class="wp-block-paragraph">and show you how to do it.</p>



<p class="wp-block-paragraph">Anyway, so we&#8217;ll do make debug</p>



<p class="wp-block-paragraph">to just kind of assemble everything again.</p>



<p class="wp-block-paragraph">And we know how to do info registers.</p>



<p class="wp-block-paragraph">We can print, you know, one register in particular,</p>



<p class="wp-block-paragraph">print R12 if we wanted to.</p>



<p class="wp-block-paragraph">History has not reached.</p>



<p class="wp-block-paragraph">History has not reached 12.</p>



<p class="wp-block-paragraph">Oh, I got to put R12.</p>



<p class="wp-block-paragraph">Yeah, then we can get the, wait a minute, wait a minute.</p>



<p class="wp-block-paragraph">Oh, I threw off the line numbers because I added the variables up here.</p>



<p class="wp-block-paragraph">So now we&#8217;re going to break at 21.</p>



<p class="wp-block-paragraph">Let me just fix that.</p>



<p class="wp-block-paragraph">21.</p>



<p class="wp-block-paragraph">We&#8217;ll do a quit.</p>



<p class="wp-block-paragraph">Make debug again.</p>



<p class="wp-block-paragraph">And now we&#8217;re at 21.</p>



<p class="wp-block-paragraph">If I say info registers, we can see R12 is that big value.</p>



<p class="wp-block-paragraph">you, but we can also print R12 directly. And we should be able to print my thing one, hopefully,</p>



<p class="wp-block-paragraph">has an unknown type, oh, we have to cast it. So we can do like basic casting in GDB. So I&#8217;m going</p>



<p class="wp-block-paragraph">to say this is a character pointer. Remember, all of the assembly symbols are basically pointers,</p>



<p class="wp-block-paragraph">unless it&#8217;s an EQU, EQU variable. In that case, it&#8217;s more of a define. So I&#8217;m going to print</p>



<p class="wp-block-paragraph">and then it says error cannot access the memory add address</p>



<p class="wp-block-paragraph">what the heck did i do wrong how about that cannot access that all right i&#8217;ll come back in</p>



<p class="wp-block-paragraph">another video because this wasn&#8217;t something that i prepared for just to print strings in globals</p>



<p class="wp-block-paragraph">i&#8217;ll come back at some later date in the future like five years from now and i&#8217;ll just show you</p>



<p class="wp-block-paragraph">how to print globals but i hope if you&#8217;re in assembly you probably don&#8217;t need to worry about</p>



<p class="wp-block-paragraph">You just have globals, but the real problem for you is going to be what&#8217;s inside of your registers and so forth.</p>



<p class="wp-block-paragraph">You can also deref, I think.</p>



<p class="wp-block-paragraph">Let me see.</p>



<p class="wp-block-paragraph">Okay, I&#8217;m going to move on from that.</p>



<p class="wp-block-paragraph">So anyway, we got a script and we got a lot of basic GDB commands.</p>



<p class="wp-block-paragraph">Is there anything else that I wanted to show you?</p>



<p class="wp-block-paragraph">Let me just look at my notes real fast here to make sure I&#8217;m not forgetting to say anything.</p>



<p class="wp-block-paragraph">make sure I&#8217;m not forgetting to say anything.</p>



<p class="wp-block-paragraph">So we&#8217;re going to do debug symbols, console, quit, attach to binary,</p>



<p class="wp-block-paragraph">launching the program, uncaught exception, breakpoints, info, delete,</p>



<p class="wp-block-paragraph">enable, disable, run, continue, end times, info registers, printing.</p>



<p class="wp-block-paragraph">Oh, we can print a register in binary.</p>



<p class="wp-block-paragraph">Forgot to show that.</p>



<p class="wp-block-paragraph">So we are at a breakpoint, I think.</p>



<p class="wp-block-paragraph">And if we printed R12 with the regular print, we can also do P slash T to just</p>



<p class="wp-block-paragraph">p slash t to just sort of print it in binary if you want to i think i might have said that already</p>



<p class="wp-block-paragraph">either that or i said that like a couple days ago to some and then we can do info locals and</p>



<p class="wp-block-paragraph">then print a variable and then we get the script file and then we can quit okay so i think this is</p>



<p class="wp-block-paragraph">pretty much everything that i wanted to show you you now have a basic idea of what we can do inside</p>



<p class="wp-block-paragraph">of gdb but keep in mind there is so much more you can do in gdb than i can fit in one video</p>



<p class="wp-block-paragraph">can type help and you can see a list of other major you know areas that gdb can handle um you</p>



<p class="wp-block-paragraph">can do uh let&#8217;s see i think it&#8217;s help and then like we&#8217;ve got information on aliases breakpoints</p>



<p class="wp-block-paragraph">data you know whatever we can do i think help breakpoints to see more information on breakpoint</p>



<p class="wp-block-paragraph">commands yeah so all of the things you can do with breakpoints is like all of these commands here</p>



<p class="wp-block-paragraph">one page we have to enter to see one more page or see to see all of the results without using</p>



<p class="wp-block-paragraph">paging anymore so i&#8217;m just hit c and so there&#8217;s like you know we can save trace points we can</p>



<p class="wp-block-paragraph">try to catch exceptions we can enable disable break points there&#8217;s like unwinders which i&#8217;ve</p>



<p class="wp-block-paragraph">never even used we can bookmark things we can you know start tracing memory we can rethrow</p>



<p class="wp-block-paragraph">variables so just keep in mind gdp is incredibly powerful this video barely scratches the surface</p>



<p class="wp-block-paragraph">but for a programmer who is new to debugging i think this will be very useful to you i hope it is</p>



<p class="wp-block-paragraph">anyway thanks for watching this video i hope you learned a little bit of stuff and had a</p>



<p class="wp-block-paragraph">little bit of fun um i will see you in the next video rest yourself and take a nap and have fun</p>



<p class="wp-block-paragraph">and hug your your loved ones okay I&#8217;m out see you later hey everybody thanks</p>



<p class="wp-block-paragraph">for watching this video again from the bottom of my heart I really appreciate</p>



<p class="wp-block-paragraph">it I do hope you did learn something and have some fun if you could do me a</p>



<p class="wp-block-paragraph">please a small little favor could you please subscribe and follow this channel</p>



<p class="wp-block-paragraph">channel or these videos or whatever it is you do on the current social media</p>



<p class="wp-block-paragraph">website that you&#8217;re looking at right now it would really mean the world to me</p>



<p class="wp-block-paragraph">and it&#8217;ll help make more videos and grow this community so we&#8217;ll be able to do</p>



<p class="wp-block-paragraph">more videos longer videos better videos or just I&#8217;ll be able to keep making</p>



<p class="wp-block-paragraph">videos in general so please do do me a kindness and and subscribe you know</p>



<p class="wp-block-paragraph">sometimes I&#8217;m sleeping in the middle of the night and I just wake up because I</p>



<p class="wp-block-paragraph">know somebody subscribed or followed it just wakes me up and I get filled with</p>



<p class="wp-block-paragraph">That&#8217;s exactly what happens every single time.</p>



<p class="wp-block-paragraph">So you could do it as a nice favor to me,</p>



<p class="wp-block-paragraph">or you could troll me if you want to just wake me up in the middle of the night.</p>



<p class="wp-block-paragraph">Just subscribe, and then I&#8217;ll just wake up.</p>



<p class="wp-block-paragraph">I promise that&#8217;s what will happen.</p>



<p class="wp-block-paragraph">Also, if you look at the middle of the screen right now,</p>



<p class="wp-block-paragraph">you should see a QR code, which you can scan in order to go to the website,</p>



<p class="wp-block-paragraph">which I think is also named somewhere at the bottom of this video.</p>



<p class="wp-block-paragraph">And it&#8217;ll take you to my main website,</p>



<p class="wp-block-paragraph">where you can just kind of like see all the videos I published,</p>



<p class="wp-block-paragraph">and the services and tutorials and things that I offer,</p>



<p class="wp-block-paragraph">and all that good stuff.</p>



<p class="wp-block-paragraph">things that I offer and all that good stuff. And, uh, if you have a suggestion for, uh, uh,</p>



<p class="wp-block-paragraph">clarifications or errata, or just future videos that you want to see, please leave a comment.</p>



<p class="wp-block-paragraph">Or if you just want to say, Hey, what&#8217;s up, what&#8217;s going on? You know, just send me a comment,</p>



<p class="wp-block-paragraph">whatever. I also wake up for those in the middle of the night. I get, I wake up in a cold sweat</p>



<p class="wp-block-paragraph">and I&#8217;m like, it would really, it really mean the world to me. I would really appreciate it. So</p>



<p class="wp-block-paragraph">watching this video and enjoy the cool music as I fade into the darkness which is coming for us all.</p>



<p class="wp-block-paragraph">Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/master-gnu-debugger-debug-c-assembly-programs-with-gdb-like-a-pro/">Master GNU Debugger: Debug C++ &amp; Assembly Programs with GDB Like a Pro</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/master-gnu-debugger-debug-c-assembly-programs-with-gdb-like-a-pro/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Caveman Debugging: Simple Trick to Debug C++ Code Like a Pro!</title>
		<link>https://www.NeuralLantern.com/caveman-debugging-simple-trick-to-debug-c-code-like-a-pro/</link>
					<comments>https://www.NeuralLantern.com/caveman-debugging-simple-trick-to-debug-c-code-like-a-pro/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Wed, 11 Jun 2025 19:56:00 +0000</pubDate>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[assembly debugging]]></category>
		<category><![CDATA[beginner coding]]></category>
		<category><![CDATA[c++ debugging]]></category>
		<category><![CDATA[c++ tutorial]]></category>
		<category><![CDATA[caveman debugging]]></category>
		<category><![CDATA[code troubleshooting]]></category>
		<category><![CDATA[coding hacks]]></category>
		<category><![CDATA[coding tips]]></category>
		<category><![CDATA[debug c++]]></category>
		<category><![CDATA[debug code fast]]></category>
		<category><![CDATA[fix code bugs]]></category>
		<category><![CDATA[print statement debugging]]></category>
		<category><![CDATA[programming for beginners]]></category>
		<category><![CDATA[programming tutorial]]></category>
		<category><![CDATA[software development]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=151</guid>

					<description><![CDATA[<p>Master caveman debugging! Easy C++ trick to fix code fast with print statements. Clear tips for beginners &#038; pros. Watch now to squash bugs!</p>
<p>The post <a href="https://www.NeuralLantern.com/caveman-debugging-simple-trick-to-debug-c-code-like-a-pro/">Caveman Debugging: Simple Trick to Debug C++ Code Like a Pro!</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Caveman Debugging: Simple Trick to Debug C++ Code Like a Pro!" width="1380" height="776" src="https://www.youtube.com/embed/hsGaRukvpF8?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p class="wp-block-paragraph">Hey coders! Ever hit a wall with a program that just won’t work? In this video, I’m spilling the beans on caveman debugging—a super simple, no-fuss way to hunt down bugs in your C++ code (or any language, from assembly to Python)! No need to wrestle with complex debuggers; this method is all about using print statements to trace what your code is doing, step by step.</p>



<p class="wp-block-paragraph">I’ll show you a real C++ program where things go wrong (think integer overflows and mystery crashes) and walk you through how to sprinkle in cout statements to spot the problem fast. You’ll learn how to label decision points like loops and if-statements, break down complex expressions with temporary variables, and format your debug output so it’s easy to read. Plus, I share a neat trick called short circuiting to toggle your debug prints on or off without deleting them—saving you tons of time!</p>



<p class="wp-block-paragraph">Whether you’re a beginner just starting out or a pro debugging a massive codebase, caveman debugging is a lifesaver. It’s quick, it’s intuitive, and it fits my “let’s figure this out” vibe perfectly. Stick around to see how I catch a sneaky bug in a for-loop and fix it in minutes.</p>



<p class="wp-block-paragraph">Why watch?</p>



<ul class="wp-block-list">
<li>Learn a beginner-friendly debugging technique that works in any language.</li>



<li>See real code examples with clear, relatable explanations.</li>



<li>Get tips to make your debug output readable and avoid hours of frustration.</li>



<li>Discover how to short circuit print statements for reusable debugging.</li>
</ul>



<p class="wp-block-paragraph">If you’re ready to level up your coding game and squash bugs like a champ, smash that play button! Don’t forget to subscribe and hit the bell for more coding tutorials, from beginner hacks to advanced tricks. Drop a comment if you’ve ever used caveman debugging or have a bug you need help with—I read every one! Check out my next video on using a proper debugger for even more debugging goodness.</p>



<p class="wp-block-paragraph">Scan the QR code on-screen or visit my website (linked below) for more tutorials, services, and coding resources. Let’s keep the coding community growing—your support means the world! #CavemanDebugging #CodingTips #DebuggingHacks</p>



<p class="wp-block-paragraph">Hey everybody! In this video I&#8217;m gonna try to familiarize you with a concept</p>



<p class="wp-block-paragraph">called caveman debugging. It&#8217;s just as bad as it sounds but it&#8217;s really really</p>



<p class="wp-block-paragraph">really useful. So suppose for the sake of argument you&#8217;re writing a program I&#8217;m</p>



<p class="wp-block-paragraph">gonna show a C++ program here but this this concept is not just for C++</p>



<p class="wp-block-paragraph">debugging it&#8217;s also for assembly and any other kind of language that you can come</p>



<p class="wp-block-paragraph">other kind of language that you can come up with but suppose I have a program and I&#8217;m trying to</p>



<p class="wp-block-paragraph">figure out why it&#8217;s not working so if you look at this program right here that I&#8217;ve kind of written</p>



<p class="wp-block-paragraph">up already we have a main function here and we have like a little hello message that&#8217;s not my</p>



<p class="wp-block-paragraph">name I love that name though and we have a variable a and then we just sort of do some nonsense to it</p>



<p class="wp-block-paragraph">to try and compute a value for a when I say nonsense I mean literally I&#8217;m just I just made</p>



<p class="wp-block-paragraph">I&#8217;m just I just made up instructions the point of this video is not to show you some advanced program</p>



<p class="wp-block-paragraph">It&#8217;s just to show you that you know</p>



<p class="wp-block-paragraph">This is how you can possibly debug a program that has gone awry</p>



<p class="wp-block-paragraph">So you can imagine at home that this code you&#8217;re seeing right here might be your larger project your larger</p>



<p class="wp-block-paragraph">Code base whatever it is that you&#8217;re doing that is not working for some reason and you&#8217;re not sure why</p>



<p class="wp-block-paragraph">So, um, let me run the program real fast</p>



<p class="wp-block-paragraph">It basically is just like a little for loop and then it just sort of</p>



<p class="wp-block-paragraph">of you know not randomly but it just kind of increases the value of a for no reason</p>



<p class="wp-block-paragraph">a bunch of times and then it calls a function that will crash later</p>



<p class="wp-block-paragraph">so let me show you what happens when we try to run this program okay do do do</p>



<p class="wp-block-paragraph">okay i want to go clear and make run if you don&#8217;t know how to do a make file or compile</p>



<p class="wp-block-paragraph">or link or anything like that uh then go see my other videos so clear and make run</p>



<p class="wp-block-paragraph">What did I do wrong?</p>



<p class="wp-block-paragraph">TempResult was not declared in this scope.</p>



<p class="wp-block-paragraph">Okay, well, this is now a video on reading compiler errors.</p>



<p class="wp-block-paragraph">Line 59, I probably left something out.</p>



<p class="wp-block-paragraph">Oh, because I just changed it.</p>



<p class="wp-block-paragraph">I forgot to put it back in there.</p>



<p class="wp-block-paragraph">Return tempResult, we should just return input times two.</p>



<p class="wp-block-paragraph">And I&#8217;m just making this up.</p>



<p class="wp-block-paragraph">It&#8217;s not really like a valid algorithm.</p>



<p class="wp-block-paragraph">Okay, so we run our program.</p>



<p class="wp-block-paragraph">We print the final result and we realize for some reason the final result is wrong.</p>



<p class="wp-block-paragraph">result is wrong. So I don&#8217;t, I mean, I just made this up. So I don&#8217;t really know what the right</p>



<p class="wp-block-paragraph">answer is. But just imagine that you are looking at some sort of an output, some sort of a final</p>



<p class="wp-block-paragraph">state, maybe a crash. And you realize, oh, my program doesn&#8217;t work, but it&#8217;s too complicated</p>



<p class="wp-block-paragraph">to figure out. Caveman debugging to the rescue. Caveman debugging kind of is as bad as it sounds.</p>



<p class="wp-block-paragraph">It&#8217;s just really, really simple. But it&#8217;s also really useful, especially if you just want to do</p>



<p class="wp-block-paragraph">on you don&#8217;t want to dive deep into a full-on debugger or do something more advanced it literally</p>



<p class="wp-block-paragraph">is just printing a lot of things while your program is running i do it all the time i usually</p>



<p class="wp-block-paragraph">don&#8217;t even go to a debugger unless i really get in trouble with like some huge mess um okay so</p>



<p class="wp-block-paragraph">the first thing i&#8217;m going to say is in this for loop we uh you know we&#8217;re kind of like iterating</p>



<p class="wp-block-paragraph">And so probably this is a good idea to announce that we&#8217;re iterating in the for loop.</p>



<p class="wp-block-paragraph">So I&#8217;m just going to go Cout.</p>



<p class="wp-block-paragraph">In C++, you know, we have the Cout object that we can use to stream texts to standard output,</p>



<p class="wp-block-paragraph">which usually goes to the terminal.</p>



<p class="wp-block-paragraph">So use whatever construct you&#8217;re using for your particular language.</p>



<p class="wp-block-paragraph">So we&#8217;re going to do Cout.</p>



<p class="wp-block-paragraph">And I should say also, if you&#8217;re programming in assembly,</p>



<p class="wp-block-paragraph">if you are programming in assembly,</p>



<p class="wp-block-paragraph">it&#8217;s a little bit more complicated than just writing a Cout.</p>



<p class="wp-block-paragraph">little bit more complicated than just writing a C out you probably have to have some pre-computed</p>



<p class="wp-block-paragraph">messages and then you can use a library to print a number to the screen or use printf to print stuff</p>



<p class="wp-block-paragraph">to the screen but you can do it just takes a little bit longer so anyway conceptually I&#8217;m</p>



<p class="wp-block-paragraph">just going to say this is the first iteration of my loop so I&#8217;m going to sort of announce it I&#8217;m</p>



<p class="wp-block-paragraph">going to say main and then I&#8217;m going to call it main four or how about primary four or first four</p>



<p class="wp-block-paragraph">but I want to try to label the for loop.</p>



<p class="wp-block-paragraph">And maybe instead of leaving those parentheses blank,</p>



<p class="wp-block-paragraph">I could say iteration number i right there,</p>



<p class="wp-block-paragraph">or maybe I could do iteration i.</p>



<p class="wp-block-paragraph">That would be pretty good.</p>



<p class="wp-block-paragraph">Then I just have to replace the i with the actual variable i</p>



<p class="wp-block-paragraph">so that the i keeps increasing.</p>



<p class="wp-block-paragraph">So I&#8217;m just going to like do another stream operator here</p>



<p class="wp-block-paragraph">and I&#8217;m going to say i.</p>



<p class="wp-block-paragraph">Then I&#8217;ll print a new line.</p>



<p class="wp-block-paragraph">we&#8217;ve got, you know, one iteration of our loop.</p>



<p class="wp-block-paragraph">Maybe I should also print what is the current value of A</p>



<p class="wp-block-paragraph">because the point of this, you know, weird nonsense code</p>



<p class="wp-block-paragraph">is we&#8217;re coming up with a value for A, right?</p>



<p class="wp-block-paragraph">So I should just print what A is at the top of each iteration of the for loop.</p>



<p class="wp-block-paragraph">So I&#8217;m going to say A is equal to, and then do another A at the end of it.</p>



<p class="wp-block-paragraph">And then maybe at the bottom of the for loop,</p>



<p class="wp-block-paragraph">when the for loop is actually ending one of its iterations,</p>



<p class="wp-block-paragraph">I can just say we&#8217;re at the bottom of the iteration so maybe I&#8217;ll put to end</p>



<p class="wp-block-paragraph">iteration and then print the final value of a and then at the top I&#8217;ll say begin</p>



<p class="wp-block-paragraph">iteration at this point you might start to feel like hey aren&#8217;t you using too</p>



<p class="wp-block-paragraph">many words here like why can&#8217;t I just print a bunch of numbers I mean you</p>



<p class="wp-block-paragraph">could but when you&#8217;re coding you need all the brainpower you can get to not</p>



<p class="wp-block-paragraph">just code but to debug coding is already hard enough without making it harder</p>



<p class="wp-block-paragraph">harder for yourself than you need it to be. So, you know, I see people all the time, they&#8217;re</p>



<p class="wp-block-paragraph">trying to debug their code and they just like start printing numbers. And after not very long</p>



<p class="wp-block-paragraph">at all, they&#8217;re looking at the debug output and they&#8217;re just like, what did that number mean?</p>



<p class="wp-block-paragraph">Where is the number I&#8217;m looking for? It&#8217;s just a bunch of numbers. It&#8217;s harder to debug when you</p>



<p class="wp-block-paragraph">do it that way. Do it the nice and pretty way. It just costs you a couple of extra keystrokes to do,</p>



<p class="wp-block-paragraph">you know, nice letters and new lines and things, nice words, labels. Isn&#8217;t that still a lot better</p>



<p class="wp-block-paragraph">Isn&#8217;t that still a lot better than debugging for an extra six hours?</p>



<p class="wp-block-paragraph">Because you can&#8217;t really understand what you&#8217;re seeing.</p>



<p class="wp-block-paragraph">Anyway, let me show you what this looks like so far with just those two lines added.</p>



<p class="wp-block-paragraph">Now we can kind of see, alright, alright, on iteration number 61, where I was 61, then</p>



<p class="wp-block-paragraph">this was the first value of A and then after that this was the second value of A, you know,</p>



<p class="wp-block-paragraph">when we were finished with the iteration.</p>



<p class="wp-block-paragraph">It seems to have gone up by a certain amount.</p>



<p class="wp-block-paragraph">you know it was like a negative blah blah blah 836 and then negative blah blah blah 708 so it</p>



<p class="wp-block-paragraph">kind of increased in value all right that&#8217;s a little bit helpful now it&#8217;s a really good uh</p>



<p class="wp-block-paragraph">place to uh print our decision points so anytime in your code where you have an if or an else or</p>



<p class="wp-block-paragraph">a function call or anything where you are kind of like you know making a decision or processing your</p>



<p class="wp-block-paragraph">data in some way it&#8217;s probably a good idea to announce your decisions so i could say up here i</p>



<p class="wp-block-paragraph">say up here i can go maybe i&#8217;ll say uh main first four and then i&#8217;ll call it uh maybe i&#8217;ll do a</p>



<p class="wp-block-paragraph">double colon there and i&#8217;ll say top if just to make it easy to read that i&#8217;m kind of like at</p>



<p class="wp-block-paragraph">the first if statement um maybe i&#8217;ll even put parentheses i&#8217;ll say a is more than 20 just to</p>



<p class="wp-block-paragraph">kind of like name what i&#8217;m actually doing and then i could replace the a with the actual value of a</p>



<p class="wp-block-paragraph">actual value of a so i could say a like that and maybe uh when i&#8217;m reading this later i might want</p>



<p class="wp-block-paragraph">to kind of actually see the variable name so i could say uh you could just like put a as a string</p>



<p class="wp-block-paragraph">and then maybe its value in parentheses or something like that do a new line um and then</p>



<p class="wp-block-paragraph">maybe after that top thing i&#8217;ll say uh true to indicate that we&#8217;re inside of the the if statement</p>



<p class="wp-block-paragraph">the if statement and then maybe at the bottom of that if statement we&#8217;ll just say</p>



<p class="wp-block-paragraph">a is now true and we&#8217;ll say like a is now you know whatever the new value of a was so just</p>



<p class="wp-block-paragraph">basically we&#8217;re announcing that we decided to go into this if block and then we announce what we</p>



<p class="wp-block-paragraph">ended up changing a to and also you probably anytime you see a compound expression like this</p>



<p class="wp-block-paragraph">You know B time something or a plus something or just you know a big part of multiple parts of the expression any expression</p>



<p class="wp-block-paragraph">That&#8217;s more than just like one variable or one number. It&#8217;s probably a good idea if you break that up into temporary variables, too</p>



<p class="wp-block-paragraph">and then</p>



<p class="wp-block-paragraph">Print out each variable and I know that&#8217;s a lot of stuff to read but again it beats debugging for an extra six hours</p>



<p class="wp-block-paragraph">I&#8217;m gonna leave that be for now though</p>



<p class="wp-block-paragraph">leave that be and</p>



<p class="wp-block-paragraph">I&#8217;m just gonna continue adding comments into the rest of the code. So I&#8217;m gonna do the second if block here</p>



<p class="wp-block-paragraph">So I&#8217;m going to do the second if block here.</p>



<p class="wp-block-paragraph">I&#8217;m going to say we&#8217;re in the first floor.</p>



<p class="wp-block-paragraph">We&#8217;re in the bottom if more than 20 true.</p>



<p class="wp-block-paragraph">And then we&#8217;ll print out what is the value of a after we&#8217;re finished.</p>



<p class="wp-block-paragraph">We&#8217;ll say a is now is now whatever value for a.</p>



<p class="wp-block-paragraph">And then I&#8217;ll do the same thing for this function call.</p>



<p class="wp-block-paragraph">Because, you know, when I call this function, it&#8217;s going to change the value somehow.</p>



<p class="wp-block-paragraph">So we&#8217;re going to do cout about to a plus equals f, you know, call to f.</p>



<p class="wp-block-paragraph">And then inside the arguments, I&#8217;m obviously putting i plus 3.</p>



<p class="wp-block-paragraph">But because i is a variable, we could just print that.</p>



<p class="wp-block-paragraph">So I&#8217;m going to do quote, quote, and then just stick the actual i in there.</p>



<p class="wp-block-paragraph">And then another new line.</p>



<p class="wp-block-paragraph">a finished a plus equals f and then I&#8217;ll just say you know a is now you know a you know print the</p>



<p class="wp-block-paragraph">new value of a you could also say a equal equal a and then print the value whatever you want but</p>



<p class="wp-block-paragraph">the point is I&#8217;m just printing everything here so now let&#8217;s go down a little bit more because</p>



<p class="wp-block-paragraph">there is a function call if you look at this function call down here here&#8217;s like some nonsense</p>



<p class="wp-block-paragraph">being used here&#8217;s some other like you know disabled code really what i&#8217;m doing at the</p>



<p class="wp-block-paragraph">very end is i&#8217;m just taking the input that the function received and i&#8217;m just multiplying it by</p>



<p class="wp-block-paragraph">two and returning it so again imagine that your code is a lot more complicated than this</p>



<p class="wp-block-paragraph">maybe input times two is actually input times two divided by three and then some other function</p>



<p class="wp-block-paragraph">call and then some other this and some other that and whatever so a lot of people will just kind of</p>



<p class="wp-block-paragraph">stuff like a really complicated expression in one line or one assignment or one return statement</p>



<p class="wp-block-paragraph">And that&#8217;s super confusing because you can&#8217;t really be sure that every part of the expression is as you thought.</p>



<p class="wp-block-paragraph">So it&#8217;s a really good idea to break it all up into parts and print each part.</p>



<p class="wp-block-paragraph">So you could imagine that we have like a C out here and we&#8217;ll say C out, you know, begin F.</p>



<p class="wp-block-paragraph">I&#8217;ll say like begin for F and then F receives an input of input.</p>



<p class="wp-block-paragraph">Do an end L.</p>



<p class="wp-block-paragraph">And then I&#8217;ll make a temporary variable here.</p>



<p class="wp-block-paragraph">variable here I&#8217;ll say int temp results equals input times two and then I&#8217;ll</p>



<p class="wp-block-paragraph">print that f and maybe I&#8217;ll do the input again</p>



<p class="wp-block-paragraph">temp result is now and then say temp result so I&#8217;m just gonna print what the</p>



<p class="wp-block-paragraph">temp result actually was and I could print something about I just multiplied</p>



<p class="wp-block-paragraph">thing about I just multiplied the input by two and then you know the more</p>



<p class="wp-block-paragraph">complicated your expression is the more temporary variables you want to use and</p>



<p class="wp-block-paragraph">just kind of print every single one of them and print you know this new</p>



<p class="wp-block-paragraph">variable is the result of dividing by two this new variable is the result of</p>



<p class="wp-block-paragraph">calling some other function and so forth</p>



<p class="wp-block-paragraph">so then we have like a basically you know basically a pretty good idea maybe</p>



<p class="wp-block-paragraph">at the end though instead of multiplying by two again you want to make it more</p>



<p class="wp-block-paragraph">want to make it more consistent with your debug output so like here temp result is obviously going</p>



<p class="wp-block-paragraph">to be the result that i return why would you do the expression all over again for the return part</p>



<p class="wp-block-paragraph">when you could easily get it wrong why not instead just return the temp result that you made right so</p>



<p class="wp-block-paragraph">then that way your output completely matches what you&#8217;re actually returning and for now i think</p>



<p class="wp-block-paragraph">that&#8217;s all we need to do let me run it one more time and then you&#8217;ll see a bunch of stuff now uh</p>



<p class="wp-block-paragraph">Now, we have a lot of information that we can use to trace how our program was thinking and hopefully find the problem.</p>



<p class="wp-block-paragraph">But isn&#8217;t this like a little bit starting to get a little bit hard to read, right?</p>



<p class="wp-block-paragraph">You can see that there are kind of blocks happening whenever we iterate.</p>



<p class="wp-block-paragraph">So, you know, for me, I always try to keep in mind you need all the brainpower you can get.</p>



<p class="wp-block-paragraph">Why not just format it a little bit better so it&#8217;s really easy to just quickly look at one block and see, you know,</p>



<p class="wp-block-paragraph">the couts kind of like belong together so i&#8217;m just going to add one more cout in the main for loop</p>



<p class="wp-block-paragraph">here just at the very bottom i&#8217;m going to go couts and l just so that i get a new line and if i run</p>



<p class="wp-block-paragraph">the program again notice how it&#8217;s easier to see the blocks like oh that&#8217;s clearly one iteration</p>



<p class="wp-block-paragraph">right here you know your mind just grabs onto it faster and that increases your brain power and</p>



<p class="wp-block-paragraph">makes it easier to debug and read the debug output so i can go all right all right okay so</p>



<p class="wp-block-paragraph">all right okay so we&#8217;re right up here oh around uh iteration um number 83 uh a was this number</p>



<p class="wp-block-paragraph">and then it got increased by uh this other number and the reason that that happened is because the</p>



<p class="wp-block-paragraph">function returned 172 so it basically increased it by 172 and then it ended up being that number</p>



<p class="wp-block-paragraph">oh okay i think i see what went wrong oh no right in this particular program if we scroll up just a</p>



<p class="wp-block-paragraph">little bit we can probably see that the integer is overflowing right the integer was getting bigger</p>



<p class="wp-block-paragraph">right the integer was getting bigger and bigger and bigger here and then eventually</p>



<p class="wp-block-paragraph">it jumped into the negative at some point so right here we can see oh okay when did this</p>



<p class="wp-block-paragraph">number become negative suppose we didn&#8217;t want it to be negative um what was this this is like</p>



<p class="wp-block-paragraph">a million this is a billion no wait wait wait this is uh no that&#8217;s a million right there so it&#8217;s like</p>



<p class="wp-block-paragraph">299 million and then it overflowed oh no no it didn&#8217;t it didn&#8217;t overflow it started at 299</p>



<p class="wp-block-paragraph">it started at 299 then at the bottom it was sitting at 899 million that&#8217;s kind of close to a billion</p>



<p class="wp-block-paragraph">and it did jump up from 300 million to 900 million so that&#8217;s a jump up of like 600 million</p>



<p class="wp-block-paragraph">oh you know it&#8217;s like kind of jumping up faster with each iteration oh and i&#8217;m using a 32-bit</p>



<p class="wp-block-paragraph">signed integer which has a maximum value of around 2 billion so now i could possibly realize at this</p>



<p class="wp-block-paragraph">the number is just like it became too big and I need to change my data type or I need to change</p>



<p class="wp-block-paragraph">my algorithm for some reason right so you can kind of get to the bottom of things pretty quickly</p>



<p class="wp-block-paragraph">so here&#8217;s another problem that people encounter when they&#8217;re using caveman debugging</p>



<p class="wp-block-paragraph">basically you you add all these cout statements or print statements or whatever you&#8217;re doing in</p>



<p class="wp-block-paragraph">whatever language you have and then when you&#8217;re finished you&#8217;re kind of like well I guess uh</p>



<p class="wp-block-paragraph">I need to delete all of these Couts because I don&#8217;t want all this you know</p>



<p class="wp-block-paragraph">Junk being printed in my program after I fix the problem or maybe you&#8217;re trying to debug a different part of your program</p>



<p class="wp-block-paragraph">So then you start commenting out all the print statements or you start</p>



<p class="wp-block-paragraph">You know deleting them or whatever and then whoops later on you realize maybe that part of my program</p>



<p class="wp-block-paragraph">Was not actually fixed and I have to add all the Couts all over again from scratch that costs time</p>



<p class="wp-block-paragraph">So that&#8217;s not fun. So here&#8217;s a trick that I like to use. It&#8217;s called a short circuit</p>



<p class="wp-block-paragraph">it&#8217;s called a short circuit it&#8217;s a sort of like a beginning C++ thing or just</p>



<p class="wp-block-paragraph">when you&#8217;re first learning how to use logical operators for boolean</p>



<p class="wp-block-paragraph">expressions so I&#8217;m gonna do a boolean and I&#8217;m just gonna name it after what</p>



<p class="wp-block-paragraph">problem I&#8217;m trying to solve so we could just call this you know main C outs or</p>



<p class="wp-block-paragraph">something like that let&#8217;s I don&#8217;t know primary problem I&#8217;ll call it primary</p>



<p class="wp-block-paragraph">the boolean as true because then what will happen is uh we can then short circuit all of the cout</p>



<p class="wp-block-paragraph">statements we can say primary problem couts and cout like that and the way the short circuit works</p>



<p class="wp-block-paragraph">works is if you have a logical and expression you can see right here we have two sides</p>



<p class="wp-block-paragraph">of that statement now one&#8217;s on the left which is just the boolean and one&#8217;s on the right which is</p>



<p class="wp-block-paragraph">have a logical and then you know one and zero is equal to zero true and false is equal to false so</p>



<p class="wp-block-paragraph">both things have to be true for the expression to evaluate to true which means if the first thing</p>



<p class="wp-block-paragraph">is false there&#8217;s no point in even looking at the second thing at all because if i if i set that to</p>



<p class="wp-block-paragraph">false then the second part the c out is it doesn&#8217;t matter the whole expression is going to evaluate</p>



<p class="wp-block-paragraph">to false anyway so uh the logical operator itself will just you know block out the rest of the</p>



<p class="wp-block-paragraph">you know, block out the rest of the statement.</p>



<p class="wp-block-paragraph">That&#8217;s called a short circuit.</p>



<p class="wp-block-paragraph">So I&#8217;m going to copy the short circuiting to all of my C out statements like this.</p>



<p class="wp-block-paragraph">Okay.</p>



<p class="wp-block-paragraph">And do that.</p>



<p class="wp-block-paragraph">And then the C out there.</p>



<p class="wp-block-paragraph">And I guess I&#8217;ll leave the final result there.</p>



<p class="wp-block-paragraph">And for the moment, you know, this is just a regular function.</p>



<p class="wp-block-paragraph">apply the short circuiting to this other f unless I do a separate boolean but</p>



<p class="wp-block-paragraph">keep in mind if this was a class and you had two different methods that you</p>



<p class="wp-block-paragraph">wanted to short circuit see outs inside of at the same time you could just use a</p>



<p class="wp-block-paragraph">member variable and name it after the problem you&#8217;re currently trying to solve</p>



<p class="wp-block-paragraph">and then just short circuit each see out in the appropriate method with that</p>



<p class="wp-block-paragraph">boolean so I guess in this regular program that doesn&#8217;t have a class I</p>



<p class="wp-block-paragraph">could move the boolean into the global if I wanted to but I&#8217;m not going to right</p>



<p class="wp-block-paragraph">if I wanted to, but I&#8217;m not going to right now.</p>



<p class="wp-block-paragraph">And if you&#8217;re writing assembly or some simpler language</p>



<p class="wp-block-paragraph">and you&#8217;re thinking, hey, I can&#8217;t short circuit an assembly</p>



<p class="wp-block-paragraph">or some other language, well, you could write a function</p>



<p class="wp-block-paragraph">that just takes a couple arguments.</p>



<p class="wp-block-paragraph">You could write a function that takes a string to print</p>



<p class="wp-block-paragraph">and maybe a number to print or just, you know,</p>



<p class="wp-block-paragraph">something simple like that.</p>



<p class="wp-block-paragraph">And then in the function itself that prints,</p>



<p class="wp-block-paragraph">you could call it debug print if you want.</p>



<p class="wp-block-paragraph">Have it look at a global variable or define</p>



<p class="wp-block-paragraph">that you&#8217;ve set up at the top of the assembly module.</p>



<p class="wp-block-paragraph">set up at the top of the assembly module, which you can just turn on and off,</p>



<p class="wp-block-paragraph">like just do a data byte and set it to a zero or set it to a one.</p>



<p class="wp-block-paragraph">And then the function debug print will just look at that variable to decide</p>



<p class="wp-block-paragraph">whether or not it&#8217;s going to actually print or not.</p>



<p class="wp-block-paragraph">So, you know, it&#8217;s a little more complicated in assembly,</p>



<p class="wp-block-paragraph">but you can do it basically the same concept.</p>



<p class="wp-block-paragraph">Let&#8217;s run this again just to make sure it still works.</p>



<p class="wp-block-paragraph">Okay, so it still works.</p>



<p class="wp-block-paragraph">So now suppose I want to turn off all the Cout statements.</p>



<p class="wp-block-paragraph">If I just change the true to false,</p>



<p class="wp-block-paragraph">the true to false notice how it&#8217;s all gone except for the stuff inside of f which i told you i</p>



<p class="wp-block-paragraph">wasn&#8217;t going to touch but notice how easy it was to mute it and then if i want to bring it back</p>



<p class="wp-block-paragraph">later i just go true to unmute it of course if you want to do a little bit more typing you can</p>



<p class="wp-block-paragraph">also do if statements like if this condition is true and that condition is true then print the</p>



<p class="wp-block-paragraph">debug statement so then you can have a more complicated way of muting and not muting but</p>



<p class="wp-block-paragraph">I&#8217;m going to leave it as is right now.</p>



<p class="wp-block-paragraph">Let&#8217;s see, what else do we got here?</p>



<p class="wp-block-paragraph">I think actually at this point, this is the basic idea of caveman debugging.</p>



<p class="wp-block-paragraph">Just basically print everything.</p>



<p class="wp-block-paragraph">Print all of your decision points.</p>



<p class="wp-block-paragraph">Use pretty labels that are really, really easy for you to understand.</p>



<p class="wp-block-paragraph">Use formatting so that your brain doesn&#8217;t have to struggle to understand what you&#8217;re seeing.</p>



<p class="wp-block-paragraph">If you just print a bunch of numbers, you&#8217;re going to be shooting yourself in the foot.</p>



<p class="wp-block-paragraph">you&#8217;re going to be shooting yourself in the foot and use short circuiting or if statements to</p>



<p class="wp-block-paragraph">selectively mute them so you can do less typing and and debugging the debugging and so forth but</p>



<p class="wp-block-paragraph">yeah i think i think this is all i really wanted to show you in this particular video</p>



<p class="wp-block-paragraph">i hope you feel like an expert in caveman debugging i certainly am and it you know it</p>



<p class="wp-block-paragraph">kind of fits my personality a little bit i&#8217;m like what&#8217;s going on um and like i said before</p>



<p class="wp-block-paragraph">debugger it&#8217;s probably a better idea but I usually don&#8217;t unless I&#8217;m in big trouble</p>



<p class="wp-block-paragraph">and I have a huge mess on my hands I usually just go directly to caveman</p>



<p class="wp-block-paragraph">debugging we&#8217;ll look at the same piece of code in my next video that I&#8217;m going</p>



<p class="wp-block-paragraph">to publish which is going to talk about using a proper debugger so watch the</p>



<p class="wp-block-paragraph">next one also but for now I hope you&#8217;ve enjoyed this video thank you for</p>



<p class="wp-block-paragraph">watching I hope you learned a little bit and had a little bit of fun see you in</p>



<p class="wp-block-paragraph">video</p>



<p class="wp-block-paragraph">whoops what the heck</p>



<p class="wp-block-paragraph">hey everybody thanks for watching this video again from the bottom of my heart</p>



<p class="wp-block-paragraph">i really appreciate it i do hope you did learn something and have</p>



<p class="wp-block-paragraph">some fun uh if you could do me a please a small little favor could you please</p>



<p class="wp-block-paragraph">subscribe and follow this channel or these videos</p>



<p class="wp-block-paragraph">or whatever it is you do on the current social media website that you&#8217;re looking</p>



<p class="wp-block-paragraph">at right now it would really mean the world to me and</p>



<p class="wp-block-paragraph">more videos and grow this community so we&#8217;ll be able to do more videos longer</p>



<p class="wp-block-paragraph">videos better videos or just I&#8217;ll be able to keep making videos in general so</p>



<p class="wp-block-paragraph">please do do me a kindness and and subscribe you know sometimes I&#8217;m</p>



<p class="wp-block-paragraph">sleeping in the middle of the night and I just wake up because I know somebody</p>



<p class="wp-block-paragraph">subscribed or followed it just wakes me up and I get filled with joy that&#8217;s</p>



<p class="wp-block-paragraph">exactly what happens every single time so you could do it as a nice favor to me</p>



<p class="wp-block-paragraph">or you could you control me if you want to just wake me up in the middle of the</p>



<p class="wp-block-paragraph">and then i&#8217;ll i&#8217;ll just wake up i promise that&#8217;s what will happen also uh if you look at the middle</p>



<p class="wp-block-paragraph">of the screen right now you should see a qr code which you can scan in order to go to the website</p>



<p class="wp-block-paragraph">which i think is also named somewhere at the bottom of this video and it&#8217;ll take you to my</p>



<p class="wp-block-paragraph">main website where you can just kind of like see all the videos i published and the services and</p>



<p class="wp-block-paragraph">tutorials and things that i offer and all that good stuff and uh if you have a suggestion for</p>



<p class="wp-block-paragraph">clarifications or errata or just future videos that you want to see please leave a comment or</p>



<p class="wp-block-paragraph">if you just want to say hey what&#8217;s up what&#8217;s going on you know just send me a comment whatever i also</p>



<p class="wp-block-paragraph">wake up for those in the middle of the night i get i wake up in a cold sweat and i&#8217;m like</p>



<p class="wp-block-paragraph">it would really it really mean the world to me i would really appreciate it so again thank you so</p>



<p class="wp-block-paragraph">much for watching this video and um enjoy the cool music as as i fade into the darkness which is</p>



<p class="wp-block-paragraph">us all.</p>



<p class="wp-block-paragraph">Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/caveman-debugging-simple-trick-to-debug-c-code-like-a-pro/">Caveman Debugging: Simple Trick to Debug C++ Code Like a Pro!</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/caveman-debugging-simple-trick-to-debug-c-code-like-a-pro/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
