Only set the attached flag when a client attaches
authorJosh Peterson <petersonjm1@gmail.com>
Tue, 30 Aug 2016 15:00:32 +0000 (11:00 -0400)
committerJosh Peterson <petersonjm1@gmail.com>
Wed, 31 Aug 2016 00:49:47 +0000 (20:49 -0400)
commitf4128e317e2c952ecf5c78812e8d79eeebdc6a2d
tree7e1717a8cab6492c6326c75ab404fcfb434b3007
parentd185b75dd7170e2555d2bb70f7a53b54ecbf855c
Only set the attached flag when a client attaches

In defer mode, the debugger thread is started as soon as possible before
any clients are attached, but the debugger is_attached flag was being set
immediately. This would cause the runtime (and the System.Diagnostics.Debugger
class) to wrongly report a client as being attached.

Originally fixed in the Unity fork here: https://github.com/Unity-Technologies/mono/commit/797a210e0f2416d779c448bb9e03bb16933e261f
mono/mini/debugger-agent.c