# Debugging Tips

**URL:** <https://ifnotnil.com/t/debugging-tips/531>\
**Category:** Xojo\
**Created:** [29 May 2020 20:40 UTC](https://ifnotnil.com/t/debugging-tips/531 "2020-05-29T20:40:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [29 May 2020 20:40 UTC](https://ifnotnil.com/t/debugging-tips/531/1 "2020-05-29T20:40:03Z")

</div>

In code I will often put a simple bit like

```plaintext
#if DebugBuild
  if 1 = 2 then break
#endif

```

as a place to put break points that I can toggle as I debug

However, when/if the debugger doesn’t stop at a break point its hard to use this since its not a hard break statement that it WILL stop at

Anyone else got some debugging tips ?

---

<div class="post-metadata">

**Author:** ![jmadren](https://ifnotnil.com/user_avatar/ifnotnil.com/jmadren/32/65_2.png) [@jmadren](https://ifnotnil.com/u/jmadren)\
**Post date:** [29 May 2020 23:15 UTC](https://ifnotnil.com/t/debugging-tips/531/2 "2020-05-29T23:15:13Z")

</div>

I don’t quite follow - what are you toggling? Why not just use a simple Break statement without the If and the compile conditionals? Break only applies to a debug build/run.

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [30 May 2020 04:29 UTC](https://ifnotnil.com/t/debugging-tips/531/3 "2020-05-30T04:29:55Z")

</div>

A break point on that line which I see I neglected to mention 🙂  
Sometimes you dont want to break all the time  
So set a break point on that line or remove it

---

<div class="post-metadata">

**Author:** ![beatrixwillius](https://ifnotnil.com/user_avatar/ifnotnil.com/beatrixwillius/32/24_2.png) [@beatrixwillius](https://ifnotnil.com/u/beatrixwillius)\
**Post date:** [30 May 2020 05:28 UTC](https://ifnotnil.com/t/debugging-tips/531/4 "2020-05-30T05:28:00Z")

</div>

Don’t step too long through the debugger or the debugger will crash.

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [30 May 2020 15:06 UTC](https://ifnotnil.com/t/debugging-tips/531/5 "2020-05-30T15:06:13Z")

</div>

If you view the contents of some variables, before you step again, set the debugger popup back to “Variables” (the first entry)  
If you leave it viewing the contents of an object that happens to go out of scope its very likely the debugger will crash

---

<div class="post-metadata">

**Author:** ![beatrixwillius](https://ifnotnil.com/user_avatar/ifnotnil.com/beatrixwillius/32/24_2.png) [@beatrixwillius](https://ifnotnil.com/u/beatrixwillius)\
**Post date:** [1 June 2020 07:48 UTC](https://ifnotnil.com/t/debugging-tips/531/6 "2020-06-01T07:48:04Z")

</div>

I always forget to reset the debugger. That bug is at least 10 years old.

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [1 June 2020 14:06 UTC](https://ifnotnil.com/t/debugging-tips/531/7 "2020-06-01T14:06:03Z")

</div>

I’d never seen it until the move to LLVM  
Its annoying as heck and a real pain to track down
