Ich will das Problem (mit D12) erst mal allgemein erläutern:
Wenn ich von einem Haltepunkt mit F7 debuggen will, hängt sich das Projekt sehr oft auf.
Setze ich in der aufzurufenden Funktion jedoch zuvor einen Haltepunkt, hält der Debugger dort auch an.
Das Aufhängen geschieht jedoch auch beim Rücksprung aus Funktionen oder bei Zuweisungen an Result.
Ich muss dann das Debugging abbrechen und neu versuchen, ggf. mit neuen Haltepunkten.
Ich arbeite mit einigen Threads. Vielleicht ist da ja nicht alles in Ordnung?
Kann jemand dieses allgemeine Problem irgendwie einordnen?
Hat jemand eine Idee, wo ich mal genauer schauen muss?
Very annoying indeed, it make me angry so i limit my use for Step-Into (F7) a lot and replace it with breakpoints and F8.
Yes it is because of threading, and it is a bug in the debugger, i rarely observed this with main threads, most the time happens with the last created threads !, yet it happen in the main sometimes, this doesn't mean you threading code is problematic, it is the debugger fault.
From my observation, the
OS sometimes create its own threads while you application is running, some of them finish and some stay running, these are responsible for many things, from checking compatibility to drawing to handling security.... etc, and they are irrelevant for us,
Now to details, the problem is with the debugger because it does hook creating threads and exiting process wide, so it try to keep track of them and get all threads state (paused/running), that is OK and in fact that is crucial job for the debugger to do, so when you click stop or the execution hit a break point (or
exception...) it will pause all threads including the
OS threads (the externals), here comes the problem if the
OS recreated another threads or terminated/killed his own threads, the debugger in this case specially with F7 (Step-Into) fail to repopulate/update his list of threads for each Step, and will fail to resume one thread or fail to stop one, or just find one in his list that is not there and fail to coup with that.
This happen more often of you are debugging hot code, means if the application was running for few minutes and entered some idle/stable state then you will not witness this, because external threads are very rare after these first few minutes from starting the debugged process, but this is more annoying to wait few minutes to debug what really need to be found this moment !
Hope that helps, and hope you can continue digging this, over time this annoyed me so much, so i either very rarely use F7 or i use x64dbg, a real debugger from
https://x64dbg.com/