mono / monodevelop

MonoDevelop is a cross platform .NET IDE
http://www.monodevelop.com
2.84k stars 1.02k forks source link

[Debugger] Provide SolutionItem to DebuggerSession mapping #9581

Closed mrward closed 4 years ago

mrward commented 4 years ago

The DebuggerService now has two methods that can map from a SolutionItem to a DebuggerSession or the other way around. The ExecutionCommand now has a SolutionItem property which is used by the DebuggerService to create this mapping from DebuggerSession to SolutionItem.

Fixes VSTS #1012614 - Improvements to DebuggerSession for XAML Hot Reload

mrward commented 4 years ago

I have some concerns about thread safety in DebuggerService. No locks are used when accessing the sessions dictionary. Some methods check the GUI thread is used but others do not and it looks like they would not always be called on the UI thread. Whilst ToArray is being used in some places I am not sure that is enough to solve the problem.

Using a ConcurrentDictionary might be a simple solution here, however the ordering of the items in a ConcurrentDictionary is not guaranteed and behaves different to the Dictionary type.