<?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 &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/debugging/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.xojo.com</link>
	<description>Blog about the Xojo programming language and IDE</description>
	<lastBuildDate>Tue, 31 Mar 2026 15:22:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Watchpoints in Xojo: A Smarter Way to Track Your Data</title>
		<link>https://blog.xojo.com/2026/03/31/watchpoints-in-xojo-a-smarter-way-to-track-your-data/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Tue, 31 Mar 2026 13:22:00 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[2026r1]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Watchpoints]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=15987</guid>

					<description><![CDATA[Debugging isn’t just about stepping through code anymore, it&#8217;s about understanding how your data behaves over time. With the new watchpoints feature in Xojo, you can&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Debugging isn’t just about stepping through code anymore, it&#8217;s about understanding how your data behaves over time. With the new watchpoints feature in Xojo, you can now monitor variables and object properties more intelligently, without constantly stepping line by line or adding logging just to see when values change.</p>



<h3 class="wp-block-heading">What Are Watchpoints?</h3>



<p>Watchpoints let you pause execution when the value of a variable or property changes. Instead of asking <em>“how did I get here?”</em>, watchpoints help you answer <em>“when did this change?”</em></p>



<p>This is especially useful when:</p>



<ul class="wp-block-list">
<li>A value is being modified unexpectedly</li>



<li>Multiple parts of your code interact with the same object</li>



<li>You’re tracking down subtle state-related bugs</li>
</ul>



<h3 class="wp-block-heading">How Watchpoints Work</h3>



<p>Setting up a watchpoint requires pausing execution where you would like to start monitoring the variable or property of an object.</p>



<figure class="wp-block-image size-large is-style-default"><img fetchpriority="high" decoding="async" width="1024" height="677" src="https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointSetupClipped-1024x677.jpg" alt="" class="wp-image-16018" srcset="https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointSetupClipped-1024x677.jpg 1024w, https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointSetupClipped-300x198.jpg 300w, https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointSetupClipped-768x508.jpg 768w, https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointSetupClipped.jpg 1446w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>In this example, we want to monitor the <code>count</code> variable, so you can right-click it in the variables debugger list and select <strong>Watch</strong> from the context menu.  Once a watchpoint is set on a variable or property, the debugger keeps track of its value during execution. When the value changes, execution pauses and shows the line that triggered the change. Notice that the watchpoint break line is highlighted differently from the current execution line, and a Watchpoints list is now displayed.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="667" src="https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointBreak-1024x667.png" alt="" class="wp-image-16014" srcset="https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointBreak-1024x667.png 1024w, https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointBreak-300x195.png 300w, https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointBreak-768x500.png 768w, https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointBreak-1536x1000.png 1536w, https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointBreak-2048x1333.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>This gives you immediate visibility into:</p>



<ul class="wp-block-list">
<li>What code caused the modification</li>



<li>What the previous and new values are</li>



<li>What the surrounding state looks like</li>
</ul>



<h3 class="wp-block-heading">Why This Matters</h3>



<p>Traditionally, tracking down a value change required manually stepping through code or adding temporary logging. Both approaches are time-consuming and error-prone.</p>



<p>Watchpoints eliminate that friction by:</p>



<ul class="wp-block-list">
<li>Reducing the need for repetitive stepping</li>



<li>Highlighting only meaningful changes</li>



<li>Letting you focus on the root cause faster</li>
</ul>



<h3 class="wp-block-heading">Conditional Watchpoints</h3>



<p>Watchpoints in Xojo aren&#8217;t limited to triggering on every change—you can make them conditional. For example, you can break only when a value is equal to, greater than, or less than a specific threshold, or even when it falls within a defined range. For string, both case-sensitive and case-insensitive comparisons are supported. This makes it much easier to focus on the changes that actually matter, especially when a variable updates frequently but only becomes problematic under certain conditions.</p>



<p>To add a condition to a watchpoint, right-click the watched variable or property and choose&nbsp;<strong>Edit Watchpoint Expression</strong> from the context menu.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="695" src="https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointExpression-1024x695.png" alt="" class="wp-image-16020" srcset="https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointExpression-1024x695.png 1024w, https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointExpression-300x204.png 300w, https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointExpression-768x522.png 768w, https://blog.xojo.com/wp-content/uploads/2026/03/WatchpointExpression.png 1496w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>The expression editor adapts based on the type of variable or property you&#8217;re watching, providing hints about what values and conditions you can enter.</p>



<h3 class="wp-block-heading">Handling Object Lifetimes</h3>



<p>One important detail when working with watchpoints is object lifetime.</p>



<p>If a watchpoint is attached to a property of an object that goes out of scope or is destroyed, the debugger can no longer track it. In these cases, Xojo provides feedback through the Messages pane so you know the watchpoint is no longer valid, along with the last known value.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="890" height="180" src="https://blog.xojo.com/wp-content/uploads/2026/03/Screenshot-2026-03-24-at-9.33.52-AM.png" alt="" class="wp-image-16021" srcset="https://blog.xojo.com/wp-content/uploads/2026/03/Screenshot-2026-03-24-at-9.33.52-AM.png 890w, https://blog.xojo.com/wp-content/uploads/2026/03/Screenshot-2026-03-24-at-9.33.52-AM-300x61.png 300w, https://blog.xojo.com/wp-content/uploads/2026/03/Screenshot-2026-03-24-at-9.33.52-AM-768x155.png 768w" sizes="auto, (max-width: 890px) 100vw, 890px" /></figure>



<h3 class="wp-block-heading">What works and what doesn&#8217;t</h3>



<p>You can set watchpoints on most variables and properties, even variants; however, Arrays, Structures, and computed properties are not supported. Code within <code>#pragma DisableBackgroundTasks</code> or <code>#pragma Debug False</code> blocks will not trigger watchpoint breaks. Watchpoints are also not currently available for Android projects.</p>



<h3 class="wp-block-heading">Final Thoughts</h3>



<p>Watchpoints bring a new level of precision to debugging in Xojo. Instead of chasing bugs through code, you can now let the debugger do the work of tracking down exactly where things go wrong.</p>



<p>Give them a try in your next debugging session—you might find yourself solving problems faster than ever!</p>



<p><em><em><em>William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.</em></em></em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Testing and Debugging Code Assistants</title>
		<link>https://blog.xojo.com/2025/02/12/testing-and-debugging-code-assistants/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Wed, 12 Feb 2025 16:00:00 +0000</pubDate>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Code Assistants]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<category><![CDATA[XojoScript]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=14458</guid>

					<description><![CDATA[As Senior Engineer Paul Lefebvre wrote back in 2022, Xojo added the ability to create Code Assistants starting with Xojo 2022r1. Code Assistants are functions&#8230;]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="984" height="1024" src="https://blog.xojo.com/wp-content/uploads/2025/02/CleanShot-2025-02-05-at-13.12.17@2x-984x1024.png" alt="" class="wp-image-14459" style="width:318px;height:auto" srcset="https://blog.xojo.com/wp-content/uploads/2025/02/CleanShot-2025-02-05-at-13.12.17@2x-984x1024.png 984w, https://blog.xojo.com/wp-content/uploads/2025/02/CleanShot-2025-02-05-at-13.12.17@2x-288x300.png 288w, https://blog.xojo.com/wp-content/uploads/2025/02/CleanShot-2025-02-05-at-13.12.17@2x-768x799.png 768w, https://blog.xojo.com/wp-content/uploads/2025/02/CleanShot-2025-02-05-at-13.12.17@2x.png 1026w" sizes="auto, (max-width: 984px) 100vw, 984px" /></figure>



<p>As Senior Engineer Paul Lefebvre <a href="https://blog.xojo.com/2022/04/05/using-the-new-user-code-assistants-feature/" target="_blank" rel="noreferrer noopener">wrote</a> back in 2022, Xojo added the ability to create Code Assistants starting with Xojo 2022r1. Code Assistants are functions that manipulate the code selected in the Code Editor to help with various code editing tasks. Code Assistants are written in <a href="https://documentation.xojo.com/api/language/xojoscript.html" target="_blank" rel="noreferrer noopener">XojoScript</a>, but XojoScript has no access to the Xojo Debugger. Fortunately, there&#8217;s a simple solution to this problem.</p>



<p>Xojo&#8217;s Code Assistant Tester example project makes it easy to test and debug your code before you create your Code Assistant. Go to File &gt; New Project, click on Examples then open the IDE folder to find it. With this example, you can enter the code that would go into your eventual XojoScript that will be your Code Assistant. Because this code is in methods in Xojo itself, you can test it and debug it with the Xojo Debugger.</p>



<p>Here&#8217;s a quick video on how to use Code Assistants and the Code Assistant Tester:</p>



<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="Introducing Xojo&#039;s New Code Assistants" width="500" height="281" src="https://www.youtube.com/embed/GDWQC1c6svQ?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>If you write some handy Code Assistants, consider sharing them on the <a href="https://forum.xojo.com">Xojo Forum</a> they could be useful to others in the community.</p>



<p><em>Geoff Perlman is the Founder and CEO of Xojo. When he’s not leading the Xojo team he can be found playing drums in Austin, Texas and spending time with his family.</em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Sharpening Our Preemptive Threads</title>
		<link>https://blog.xojo.com/2024/12/10/sharpening-our-preemptive-threads/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Tue, 10 Dec 2024 16:36:50 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[2024r4]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Preemptive Threads]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=14100</guid>

					<description><![CDATA[In Xojo 2024r3.1 we introduced the highly requested preemptive threads feature. This new thread type enables true independent execution of code, separate from the main&#8230;]]></description>
										<content:encoded><![CDATA[
<p>In Xojo 2024r3.1 we introduced the highly requested preemptive threads feature. This new thread type enables true independent execution of code, separate from the main thread or any other threads, allowing full utilization of all CPU cores. Let’s explore some of the improvements we&#8217;ve made since adding this capability.</p>



<h2 class="wp-block-heading">Protecting Our Objects</h2>



<p>Xojo objects are uniquely constructed and reference counted, a detail most users don’t need to think about. However, when working with preemptive threads, objects inherently require special protection. In Xojo 2024r3.1, we implemented safeguards to enable the use of objects in preemptive threads, but the approach wasn’t as efficient as it could be. Operations like passing objects as parameters or assigning them as properties incurred overhead, and those costs added up.</p>



<p>As uniquely as our objects are to construct, they also required a unique approach to protect them. In Xojo 2024r4 we updated how we protect our objects so that this operation happens much faster, improving the overall experience when running preemptive threads.</p>



<p>For an example of these efficiencies, check out this forum post where users benchmark the <a href="https://forum.xojo.com/t/xojo1brc-xojo-one-billion-row-challenge">One Billion Row Challenge</a>.<br></p>



<h2 class="wp-block-heading">Uniquely Destructed Objects</h2>



<p>As mentioned, our objects are uniquely constructed, and this uniqueness extends to their destruction as well. When a preemptive thread is running, it’s important not to wait for other objects to be destructed within the Destructor method.</p>



<pre class="wp-block-code"><code>Sub Object1.Destructor()
  While Object2 &lt;&gt; Nil
    // Waiting for Object2 to be destructed can lead to a deadlock,
    // especially if Object2 is being destructed from a separate thread.
  Wend
End Sub</code></pre>



<p>Also, avoid situations where you are creating new objects while in the Destructor and referencing Self.</p>



<pre class="wp-block-code"><code>Sub Object1.Destructor()
  // Referencing Self in a new object will lead to a
  // recursive Destructor sequence causing a dead lock.
  Var newObj As New Class1
  newObj.NotAGoodIdea = Self
End Sub</code></pre>



<h2 class="wp-block-heading">Handling Race Conditions</h2>



<p>In Xojo 2024r3.1, we created an example demonstrating how to synchronize shared resources using critical sections and semaphores. This example also highlights the effect of a race condition: your app will crash immediately, terminating the debugging session with no indication as to where the crash may have occurred.</p>



<p>These access violations were never caught by our debugger until now. Because these crashes may interfere with what can be displayed in the debugger, we&#8217;ve intentionally limited what is shown, as the access violation could leave the app in an unstable state.  Although these access violations are not exclusive to crashes caused by race conditions, this new feature aims to help you identify potential race conditions in your apps when working with preemptive threads.  Let&#8217;s take a look at that example and see what happens now when you run it through the debugger:</p>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="1024" height="621" src="https://blog.xojo.com/wp-content/uploads/2024/11/Screenshot-2024-11-27-at-2.13.58-PM-1024x621.png" alt="" class="wp-image-14104" srcset="https://blog.xojo.com/wp-content/uploads/2024/11/Screenshot-2024-11-27-at-2.13.58-PM-1024x621.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/11/Screenshot-2024-11-27-at-2.13.58-PM-300x182.png 300w, https://blog.xojo.com/wp-content/uploads/2024/11/Screenshot-2024-11-27-at-2.13.58-PM-768x466.png 768w, https://blog.xojo.com/wp-content/uploads/2024/11/Screenshot-2024-11-27-at-2.13.58-PM-1536x932.png 1536w, https://blog.xojo.com/wp-content/uploads/2024/11/Screenshot-2024-11-27-at-2.13.58-PM.png 1642w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>When you click the button designed to intentionally crash the app, you&#8217;ll now be returned to the debugger, where you&#8217;ll see a new crash <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a3.png" alt="💣" class="wp-smiley" style="height: 1em; max-height: 1em;" /> icon. This symbol indicates that a crash has occurred, and the app cannot proceed further (which is why all debugging step commands are disabled, and the debugger values are not loaded so objects will be Nil). Your only options at this point are to stop the app or attempt to reload the debugger values.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="128" height="54" src="https://blog.xojo.com/wp-content/uploads/2024/11/Screenshot-2024-11-27-at-2.26.43-PM.png" alt="" class="wp-image-14108"/></figure>
</div>


<p>Clicking the command button on the left refreshes or reloads the debugger values. If the app is stable enough, the debugger values will refresh; otherwise, the app may terminate automatically at this point.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="631" src="https://blog.xojo.com/wp-content/uploads/2024/11/Screenshot-2024-11-27-at-2.31.35-PM-1024x631.png" alt="" class="wp-image-14110" srcset="https://blog.xojo.com/wp-content/uploads/2024/11/Screenshot-2024-11-27-at-2.31.35-PM-1024x631.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/11/Screenshot-2024-11-27-at-2.31.35-PM-300x185.png 300w, https://blog.xojo.com/wp-content/uploads/2024/11/Screenshot-2024-11-27-at-2.31.35-PM-768x474.png 768w, https://blog.xojo.com/wp-content/uploads/2024/11/Screenshot-2024-11-27-at-2.31.35-PM-1536x947.png 1536w, https://blog.xojo.com/wp-content/uploads/2024/11/Screenshot-2024-11-27-at-2.31.35-PM.png 1638w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>In summary, these improvements aim to make working with preemptive threads more enjoyable by offering both enhanced speed and an easier process for identifying potential race conditions, which was previously much more challenging.  Like the One Billion Row Challenge, we’re eager to hear about all the ways you’re making use of preemptive threads in your own apps!</p>



<p><em><em><em>William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.</em></em></em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Remote Debugger: How to debug your app on any computer</title>
		<link>https://blog.xojo.com/2024/01/19/remote-debugger-how-to-debug-your-app-on-any-computer/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Fri, 19 Jan 2024 13:00:00 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Beginner Tips]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Multi-Platform Development]]></category>
		<category><![CDATA[Rapid Application Development]]></category>
		<category><![CDATA[Remote Debugging]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=12482</guid>

					<description><![CDATA[If only you could run your app in debug mode on a specific, remote computer. With Xojo, you can. Let's talk about Xojo's Remote Debugger. ]]></description>
										<content:encoded><![CDATA[
<p>At one time or another we all experienced it. The app you created works beautifully and your users heap praise upon it. Then, a particular user reports that some part of the app (or the entire app) doesn&#8217;t work on their computer. Other users with the same type of computer, same OS version, etc., do not experience the same issue. After scratching your head and thinking to yourself that the fault perhaps lies with the user, you create a special version of your app just for that user with MessageBox commands and/or various points in the code logged to a text file. This will give you the answer as to why your app is failing just for that one user. Alas, your digital spelunking reveals nothing. If only you could run your app in debug mode on <em>their</em> computer.</p>



<h3 class="wp-block-heading">Remote Debugger</h3>



<p>With Xojo, you can. Let&#8217;s talk about Xojo&#8217;s aptly named Remote Debugger. In the instance above, that particular user can install Xojo&#8217;s Remote Debugger app on their computer. You and your users can find the app included in the Extras folder of  the Xojo download. After your user installs, launches and sets the Options in the Remote Debugger app, you can connect to that user&#8217;s computer by adding a connection to it in the Debugging pane of the Settings dialog box in the Xojo IDE on your computer. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="647" src="https://blog.xojo.com/wp-content/uploads/2024/01/debugging_pane_settings_dialog-1024x647.png" alt="" class="wp-image-12483" srcset="https://blog.xojo.com/wp-content/uploads/2024/01/debugging_pane_settings_dialog-1024x647.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/01/debugging_pane_settings_dialog-300x190.png 300w, https://blog.xojo.com/wp-content/uploads/2024/01/debugging_pane_settings_dialog-768x486.png 768w, https://blog.xojo.com/wp-content/uploads/2024/01/debugging_pane_settings_dialog.png 1240w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Press the Add button, choose a name, add the user&#8217;s IP address and the password they created for the Remote Debugger app. If the user is just barely remote (on your local network for example), the Add dialog that appears will show local Remote Debuggers, making the process even easier. If this is the case, you can click on the user&#8217;s machine from the list without having to ask them for the their IP address.</p>



<p>It gets a bit complicated if you and the user are not on the same network. That&#8217;s because their router has to be configured to allow the connection to get through to their computer. That can be complex and potentially not allowed by their network administrator. The easiest solution in these cases is to use a service such as <a href="https://www.zerotier.com">ZeroTier</a> or <a href="https://tailscale.com">Tailscale</a> that creates a secure, private network which effectively puts you both on the same network making it a breeze to connect. (Both of ZeroTier and Tailscale have a service tier that is free.) </p>



<p>Once you&#8217;ve added the remote debug host, you can choose Project &gt; Run Remotely and then choose that host to begin the connection. When you do this, your computer will compile a debug version for the computer and OS running on that remote user&#8217;s computer. It will then send that build to their computer and launch it. The app will then connect back to your Xojo IDE&#8217;s Debugger! You can then debug just as you normally would. Have the user try various functions as you watch what they are doing using screen sharing of some kind. When it drops in to the Debugger, you can step through the code, look at the values of variables and properties, etc., just as you do when debugging on your local computer. In cases like this, it can take a frustrating, painful debugging experience and make it nearly stress-free. In minutes you&#8217;ll be staring at the line of code that just wasn&#8217;t expecting the user to do what they did. </p>



<p>Also, the remote computer doesn&#8217;t have to actually be remote. For example, the Remote Debugger is handy for debugging on local virtual machines or other computers on your desk. It lets you keep your project where it belongs (where you keep it on your computer) while debugging in an OS running somewhere else.</p>



<p>So the next time you wish you could just debug on another computer or virtual machine, remember Xojo&#8217;s Remote Debugger! Watch a 13 minute <a href="https://youtu.be/q0C4NhY7oRg">video</a> on Xojo&#8217;s Remote Debugger to learn more.</p>



<div class="wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link has-white-color has-text-color has-background has-link-color wp-element-button" href="https://documentation.xojo.com/getting_started/debugging/remote_debugging.html" style="background-color:#84bd00" target="_blank" rel="noreferrer noopener">Learn more in the Xojo Docs</a></div>
</div>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Creating an Android Emulator in Android Studio</title>
		<link>https://blog.xojo.com/2023/08/09/creating-an-android-emulator-in-android-studio/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Wed, 09 Aug 2023 13:30:00 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[App Store]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Emulator]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Remote Debugging]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=11702</guid>

					<description><![CDATA[In order to test the Android apps you create in Xojo, you either need to have an actual Android device (Xojo supports on-device testing/debugging) or you need to set up an Android Emulator in Android Studio. Read on or jump over to Xojo YouTube Channel to watch this process in this Creating an Android Emulator video.]]></description>
										<content:encoded><![CDATA[
<p>In order to test the Android apps you create in Xojo, you either need to have an actual Android device (Xojo supports on-device testing/debugging) or you need to set up an Android Emulator in Android Studio. Read on or jump over to Xojo YouTube Channel to watch this process in our <a href="https://youtu.be/hsmkUIHRvq8">Creating an Android Emulator</a> video.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="695" src="https://blog.xojo.com/wp-content/uploads/2023/07/CreatingAnAndroidEmulator-1024x695.png" alt="" class="wp-image-11703" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/CreatingAnAndroidEmulator-1024x695.png 1024w, https://blog.xojo.com/wp-content/uploads/2023/07/CreatingAnAndroidEmulator-300x204.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/CreatingAnAndroidEmulator-768x521.png 768w, https://blog.xojo.com/wp-content/uploads/2023/07/CreatingAnAndroidEmulator-1536x1043.png 1536w, https://blog.xojo.com/wp-content/uploads/2023/07/CreatingAnAndroidEmulator.png 2000w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<ol class="wp-block-list">
<li>If you haven&#8217;t already downloaded and installed Android Studio, do that now.</li>



<li>Launch Android Studio.</li>



<li>If you have already created a project in Android Studio, you can open that project. Otherwise, click the New Project button.</li>



<li>In the dialog box that is displayed, choose the default project type.</li>



<li>Click the Next button then click the Finish button.</li>



<li>Once you have a project open, choose Tools &gt; Device Manager. The Device Manager pane appears on the right side of the project window.</li>



<li>Click on the Create Device button. The Virtual Device Configuration dialog box appears.</li>



<li>Choose the category for the type of emulator you need. Phone is chosen by default.</li>



<li>Scroll through the list of devices to find one that suits you. We recommend choosing one that has the Google Play Store icon in the Play Store column.</li>



<li>Click the Next button.</li>



<li>On the System Image page the appropriate system image for the device you selected should be automatically selected for you. Just make sure the version of Android is at least the <a href="https://documentation.xojo.com/resources/system_requirements_for_current_release.html">minimum version supported by Xojo</a>.</li>



<li>Click the Next button.</li>



<li>On the final page you can rename the device if you&#8217;d like. If you&#8217;re going to be creating a lot of Android apps, consider increasing the storage in your emulator by clicking the Show Advanced Settings button and then scrolling the lefthand pane down a bit until you see the Internal Storage field. It defaults to 2048MB so you might want to increase that a bit.</li>



<li>Click the Finish button. Your emulator appears in the Device Manager pane.</li>



<li>Quit Android Studio and go to Xojo. Android Studio cannot be running while you use emulators in Xojo.</li>
</ol>



<p>Now you&#8217;re ready to use the emulator you created.</p>



<p>In Xojo, open an Android project, in the Navigator click on Android under Build Settings and you&#8217;ll see the Android Debugging section. If you have only created one emulator, it will be selected by default. If you&#8217;ve created several, they will all be listed.</p>



<p>The first time you use a new emulator it takes Android Studio it takes a bit longer than normal for it to launch. These emulators also sometimes stop working. When that happens, launch Android Studio, open a project or create a new one, go to Tools &gt; Device Manager to display the Device Manager pane, delete the bad emulator and create a new one.</p>



<p>Don&#8217;t forget that Xojo supports on-device debugging (<a href="https://youtu.be/8B9dLxe2asY">Video</a>: Setting Up On-Device Debugging on Your Android Device) as well so if you have an Android phone or tablet, you can run your apps directly on the device which you may find to be a better overall experience for testing and debugging.</p>



<p>Learn more about using Xojo Android in the <a href="https://blog.xojo.com/category/cross-platform/android/">Android</a> category in the Xojo Programming Blog.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Filtering the Debugger</title>
		<link>https://blog.xojo.com/2023/03/28/filtering-the-debugger/</link>
		
		<dc:creator><![CDATA[Javier Menendez]]></dc:creator>
		<pubDate>Tue, 28 Mar 2023 11:00:00 +0000</pubDate>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Beginner Tips]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Multi-Platform Development]]></category>
		<category><![CDATA[Rapid Application Development]]></category>
		<category><![CDATA[Remote Debugging]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Xojo Code]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=11405</guid>

					<description><![CDATA[Starting with Xojo 2023r1 you'll find a new feature in Xojo's Debugger panel that allows you to filter the objects and variables displayed, even between different project runs! That way you can stay focused on the more important objects and variables instead of scrolling through the list of all entries.]]></description>
										<content:encoded><![CDATA[
<p>Starting with Xojo 2023r1 you&#8217;ll find a new feature in Xojo&#8217;s Debugger panel that allows you to filter the objects and variables displayed, even between different project runs! This lets you stay focused on the more important objects and variables instead of scrolling through the list of all entries.</p>



<span id="more-11405"></span>



<p>I&#8217;ll outline the way it works here:</p>



<ul class="wp-block-list">
<li>Start typing in the Filter field <strong>(1)</strong>. You can enter a single item or several items names using a comma.</li>



<li>As you type, the list will display the filtered matches using the default &#8220;Begins with&#8221; matching criteria. You can change the matching type using the popup menu found at the right of the Filter field <strong>(2)</strong>.</li>



<li>If you want more control of the items filtered, click on the Edit filter button <strong>(3)</strong>. Here you&#8217;ll be able to select the items to filter, clear all or select all of them. The list will be filtered based on that criteria once the dialog is closed.</li>
</ul>



<figure class="wp-block-image is-style-default"><img loading="lazy" decoding="async" width="1024" height="643" src="https://blog.xojo.com/wp-content/uploads/2023/03/DebuggerFilter-1024x643.png" alt="" class="wp-image-11406" srcset="https://blog.xojo.com/wp-content/uploads/2023/03/DebuggerFilter-1024x643.png 1024w, https://blog.xojo.com/wp-content/uploads/2023/03/DebuggerFilter-300x188.png 300w, https://blog.xojo.com/wp-content/uploads/2023/03/DebuggerFilter-768x482.png 768w, https://blog.xojo.com/wp-content/uploads/2023/03/DebuggerFilter.png 1352w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>


<div class="wp-block-image is-style-default">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="802" height="540" src="https://blog.xojo.com/wp-content/uploads/2023/03/FilterEdit.png" alt="" class="wp-image-11407" srcset="https://blog.xojo.com/wp-content/uploads/2023/03/FilterEdit.png 802w, https://blog.xojo.com/wp-content/uploads/2023/03/FilterEdit-300x202.png 300w, https://blog.xojo.com/wp-content/uploads/2023/03/FilterEdit-768x517.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></figure>
</div>


<p>The combination of the filter criteria and matching type for the current selected stack frame and variable/object will be remembered and automatically applied again when that same object/variable is selected in the Debugger Panel. This also applies when that same project is debugged again, even at different Xojo runs.</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="628" height="388" src="https://blog.xojo.com/wp-content/uploads/2023/03/DebugFilter.gif" alt="" class="wp-image-11408"/></figure>
</div>


<p>As you can see, this debugger filter can be very helpful when there are a lot of objects and variables displayed during the app&#8217;s debugging session. No license is required to learn, develop and test your projects in the latest Xojo release! <a href="https://xojo.com/download/">Download Xojo</a> 2023r1 today!</p>



<p><em>Javier Menendez is an engineer at Xojo and has been using Xojo since 1998. He lives in Castellón</em>, <em>Spain and hosts regular Xojo hangouts en español. Ask Javier questions on Twitter at <a href="https://twitter.com/xojoes" target="_blank" rel="noreferrer noopener">@XojoES</a> or on the <a href="https://forum.xojo.com/u/javier_menendez/summary" target="_blank" rel="noreferrer noopener">Xojo Forum</a>.</em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>What the PDB is this?</title>
		<link>https://blog.xojo.com/2022/07/25/what-the-pdb-is-this/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Mon, 25 Jul 2022 13:54:00 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Multi-Platform Development]]></category>
		<category><![CDATA[PDB]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=10547</guid>

					<description><![CDATA[Starting in Xojo 2022r2 you have the option to generate Program Database (PDB) files with your 64-bit Windows builds. If you&#8217;re unfamiliar with what PDB&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Starting in Xojo 2022r2 you have the option to generate <a href="https://en.wikipedia.org/wiki/Program_database">Program Database (PDB)</a> files with your 64-bit Windows builds. If you&#8217;re unfamiliar with what PDB files are, or how they are used, then this post will help explain how PDBs can assist you with your debugging needs.</p>



<p>While our debugger is a powerful tool in helping you track down bugs in your program, there are times when tricky problems arise that go beyond the scope of what our debugger can handle. It&#8217;s times like these that PDBs can potentially come to the rescue.</p>



<p>So what is a PDB file? In short, PDBs are a file format developed by Microsoft for storing debugging information about a program. The most important part is how it maps each function address to its equivalent function name. Let&#8217;s take a simple example to see how this looks when we don&#8217;t have a PDB to help us.</p>



<h3 class="has-large-font-size wp-block-heading">The Offending Code</h3>



<pre class="wp-block-code has-black-color has-text-color"><code>Var mb As New MemoryBlock(8)
mb.Int64Value(0) = 1
mb = mb.Ptr(0)

// At this point the MemoryBlock is pointing to memory location
// 0x1 which should not be accessible.
mb.StringValue(0, 4) = "Test"</code></pre>



<p>In this example, we&#8217;re purposely causing a hard crash here by accessing memory that is not ours to access. Add the offending code somewhere in your program, i.e. in the Opening event or in the Pressed event of a PushButton. If you run this in the debugger you&#8217;ll notice that the app just quits, along with our debugger. Since our debugger has failed us here, let&#8217;s try Microsoft&#8217;s WinDbg and see if we can get any more information from it.</p>



<h3 class="has-large-font-size wp-block-heading">WinDbg</h3>



<p>If you don&#8217;t already have WinDbg installed, you can now download this from the Microsoft Store:<br><a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-download-tools">https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-download-tools</a><br>For many Windows developers this is a great (and free) addition to help you track down those annoying crashes. To use this, build the Xojo app with the offending code. Run WinDbg and point it to the executable to launch. Once the process is loaded in WinDbg, hit their Go button to cause the crash.</p>



<p>With the app crashed, you can see the most recent stack trace where some of the last functions that were called before it crashed. This is what the stack trace looks like when no PDB exists.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1766" height="1282" src="https://blog.xojo.com/wp-content/uploads/2022/06/StackTraceWithoutPDB.png" alt="" class="wp-image-10552" srcset="https://blog.xojo.com/wp-content/uploads/2022/06/StackTraceWithoutPDB.png 1766w, https://blog.xojo.com/wp-content/uploads/2022/06/StackTraceWithoutPDB-300x218.png 300w, https://blog.xojo.com/wp-content/uploads/2022/06/StackTraceWithoutPDB-1024x743.png 1024w, https://blog.xojo.com/wp-content/uploads/2022/06/StackTraceWithoutPDB-768x558.png 768w, https://blog.xojo.com/wp-content/uploads/2022/06/StackTraceWithoutPDB-1536x1115.png 1536w" sizes="auto, (max-width: 1766px) 100vw, 1766px" /></figure>



<p>Since the debugger doesn&#8217;t have the information it needs to map the address to a particular function, it&#8217;ll just report this random address which isn&#8217;t very helpful.</p>



<h3 class="has-large-font-size wp-block-heading"><strong>Generate the PDB File</strong></h3>



<p>Now build the app again but this time generate the PDB file. This option can be found in the Advanced build settings in Xojo 2022r2 and later.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2022/06/AdvancedBuildSettingWithPDB.png" alt="" class="wp-image-10550" width="301" height="336" srcset="https://blog.xojo.com/wp-content/uploads/2022/06/AdvancedBuildSettingWithPDB.png 601w, https://blog.xojo.com/wp-content/uploads/2022/06/AdvancedBuildSettingWithPDB-269x300.png 269w" sizes="auto, (max-width: 301px) 100vw, 301px" /></figure>
</div>


<p>Run the app again under WinDbg. When you cause the app to crash again, WinDbg will look for a PDB file (note: it can be tuned to look in several different places, but by default it will look at the same directory as the executable). This time when the app crashes, you should get a more readable stack trace.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1920" height="1269" src="https://blog.xojo.com/wp-content/uploads/2022/06/StackTraceWithPDB.png" alt="" class="wp-image-10551" srcset="https://blog.xojo.com/wp-content/uploads/2022/06/StackTraceWithPDB.png 1920w, https://blog.xojo.com/wp-content/uploads/2022/06/StackTraceWithPDB-300x198.png 300w, https://blog.xojo.com/wp-content/uploads/2022/06/StackTraceWithPDB-1024x677.png 1024w, https://blog.xojo.com/wp-content/uploads/2022/06/StackTraceWithPDB-768x508.png 768w, https://blog.xojo.com/wp-content/uploads/2022/06/StackTraceWithPDB-1536x1015.png 1536w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></figure>



<h3 class="has-large-font-size wp-block-heading">PDBs in the Real World</h3>



<p>While the scenario that we just went through isn&#8217;t the most common one in the real world, it should provide you an idea of how a PDB file can help with debugging. In a real world scenario, you as the developer, will likely store PDBs internally, maybe on a server somewhere. Each time you build your app for deployment (i.e. when your app is released to the public) you would keep this PDB somewhere. Whenever your clients/users experience crashes in your app, you can ask them to send over a minidump. The same principle applies to executables and minidumps, just load it up and run it. However, the only difference is that the minidump may need more help in locating the right PDB file.</p>



<p>For more information on this topic please refer to: <a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/symbol-path">https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/symbol-path</a></p>



<p><em>William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo&#8217;s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>On-Device iOS Debugging in Xojo</title>
		<link>https://blog.xojo.com/2022/04/05/on-device-ios-debugging-in-xojo/</link>
		
		<dc:creator><![CDATA[Greg O'Lone]]></dc:creator>
		<pubDate>Tue, 05 Apr 2022 13:30:00 +0000</pubDate>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Multi-Platform Development]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Xojo API 2.0]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=10008</guid>

					<description><![CDATA[You may or may not be aware that running iOS projects in the Simulator does not allow you to check all of your app's features. There are a few features which rely on hardware capabilities which the Simulator cannot emulate. This can make it hard to track down bugs, and the only recourse is console logging. Starting in Xojo 2022r1 it's possible to run your apps right on a physical device connected by USB.]]></description>
										<content:encoded><![CDATA[
<p>You may or may not be aware that running <a href="https://documentation.xojo.com/topics/debugging/testing_and_debugging_your_ios_apps.html#running-your-app-in-the-ios-simulator">iOS projects in the Simulator </a>does not allow you to check all of your app&#8217;s features. There are a few features which rely on hardware capabilities which the Simulator cannot emulate. This can make it hard to track down bugs, and the only recourse is console logging. Starting in Xojo 2022r1 it&#8217;s possible to <a href="https://documentation.xojo.com/topics/debugging/testing_and_debugging_your_ios_apps.html#running-your-app-on-device">run your apps right on a physical device</a> connected by USB. Learn how in this post.</p>



<h2 class="wp-block-heading" id="setup">Setup</h2>



<p>Debugging on device requires your device be connected to your computer using a lightning cable.</p>



<p><strong>Computer</strong><br>You&#8217;ll need to launch Xcode, plug your phone in using USB and open Xcode&#8217;s Devices and Simulators window. In the navigation pane on the left, select the device and check the Show as run destination<strong> </strong>checkbox<strong>.</strong> </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="233" src="https://blog.xojo.com/wp-content/uploads/2022/03/CleanShot-2022-03-30-at-14.14.20@2x-1024x233.png" alt="" class="wp-image-10252" srcset="https://blog.xojo.com/wp-content/uploads/2022/03/CleanShot-2022-03-30-at-14.14.20@2x-1024x233.png 1024w, https://blog.xojo.com/wp-content/uploads/2022/03/CleanShot-2022-03-30-at-14.14.20@2x-300x68.png 300w, https://blog.xojo.com/wp-content/uploads/2022/03/CleanShot-2022-03-30-at-14.14.20@2x-768x175.png 768w, https://blog.xojo.com/wp-content/uploads/2022/03/CleanShot-2022-03-30-at-14.14.20@2x-1536x350.png 1536w, https://blog.xojo.com/wp-content/uploads/2022/03/CleanShot-2022-03-30-at-14.14.20@2x-2048x466.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>Device</strong><br>If you&#8217;ll be debugging over USB, go to the Settings app on your device, select Personal Hotspot and turn that on.</p>



<h3 class="wp-block-heading" id="apple-developer-portal">Apple Developer Portal</h3>



<p>For on-device debugging, your app profiles must be set up properly. For help on this, read <a href="https://blog.xojo.com/2021/10/26/the-crazy-exercise-that-is-the-apple-signing-process/" data-type="URL" data-id="https://blog.xojo.com/2021/10/26/the-crazy-exercise-that-is-the-apple-signing-process/">The Crazy Exercise That Is The Apple Signing Process</a>.</p>



<ol class="wp-block-list">
<li><strong>Certificates</strong>: You will need a Development certificate for yourself. Download it and double-click the file to install it.</li>



<li><strong>Identifiers</strong>: You will need an Application Identifier that matches the Bundle Identifier in your app.</li>



<li><strong>Devices</strong>: You must register all of the devices that you intend to debug on.</li>



<li><strong>Profiles</strong>: You will need to create a Development profile for the app and make sure it contains your Development certificate (from step 1) as well as each of the devices that you want to debug on (step 3). Download the profile and double-click the file to install it.</li>
</ol>



<h3 class="wp-block-heading" id="xojo">Xojo</h3>



<p>Debugging on-device requires that you set the Team from your account as well as setting the Build For property to App Store.</p>



<p>When you&#8217;re ready to run on a device, from the menu select Project &gt; Run On and select your device from the list. If everything is configured properly, your app should be transferred to the device and automatically run for you.</p>



<h2 class="wp-block-heading" id="notes">Notes</h2>



<p>The first time you debug an app, you will get a dialog on the device asking if your app can connect to the local network. You will need to allow that and then run your app from Xojo again.</p>



<p>Don&#8217;t allow your device to go to sleep while waiting for the app to build and transfer or the app won&#8217;t be able to launch. You can increase the amount of time on the device by going to Settings &gt; Display &amp; Brightness and selecting a new Auto-Lock timeout. The options are 2, 5, 10 or 15 Minutes or Never.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Rubber Ducky, You&#8217;re the One</title>
		<link>https://blog.xojo.com/2021/10/14/rubber-ducky-youre-the-one/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Thu, 14 Oct 2021 22:19:19 +0000</pubDate>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Beginner Tips]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Rubber Ducking]]></category>
		<category><![CDATA[Software Development]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=9427</guid>

					<description><![CDATA[Yuck! It happens to everyone, from beginners to experienced developers: sometimes you’ll get stuck. Perhaps the code you’re working on just won’t do what you want or maybe you’re having trouble understanding code plucked from the internet. Talk to the duck. The rubber duck, that is. The term “rubber ducking” or "rubber duck debugging" is a software development technique where you explain the problem you are having to a rubber duck (or appropriate substitute). Often the act of explaining the problem to someone else, even if that someone is not real, can help you figure it out. It might be like inspiration struck.]]></description>
										<content:encoded><![CDATA[
<p>Yuck! It happens to everyone, from beginners to experienced developers: sometimes you get stuck. Perhaps the code you’re working on just won’t do what you want or maybe you’re having trouble understanding code plucked from the internet.</p>



<div class="wp-block-image"><figure class="alignright is-resized"><img loading="lazy" decoding="async" src="https://cdn.pixabay.com/photo/2020/05/19/06/32/duck-5189444__340.jpg" alt="Duck, Toy, Bath Duck, Squeaky Duck" width="247" height="185"/></figure></div>



<p>Regardless, it sucks, is incredibly frustrating and at times feels like you’ve been run over by a truck. You want to huck your laptop across the room.</p>



<p>When this happens, it’s time to get out of the muck and talk to the duck.</p>



<p>What the duck am I talking about you ask?</p>



<p>Well, it’s rubber ducking of course. One great way to work through a problem is to verbalize it. And these days with everyone working from home, sometimes you don’t have a coworker that you can interrupt.</p>



<p>So instead, you can talk to the duck. The rubber duck, that is. The term “rubber ducking” or &#8220;rubber duck debugging&#8221; is a <a href="https://en.wikipedia.org/wiki/Rubber_duck_debugging">software development technique</a> where you explain the problem you are having to a rubber duck (or appropriate substitute). Often the act of explaining the problem to someone else, even if that someone is not real, can help you figure it out. It might be like inspiration struck.</p>



<p>Your duck can be anything. My rubber duck is a Darth Vader squeeze toy I keep on my desk. Some people talk to their pets.</p>



<div class="wp-block-image"><figure class="alignright size-large is-resized"><img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2021/10/IMG_3634D-768x1024.jpg" alt="" class="wp-image-9428" width="270" height="360" srcset="https://blog.xojo.com/wp-content/uploads/2021/10/IMG_3634D-768x1024.jpg 768w, https://blog.xojo.com/wp-content/uploads/2021/10/IMG_3634D-225x300.jpg 225w, https://blog.xojo.com/wp-content/uploads/2021/10/IMG_3634D-1152x1536.jpg 1152w, https://blog.xojo.com/wp-content/uploads/2021/10/IMG_3634D-1536x2048.jpg 1536w, https://blog.xojo.com/wp-content/uploads/2021/10/IMG_3634D-scaled.jpg 1920w" sizes="auto, (max-width: 270px) 100vw, 270px" /></figure></div>



<p>Another way to take advantage of this technique is to start writing a <a href="https://forum.xojo.com">forum post</a>. Personally, I’ve lost track of the number of times I’ve started writing a post (or a text or an email) explaining a problem I’m having and before I can finish writing it, the solution has presented itself, tucked neatly within my words.</p>



<p>Of course, sometimes you actually need to brainstorm an idea with someone, so if after taking to the duck, you’re still stuck, then it’s time to chat with a coworker who can maybe help you pluck an idea out of the air. Zoom, Teams, Slack and other video conferencing tools are a great way to do that.</p>



<p>So in closing, if you’re stuck, which sucks, then get yourself out of the muck and talk to the duck.</p>



<p>Good luck!</p>



<p></p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Sesame Street: Ernie and his Rubber Duckie" width="500" height="375" src="https://www.youtube.com/embed/Mh85R-S-dh8?start=26&#038;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>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Debugging Apple Silicon (M1) apps</title>
		<link>https://blog.xojo.com/2020/12/08/debugging-apple-silicon-m1-apps/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Tue, 08 Dec 2020 10:00:00 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Apple Silicon]]></category>
		<category><![CDATA[Apple Silicon M1 Debugging]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=7822</guid>

					<description><![CDATA[While we make the full transition of building the Xojo IDE for M1, you can continue to leverage debugging M1 apps while using the Intel based Xojo IDE on macOS.]]></description>
										<content:encoded><![CDATA[
<p>While we make the full transition of building the Xojo IDE for M1, you can continue to leverage debugging M1 apps while using the Intel based Xojo IDE on macOS.</p>



<p><strong>Native machine debugging on M1</strong></p>



<p>The advantage of running the Xojo IDE on the M1 is that you can debug both an Intel or M1 based app on the same machine. Find the new Architecture settings in the macOS Build Settings inspector. For purposes of macOS builds, x86 64-bit means Intel and ARM 64-bit is M1.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="582" height="198" src="https://blog.xojo.com/wp-content/uploads/2020/12/Architectures.png" alt="" class="wp-image-7823" srcset="https://blog.xojo.com/wp-content/uploads/2020/12/Architectures.png 582w, https://blog.xojo.com/wp-content/uploads/2020/12/Architectures-300x102.png 300w" sizes="auto, (max-width: 582px) 100vw, 582px" /></figure>



<p>Note that when you debug a Universal app, you will actually be debugging an Intel app on an M1 (at least currently, until we build our Xojo IDE for M1) . In order to debug a native M1 app, choose the ARM 64-bit architecture when debugging.</p>



<p><strong>Remote debugging to M1</strong></p>



<p>If your preference is working on your Intel based Mac, you can also setup Remote Debugging to your M1 machine to debug Intel or M1 based apps. The same architecture settings apply, so to remote debug a native M1 build, select the ARM 64-bit architecture. If you select the x86 64-bit or Universal architecture then you will be debugging an Intel build.</p>



<p>Happy coding &amp; debugging!</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Default Values Tip</title>
		<link>https://blog.xojo.com/2020/02/20/default-values-tip/</link>
		
		<dc:creator><![CDATA[Wayne Golding]]></dc:creator>
		<pubDate>Thu, 20 Feb 2020 10:00:00 +0000</pubDate>
				<category><![CDATA[Guest Post]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Remote Debugging]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=6641</guid>

					<description><![CDATA[Often when debugging an application, you’ll need to enter the same data in the same fields over &#038; over.  There is a temptation to set the value of the field to the test data.  The downside of this is that you need to remove all those defaults before deploying your application.  ]]></description>
										<content:encoded><![CDATA[
<p>Here’s a tip for defaulting TextField Values for debugging purposes only.</p>



<p>Often when debugging an application, you’ll need to enter the same data in the same fields over and over. There is a temptation to set the value of the field to the test data. The downside of this is that you need to remove all those defaults before deploying your application.  What if some of those default values gives admin access to your database?</p>



<p>I add an Open event handler for those fields and use pragmas to keep the data secure. For example, in a text field open event handler I’ll put the code:</p>



<pre class="wp-block-preformatted">Sub Open() Handles Open
 #If DebugBuild
  me.Value = "wayneg@axisdirect.nz"
 #EndIf
End Sub</pre>



<p>When building a deployable version of the application an empty event hander method will be included and my email address will be kept private. Now, I don’t need to remove private data from the project and it will still be there for the next release cycle.</p>



<p><em>Wayne Golding has been a Xojo developer since 2005 and is a Xojo MVP. He operates the IT Company <a href="http://www.axisdirect.nz">Axis Direct Ltd </a>which primarily develops applications using Xojo that integrate with Xero www.xero.com. Wayne’s hobby is robotics where he uses Xojo to build applications for his Raspberry Pi, often implementing IoT for remote control.</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>2019r2 Debugger Improvements</title>
		<link>https://blog.xojo.com/2019/10/09/2019r2-debugger-improvements/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Wed, 09 Oct 2019 11:30:05 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[2019r2]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Remote Debugging]]></category>
		<category><![CDATA[Xojo API 2.0]]></category>
		<category><![CDATA[Xojo IDE]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=6057</guid>

					<description><![CDATA[At XDC 2019, I did a session called Avoiding Troubleshooting Troubles, which was essentially about ways to take advantage of the Xojo debugger. During the&#8230;]]></description>
										<content:encoded><![CDATA[
<p>At XDC 2019, I did a session called <em>Avoiding Troubleshooting Troubles</em>, which was essentially about ways to take advantage of the Xojo debugger. During the session, someone (I apologize, but I&#8217;ve forgotten who it was) asked if the debugger had a way to temporarily disable breakpoints to make it easier to test. The reasoning was that sometimes you want to test a fix without the debugger stopping all the time and don&#8217;t want to clear all of your carefully placed breakpoints.</p>



<div class="wp-block-image"><figure class="alignright is-resized"><img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2019/09/image.png" alt="" class="wp-image-6058" width="192" height="215" srcset="https://blog.xojo.com/wp-content/uploads/2019/09/image.png 766w, https://blog.xojo.com/wp-content/uploads/2019/09/image-267x300.png 267w" sizes="auto, (max-width: 192px) 100vw, 192px" /><figcaption>Ignore All Breakpoints</figcaption></figure></div>



<p>At that time, Xojo did not have this feature, but I did say that I thought it sounded pretty useful.</p>



<p>I&#8217;m happy to let you know that as of 2019r2, Xojo now has this feature. We call it <strong>Ignore All Breakpoints</strong> and you can turn it on or off from the Project -&gt; Breakpoint -&gt; Ignore All menu. A checkmark appears next to this menu when Ignore breakpoints is active. And when active, Xojo will not stop at any of your breakpoints. You can turn it on or off during the debug run as needed.</p>



<p>2019r2 also has a couple other improvements to the debugger as well:</p>



<ul class="wp-block-list"><li>The debugger no longer stops at breakpoints within encrypted classes. This was not helpful and actually rather confusing since you couldn&#8217;t see the code.</li><li>Breakpoints set within a Module Class Method during a debugging session now properly break in the debugger.</li></ul>



<p>Xojo 2019 Release 2 has lots of new features and improvements, so be sure to <a href="https://www.xojo.com/download/">download</a> it today and review the full <a href="http://documentation.xojo.com/Resources:2019r2_Release_Notes">Release Notes</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Computed Property Tips for Debugging</title>
		<link>https://blog.xojo.com/2019/05/20/computed-property-tips-for-debugging/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Mon, 20 May 2019 17:39:33 +0000</pubDate>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Computed Property]]></category>
		<category><![CDATA[Debugging]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=5756</guid>

					<description><![CDATA[Here are a couple tips you can use with computed properties that are helpful when debugging.]]></description>
										<content:encoded><![CDATA[
<p>Here are a couple tips you can use with computed properties.</p>



<span id="more-5756"></span>



<h2 class="wp-block-heading">Read-Only Computed Properties</h2>



<p>When you create a Computed Property, you&#8217;ll get a section call Get and a section called Set. The Get section is where you put the code to return the value for the property and the Set section is where you put code to set the computed property value. Did you know you do not have to fill in both sections?</p>



<p>If you leave the Set section empty, you&#8217;ve created a read-only computed property. You&#8217;ll be able to get its value as per usual but if you try to set a value you&#8217;ll get a compile error. This can sometimes be a great alternative to using a method because the computed property value appears in the debugger.</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="300" src="https://blog.xojo.com/wp-content/uploads/2019/05/2019-05-20_10-21-01-1-1024x300.png" alt="" class="wp-image-5757" srcset="https://blog.xojo.com/wp-content/uploads/2019/05/2019-05-20_10-21-01-1-1024x300.png 1024w, https://blog.xojo.com/wp-content/uploads/2019/05/2019-05-20_10-21-01-1-300x88.png 300w, https://blog.xojo.com/wp-content/uploads/2019/05/2019-05-20_10-21-01-1-768x225.png 768w, https://blog.xojo.com/wp-content/uploads/2019/05/2019-05-20_10-21-01-1.png 1072w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>The sections with code are shown in bold so you can tell a read-only property because only its Set section will be bold.</p>



<h2 class="wp-block-heading">Break on Usage</h2>



<p>When debugging you may have situations where you would find it helpful to know when one of your property values changes. You can do this by changing a regular property to a Computed Property. To do this, right-click on the property and choose &#8220;Convert to Computed Property&#8221;. You&#8217;ll now have two related properties: a private &#8220;backing&#8221; property with a prefix of &#8220;m&#8221; (for example mLastName As String) and a corresponding Computed Property with the original name (for example LastName) that uses the private property to get and set its value.</p>



<p>In the Get and Set sections you can now set breakpoints on the code there so you&#8217;ll drop into the Debugger any time the property is accessed or changed.</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="335" src="https://blog.xojo.com/wp-content/uploads/2019/05/2019-05-20_10-22-55-1024x335.png" alt="" class="wp-image-5759" srcset="https://blog.xojo.com/wp-content/uploads/2019/05/2019-05-20_10-22-55-1024x335.png 1024w, https://blog.xojo.com/wp-content/uploads/2019/05/2019-05-20_10-22-55-300x98.png 300w, https://blog.xojo.com/wp-content/uploads/2019/05/2019-05-20_10-22-55-768x251.png 768w, https://blog.xojo.com/wp-content/uploads/2019/05/2019-05-20_10-22-55.png 1064w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>More Debugger and Computed Property tips are here:</p>



<ul class="wp-block-list"><li><a href="https://documentation.xojo.com/getting_started/debugging/debugger_usage.html">User Guide: Debugger</a></li><li><a href="https://documentation.xojo.com/getting_started/using_the_xojo_language/properties.html#Computed_Property">User Guide: Computed Properties</a></li><li><a href="https://www.xojo.com/store/#conference">XDC 2018 Session: Avoiding Troubleshooting Troubles</a></li></ul>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How Code One-Liners Can Make Debugging Harder</title>
		<link>https://blog.xojo.com/2019/02/12/how-code-one-liners-can-make-debugging-harder/</link>
		
		<dc:creator><![CDATA[Norman Palardy]]></dc:creator>
		<pubDate>Tue, 12 Feb 2019 10:00:59 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Remote Debugging]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=5410</guid>

					<description><![CDATA[A lot of times you'd think that a single line of code, aka a "one-liner" might not have any downside. But I'd argue that it does. You can't put a break point on the code that runs when the condition is true. Sometimes this may not matter. But when it does, like when you want to step into the method or code that IS run, you have to turn the one-liner into a multi-line if...end if statement.*]]></description>
										<content:encoded><![CDATA[<p>A lot of times you&#8217;d think that single lines of code, aka &#8220;one-liners&#8221;, like</p>
<pre>if j &gt;= 145 condition then dosomething()
</pre>
<p>or</p>
<pre>if condition then return
</pre>
<p>might not have any downsides. I would argue that they do.</p>
<p><span id="more-5410"></span></p>
<p>You can&#8217;t put a <a href="https://documentation.xojo.com/getting_started/debugging/debugger_usage.html#Breakpoint">break point</a> on the code that runs when the condition is true. And though sometimes this may not matter, when it does, like when you want to step into the method or code that <em>is</em> run, you have to turn the one-liner into a multi-line <a href="https://documentation.xojo.com/api/code_execution/if.html...Then...Else">If&#8230;End If</a> statement.<sup>*</sup></p>
<pre>if j &gt;= 145 condition then 
  dosomething()
end if
</pre>
<p>or</p>
<pre>if condition then 
  return
end if
</pre>
<p>This allows you to put the break point on the code and not on the conditional. If it is code that gets run a lot, this can be a big deal.</p>
<p>This is why, as I go through the Xojo IDE code base, I usually remove one-liners and turn them into multi-line if &#8230; end if statements. This way I can break on the code and not the conditional, and in some cases this saves many hundreds of calls and having to step through the code.</p>
<p>As always, remember that what you do today can save your sanity or break it tomorrow! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><sup>*</sup> Yes if you want to debug the called method <em>every</em> time you can put the break point in the called method. If you want to only break in this specific case, you have to rewrite the if statement so you can put a break on the method call line.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Avoiding False-Positive Virus Detection in Windows Apps</title>
		<link>https://blog.xojo.com/2018/01/29/avoiding-false-positive-virus-detection-in-your-windows-apps/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Mon, 29 Jan 2018 18:10:37 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[Anti-Virus]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[LLVM]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=3853</guid>

					<description><![CDATA[Anti-virus software can be a bit over-zealous about detecting what it believes to be apps that have viruses embedded within them. We have had reports over the years that apps made with Xojo are sometimes falsely identified as being infected with a virus. If you're having problems with such false positives, recompiling your apps for 64-bit may solve the problem. Doing this is not a 100% guarantee but it can reduce the chances of a false-positive occurring.]]></description>
										<content:encoded><![CDATA[<p>Viruses continue to be a big problem on Windows. As a result, anti-virus software can be a bit over-zealous about detecting what it believes to be apps that have viruses embedded within them. We have had reports over the years that apps made with Xojo are sometimes falsely identified as being infected with a virus. This sometimes occurs because the 32-bit Xojo compiler puts executable code in a location where the anti-virus software doesn&#8217;t expect to find it. We&#8217;ve seen this occur even when users are debugging apps from the IDE. Fortunately in that case, there&#8217;s a <a href="https://blog.xojo.com/2015/06/11/norton-internet-security-and-xojo/">fairly easy solution</a>.</p>
<p><span id="more-3853"></span></p>
<p>With the <a href="https://blog.xojo.com/2017/12/04/llvm-everywhere/">move to LLVM</a> as the backend of our compiler, the format of our Windows executables changed somewhat. LLVM puts the executable code in a different location that doesn&#8217;t set off those same flags for anti-virus software. If you&#8217;re having problems with such false positives, recompiling your apps for 64-bit may solve the problem. Doing this is not a 100% guarantee but it can reduce the chances of a false-positive occurring.</p>
<p>This is even more true if you are using console-based helper apps especially if you&#8217;re launching multiple instances of them. Despite this being a known and often-used technique for taking advantage of multiple cores (and one we <a href="https://blog.xojo.com/2018/01/25/supporting-multiple-cores/">wrote about</a> recently), it can make anti-virus software more suspicious. If your helper app has code that the anti-virus software thinks is in the wrong place, recompiling it for 64-bit may help.</p>
<p>Having said all of this, false is still false. If your apps (compiled for 32-bit or 64-bit) are falsely identified as having a virus, contact the anti-virus software company so they can update their software. Many have established protocols for reporting false positives.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Best-Laid Plans: 64-bit Windows Debugging</title>
		<link>https://blog.xojo.com/2017/07/26/the-best-laid-plans-64-windows-debugging/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Wed, 26 Jul 2017 16:20:32 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[LLVM]]></category>
		<guid isPermaLink="false">http://blog.xojo.com/?p=3157</guid>

					<description><![CDATA[In his poem, &#8220;The Mouse&#8221;, Robert Burns wrote: The best-laid plans of mice and men oft go astray&#8230; As Burns so eloquently stated, no matter&#8230;]]></description>
										<content:encoded><![CDATA[<p>In his poem, &#8220;The Mouse&#8221;, Robert Burns wrote:</p>
<blockquote><p>The best-laid plans of mice and men oft go astray&#8230;</p></blockquote>
<p>As Burns so eloquently stated, no matter how carefully you plan sometimes things just don&#8217;t work out. Anyone who has done software development for long knows this all too well.</p>
<p><span id="more-3157"></span></p>
<p>While Xojo already has 64-bit debugging for macOS and Linux, we had planned to include 64-bit debugging for Windows in 2017 Release 2 which will be shipping next month. As you may know, we rely on the open source LLVM compiler and toolchain for our 64-bit support. This provides huge advantages for us and you with features like 64-bit, ARM and performance optimizing, all with a lot less work compared to providing the entire compiler toolchain ourselves. The downside is that we are now dependent upon the LLVM project. While the LLVM team has been making fast progress, Windows debugging is not quite ready. We are confident it will be ready soon but there&#8217;s so much great stuff in Xojo 2017r2, we don&#8217;t want to delay it any longer.</p>
<p>If you have an active Xojo Pro license, you can test all the great new stuff coming in 2017r2 now (64-bit XojoScript, Windows Resource Compiler, and more). If you don&#8217;t have Xojo Pro but would still like to contribute to testing Xojo releases before they ship, go <a href="https://forum.xojo.com/38207-welcoming-more-pre-release-testers">here</a> to find out more.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Where is 64-Bit Debugging for Windows?</title>
		<link>https://blog.xojo.com/2017/03/28/where-is-64-bit-debugging-for-windows/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Tue, 28 Mar 2017 19:30:22 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Compiler]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[LLVM]]></category>
		<category><![CDATA[Machine Code]]></category>
		<guid isPermaLink="false">http://blog.xojo.com/?p=2522</guid>

					<description><![CDATA[Xojo 2017 Release 1 includes support for running and debugging 64-bit apps right from the IDE for macOS and Linux. Windows support is noticeably absent because we have been moving Xojo from our own compiler back end to using LLVM.]]></description>
										<content:encoded><![CDATA[<p><a href="http://developer.xojo.com/2017r1-release-notes">Xojo 2017 Release 1</a> includes support for running and debugging 64-bit apps right from the IDE for macOS and Linux. Windows support is noticeably absent. Why? The answer is a bit complicated but interesting.</p>
<p><span id="more-2522"></span></p>
<p>As you may know, Xojo&#8217;s compiler takes the code you write and translates it into a sort of meta-assembly language. Think of it as assembly code that is not specific to any particular processor. This part of the compiler is called the <em>Front End</em>. The <em>Back End</em> of the compiler takes that meta-assembly code and translates it into actual machine code for a particular processor such as x86 or ARM. We have been moving Xojo from our own compiler Back End to using an open source one known as <em>LLVM</em> which is used by Apple and others as well. It&#8217;s how we are building for 64-bit and it optimizes your code for speed, something our old compiler Back End did not do.</p>
<p>We depend on LLVM to provide us with the data we need to make debugging work. LLVM version 3.7 had the necessary support for macOS and Linux. LLVM version 4 has added this for Windows but it was released only a few weeks ago, not enough time for us to get it working for today&#8217;s release of Xojo 2017 Release 1. Although you don&#8217;t directly see LLVM when you use Xojo, it&#8217;s doing significant and important work. Switching from one major release of LLVM to another affects far more than just debugging so it must be done very early in our development of a release of Xojo. It&#8217;s likely that 64-bit debugging support for Windows will be available in Xojo 2017 Release 2.</p>
<p>64-bit support in Xojo may seem like a minor feature. After all, for most of you, switching from 32 to 64-bit is a single-click operation. However, for it to be that simple has required a huge amount of effort on our part. While you can still get by with 32-bit apps in most cases today, that won&#8217;t be true in the not-too-distant future. That&#8217;s why it&#8217;s critical we make it easy for you to switch. The importance of Xojo supporting 64-bit really can&#8217;t be overstated.</p>
<p>Remember that many features in Xojo take multiple release cycles to complete. That means that when the feature list is short, there&#8217;s working going on for future releases. When it&#8217;s long, much of that work may have been done during previous release cycles. It&#8217;s a curious fact of software development that sometimes features that seem simple on the outside are actually large and complex on the inside.</p>
<p>There&#8217;s a lot more coming for Xojo in 2017 so stay tuned.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Raspberry Pi Remote Debugging</title>
		<link>https://blog.xojo.com/2017/03/28/raspberry-pi-remote-debugging/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Tue, 28 Mar 2017 10:30:22 +0000</pubDate>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Beginner Tips]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Remote Debugging]]></category>
		<category><![CDATA[RPi]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">http://blog.xojo.com/?p=2485</guid>

					<description><![CDATA[Using the Remote Debugger means that you can run Xojo apps on the Pi for testing and development without have to first purchase a Xojo license.]]></description>
										<content:encoded><![CDATA[<p>With Xojo 2017 Release 1 you can now use the Remote Debugger to easily debug and test your Xojo apps on a Raspberry Pi (Raspberry Pi 2, 3+ are supported by Xojo).</p>
<p>Using the Remote Debugger means that you can now run Xojo apps on the Pi for testing and development without having to first purchase a Xojo license.</p>
<p>We&#8217;ve put together a short video to quickly walk you through how to set up and use the Remote Debugger:</p>
<p><iframe loading="lazy" title="Hello Xojo! Raspberry Pi App" width="500" height="281" src="https://www.youtube.com/embed/C7ZelqOyVIQ?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></p>
<p>For more information about using Raspberry Pi with the Remote Debugger, refer to this topic in the Dev Center:</p>
<ul>
<li><a href="https://documentation.xojo.com/topics/raspberry_pi/remote_debugging.html">Raspberry Pi Remote Debugging</a></li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Conditional Breakpoints</title>
		<link>https://blog.xojo.com/2016/05/04/conditional-breakpoints/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Wed, 04 May 2016 00:00:00 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Debugging]]></category>
		<guid isPermaLink="false">http://blogtemp.xojo.com/2016/05/04/conditional-breakpoints/</guid>

					<description><![CDATA[Learn how to create conditional breakpoints to simplify debugging.]]></description>
										<content:encoded><![CDATA[<p>You can set breakpoints in your Xojo code that cause the debugger to appear when the line of code with the breakpoint is reached. This is incredibly handy to help understand and test your code.</p>
<p><span id="more-261"></span></p>
<p>One thing that people often want is the ability to have a breakpoint only get used if a specific condition occurs. This is called a &#8220;conditional breakpoint&#8221;. Here are a couple ways you can set a conditional breakpoint, both of which require slight tweaks to your code.</p>
<h2>Break</h2>
<p>The Xojo Programming Language command &#8220;<a href="http://developer.xojo.com/break">Break</a>&#8221; immediately makes the debugger appear with the code stopped on that line. It has no effect for apps built for deployment. You can use this command with simple conditional statements to trigger a breakpoint for specific situations.</p>
<p>For example, if you are processing a file with 800 lines of data in a loop, but you&#8217;ve discovered a bug near the end of the data processing in line 700. What would be the best way to debug this? Well, you certainly don&#8217;t want to set a standard breakpoint inside the loop because this will cause the debugger to appear 700 times and force you to press resume 700 times. That would be painful.</p>
<p>Instead, you can simply check the line count and then use the Break command:</p>
<pre>Dim line As Integer
While Not inputStream.EOF
  line = line + 1
  Dim lineText As Text = myFile.ReadLine
  If line = 700 Then Break
  ' ... processing here
Wend</pre>
<p>Now the Debugger only appears when line 700 is reached and does not appear for any other line.</p>
<h2>Computed Property</h2>
<p>There may be times when you want to be notified any time a property value changes. The trick for this is to create the property as a Computed Property and use the Break command within the Set section.</p>
<p><img loading="lazy" decoding="async" title="ComputedBreak.png" src="https://blog.xojo.com/wp-content/uploads/2016/05/ComputedBreak.pngt1466486449161ampwidth547ampheight259" sizes="auto, (max-width: 547px) 100vw, 547px" alt="ComputedBreak.png" width="547" height="259" /></p>
<p>Any time the property is assigned a value, the code in the Set section is called, which drops you into the debugger so you can check the state of your app.</p>
<p>I hope these two tips help you get more out of the Xojo Debugger. For more information, refer to <a href="http://developer.xojo.com/userguide/using-the-debugger">Using the Debugger</a> in the User Guide or the <a href="http://developer.xojo.com/webinar-debugging">Debugging</a> video.</p>
<p><!--HubSpot Call-to-Action Code --> <span id="hs-cta-wrapper-aeb03183-a469-4f96-9547-7dd75111c681" class="hs-cta-wrapper"> <span id="hs-cta-aeb03183-a469-4f96-9547-7dd75111c681" class="hs-cta-node hs-cta-aeb03183-a469-4f96-9547-7dd75111c681"><br />
<!-- [if lte IE 8]>


<div id="hs-cta-ie-element"></div>


<![endif]--> <a href="http://cta-redirect.hubspot.com/cta/redirect/608515/aeb03183-a469-4f96-9547-7dd75111c681" target="_blank"><img decoding="async" id="hs-cta-img-aeb03183-a469-4f96-9547-7dd75111c681" class="hs-cta-img" style="border-width: 0px; margin: 0 auto; display: block; margin-top: 20px; margin-bottom: 20px;" src="https://blog.xojo.com/wp-content/uploads/2016/04/aeb03183-a469-4f96-9547-7dd75111c681.png" alt="XDC 2016 Houston, Texas" align="middle" /></a></span></span> <!-- end HubSpot Call-to-Action Code --></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How I learned to stop worrying and love the debugger</title>
		<link>https://blog.xojo.com/2015/09/08/how-i-learned-to-stop-worrying-and-love-the-debugger/</link>
		
		<dc:creator><![CDATA[Xojo]]></dc:creator>
		<pubDate>Tue, 08 Sep 2015 00:00:00 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Beginner Tips]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Remote Debugging]]></category>
		<guid isPermaLink="false">http://blogtemp.xojo.com/2015/09/08/how-i-learned-to-stop-worrying-and-love-the-debugger/</guid>

					<description><![CDATA[Learn to use the Debugger to find code errors quickly and easily.]]></description>
										<content:encoded><![CDATA[<p>Since we are all good programmers we never make mistakes, right ? <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>But for those times when you write some code and you just can&#8217;t figure out why its not behaving, there is always the Debugger!</p>
<p>The best part is the Debugger is very easy to use and it can help you sort out a lot of common issues. Its covered in the Xojo <a href="http://developer.xojo.com/user-guide" target="_blank" rel="noopener">User&#8217;s Guide,</a> specifically see the <a href="http://developer.xojo.com/userguide/using-the-debugger">Using the Debugger</a> section.</p>
<p><span id="more-287"></span></p>
<p>Let&#8217;s suppose you have an application and you have some code in the action event of a button that is giving you trouble. Open that event handler:</p>
<p><img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2015/09/shot1.pngt1466486449161ampwidth578ampheight349" sizes="auto, (max-width: 578px) 100vw, 578px" width="578" height="349" /></p>
<p>Now, set a breakpoint or a spot where your code will stop.</p>
<p>To do this, click in the left hand gutter on the dash or put the insertion point on the line you want a break point on and select Project &gt; Breakpoint &gt; Turn On.</p>
<p><img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2015/09/shot2.pngt1466486449161ampwidth578ampheight347" sizes="auto, (max-width: 578px) 100vw, 578px" width="578" height="347" /></p>
<p>The red dot indicates you have an active breakpoint on this line.</p>
<p>Now, when you run your application and press the button the code will execute and stop on the line marked. Note that it stops on this line BEFORE executing the line.<img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2015/09/shot3.pngt1466486449161ampwidth578ampheight352" sizes="auto, (max-width: 578px) 100vw, 578px" width="578" height="352" /></p>
<p>Now each time you press the Step button <img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2015/09/step.pngt1466486449161ampwidth84ampheight88" sizes="auto, (max-width: 84px) 100vw, 84px" width="84" height="88" />, the line of code will be executed and the program will stop BEFORE executing the next line.</p>
<p><img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2015/09/shot4.pngt1466486449161ampwidth578ampheight350" sizes="auto, (max-width: 578px) 100vw, 578px" width="578" height="350" /></p>
<p>And at each step you can see the values of the variables in the lower right hand variable viewer pane. If your calculation is having problems, you can step through it line by line and examine the values to see where things have gone awry.</p>
<p>Now you might think all this is well and good but there is no line after the one that sets returnpcnt.Text. What is the debugger going to do in that case? Well if you press step you&#8217;ll see that the debugger stops BEFORE exiting your code so you can indeed examine the values from the last line of code just as easily.</p>
<p><img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2015/09/shot5.pngt1466486449161ampwidth578ampheight352" sizes="auto, (max-width: 578px) 100vw, 578px" width="578" height="352" /></p>
<p>Learn to use the debugger. It will make life a whole lot easier for you. Of course in a short blog post I can only cover so much so visit the <a href="http://developer.xojo.com/userguide/using-the-debugger">Xojo Dev Center</a> to learn more.</p>
<p>Have fun.<span id="hs-cta-wrapper-05b821da-182e-4ab3-8182-c6cc64b8f8dc" class="hs-cta-wrapper"><span id="hs-cta-05b821da-182e-4ab3-8182-c6cc64b8f8dc" class="hs-cta-node hs-cta-05b821da-182e-4ab3-8182-c6cc64b8f8dc"><br />
</span></span> <!-- end HubSpot Call-to-Action Code --></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Take A Core Dump: What to do when your app crashes on Linux</title>
		<link>https://blog.xojo.com/2015/08/17/take-a-core-dump-what-to-do-when-your-app-crashes-on-linux/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Mon, 17 Aug 2015 00:00:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Debugging]]></category>
		<guid isPermaLink="false">http://blogtemp.xojo.com/2015/08/17/take-a-core-dump-what-to-do-when-your-app-crashes-on-linux/</guid>

					<description><![CDATA[Get answers to fundamental questions you may have about what happens when your application crashes on Linux.]]></description>
										<content:encoded><![CDATA[<p>With many things in life, more choices means more freedom of expression. We can pick and choose what we like personally as a way to express ourselves. Such is the world on Linux. The myriad of different Linux distros along with all the different Desktop managers and Window managers available are daunting. While more choices is nice (in general anyway), it can also cause more confusion. As a cross-platform developer, you&#8217;re probably aware that every operating system has their own way of dealing with crashes and crash reports.  On Linux this is no different, but it is more confusing because not every Linux distro plays by the same configuration. This blog will answer some fundamental questions you may have about what happens when your application crashes on Linux.</p>
<p><span id="more-324"></span></p>
<p><strong>What does it mean to &#8220;core dump&#8221;?</strong></p>
<p>Whenever an application crashes (and I don&#8217;t mean crashing with a Xojo Exception, for example), the operating system can store (or even send) a crash report. On macOS a nice crash reporter dialog shows up and you can even view the details of the crash report and get a sample of the stack trace. On Windows you may receive a similar such dialog, with a button to send the report to Microsoft. This crash report will show up in our Windows Error Reporting dashboard that we have setup with Microsoft, so please do hit that button when you can, it will help us out a lot. On Linux, whenever an app crashes (most commonly by a segmentation fault, i.e. when accessing a bad pointer/memory), it has the option of generating a core dump. In most cases though, this core dump generation is disabled by default.</p>
<p><strong>So what is a core dump and what information does it contain?</strong></p>
<p>Just like the crash report you see on macOS or the crash report you send us from a Windows crash, it&#8217;s a file which contains the program&#8217;s running state at the point of the crash. It also contains a snapshot of all the virtual memory areas accessed by your app, so yes, there can be confidential information stored in a core dump so be careful who you give it to.</p>
<p><strong>How does one enable the core dump to be generated, and where can I find this file?</strong></p>
<p>This actually depends on your Linux distro/configuration. For purposes of keeping this brief, I will detail the most common steps with links to read further if desired. Let&#8217;s assume we&#8217;re on a Linux distro that has a running Terminal using bash (for example, Ubuntu distros running Gnome desktop manager). To start, we need to tell the system how big of a core dump to allow.  To do this, type the following line in your Terminal:</p>
<pre>     ulimit -c unlimited</pre>
<p>By default, this value is 0, which is why the core dump is never generated. Executing the above line in a bash Terminal will allow the core dump to be generated for that Terminal session. The &#8220;unlimited&#8221; parameter tells the system not to restrict the size of the core dump file. Now assume you have an application that does crash, run that application in your Terminal session and wait for it to crash. Here&#8217;s a very simple example that generates a core dump. I&#8217;m on a 64-bit Ubuntu distro and I have failed to install the 32-bit ICU libraries:</p>
<p><img decoding="async" src="https://blog.xojo.com/wp-content/uploads/2015/08/CoreDumpExample.pngt1466486449161" alt="CoreDumpExample" /></p>
<p>After this terminates, you should see a &#8220;core&#8221; file generated in your current directory (however, depending on your configuration this may be located elsewhere).</p>
<p><img decoding="async" src="https://blog.xojo.com/wp-content/uploads/2015/08/CoreDumpFile.pngt1466486449161" alt="CoreDumpFile" /></p>
<p>Now that you have the core file, you can send this to the developer and he can debug it using gdb. Assuming the developer has access to the debug symbols (or can build the offending crashing app/lib with debug symbols), he/she can gather a fairly decent stack trace to figure out what the issue is. If you&#8217;re even slightly curious as to the stack trace, you could even debug this yourself if you know what the offending app/lib that crashed is. In our simple example, I know the crash occurs in XojoConsoleFramework32.so, so I would run gdb like this on the core file:</p>
<p><img decoding="async" src="https://blog.xojo.com/wp-content/uploads/2015/08/gdb.pngt1466486449161" alt="gdb" /></p>
<p>Now that the core file is loaded in gdb, you can proceed to perform a backtrace:</p>
<p><img decoding="async" src="https://blog.xojo.com/wp-content/uploads/2015/08/gdbtrace.pngt1466486449161" alt="gdbtrace" /></p>
<p>Note that gdb doesn&#8217;t load any debug info from our framework library since we don&#8217;t build release frameworks with debug info in them. We do however, store these debug info files locally and use them for purposes of debugging core dumps. So the core file itself, along with the right debug information, is extremely useful to have in debugging the crash. If your Linux app ever crashes, now you know how to generate a core dump, where to find it, and hopefully you&#8217;ll be able to send it to the developer(s) so that they can debug it.</p>
<p><strong>Here are some additional resources for further investigation, depending on your needs/distro.</strong></p>
<p>How to apply ulimit globally instead of in our terminal session:<br />
<a href="http://serverfault.com/questions/292237/apply-ulimit-globally-on-ubuntu" target="_blank" rel="noopener">http://serverfault.com/questions/292237/apply-ulimit-globally-on-ubuntu</a></p>
<p>How to generate core dumps for different shells (like tcsh) and different ways to generate the dump:<br />
<a href="http://stackoverflow.com/questions/17965/generate-a-core-dump-in-linux" target="_blank" rel="noopener">http://stackoverflow.com/questions/17965/generate-a-core-dump-in-linux</a></p>
<p>How to find your core dump file:<br />
<a href="http://stackoverflow.com/questions/2065912/core-dumped-but-core-file-is-not-in-current-directory" target="_blank" rel="noopener">http://stackoverflow.com/questions/2065912/core-dumped-but-core-file-is-not-in-current-directory</a></p>
<p>Debugging without executable:<br />
<a href="https://sourceware.org/ml/archer/2008-q4/msg00119.html">https://sourceware.org/ml/archer/2008-q4/msg00119.html</a></p>
<p>Have more questions about this? Ask me here or on the <a href="https://forum.xojo.com/conversations/linux" target="_blank" rel="noopener">Xojo Forums</a>.</p>
<p>Visit some of my other posts: <a href="/2014/05/14/control_sizes_on_linux/" target="_blank" rel="noopener">Control Sizes on Linux</a>, <a href="/2013/08/21/linux_and_overlay_scrollbars/" target="_blank" rel="noopener">Linux and Overlay Scrollbars</a>, and <a href="/2015/04/27/linux_libicu_and_xojo_2015_release_2/" target="_blank" rel="noopener">Linux, LiblCU and Xojo 2015r2</a>. Want to learn more about using Xojo on Linux or ask your own questions?</p>
<p style="text-align: center;"><!--HubSpot Call-to-Action Code --> <span id="hs-cta-wrapper-ab342e92-acde-4df6-86d9-b3d413cd88dc" class="hs-cta-wrapper"> <span id="hs-cta-ab342e92-acde-4df6-86d9-b3d413cd88dc" class="hs-cta-node hs-cta-ab342e92-acde-4df6-86d9-b3d413cd88dc"><br />
<!-- [if lte IE 8]></p>





<div id="hs-cta-ie-element"></div>


<![endif]--> <a href="https://forum.xojo.com/conversations/linux" target="_blank" rel="noopener"><img loading="lazy" decoding="async" id="hs-cta-img-ab342e92-acde-4df6-86d9-b3d413cd88dc" class="hs-cta-img alignnone" style="border-width: 0px;" src="https://blog.xojo.com/wp-content/uploads/2015/08/ab342e92-acde-4df6-86d9-b3d413cd88dc.png" alt="Xojo Linux Forum" width="602" height="105" /></a> </span></span><br />
<!-- end HubSpot Call-to-Action Code --></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
