Search Unity

VS Community debugging - break out of infinite loops

Discussion in 'Scripting' started by guitarxe, Nov 28, 2015.

  1. guitarxe

    guitarxe

    Joined:
    Dec 1, 2013
    Posts:
    131
    Trying to debug an infinite loop and it doesn't help that Unity will happily keep looping till kingdom come instead of timing out at some point, so I have to keep killing Unity and restarting it to keep debugging.

    Is there a way to force stop script execution from VS Community while you are debugging? Unity is inaccessible while script is paused in debugger, and if I stop debugging it simply detaches and Unity keeps on hanging.
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  3. eisenpony

    eisenpony

    Joined:
    May 8, 2015
    Posts:
    974
    Not sure about VS community but in other flavors I've used, there is a "break all" button. It basically causes all threads to immediately hit a break point. It may not break exactly in your loop but the stack trace might be able to point you in the right direction so you can place a regular break point.
     
  4. Will-H

    Will-H

    Joined:
    Dec 12, 2013
    Posts:
    8