Any way to start a user interface thread briefly when a non-UI thread is stopped in the debugger?

When debugging background threads using Visual Studio 2010, is there a good way to let other threads run for several hundred milliseconds or without pushing the thread that is at the breakpoint? Does the equivalent essentially insert “Threading.Thread.Sleep (100)” immediately before the current line, setting the next statement there and striking the resume (but without breaking the debugged code)? My package registration / display code is not as useful as it can be, since the debugger often falls into a breakpoint between the moment when my code acted on the package and the time that the user interface could display.

I know that you can go to the Threads window, freeze the thread that hit the breakpoint, press run, hit pause and wipe the thread that hit the breakpoint, but it's really awkward. Is there a smoother way to do something?

(Edit) Why is there no answer? I cannot believe that I am the only person trying to debug a non-user thread.

+3
source share
1 answer

I would use the Macro macro in Visual Studio to perform the actions you draw.

This should be a simple question: record a macro ( Tools, Macros, Record TemporaryMacro) at the right time and then save it.

Icon/keyboard .

, , .

№ 1: , ( ):

    Dim t As Thread
    t = DTE.Debugger.CurrentThread
    t.Freeze()
    DTE.Debugger.Go(False)
    Beep()
    Threading.Thread.Sleep(5000)
    Beep()
    DTE.Debugger.Break(True)
    DTE.Debugger.CurrentThread = t;
    t.Thaw()

№ 2: : EnvDTE.Debugger

:

Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
+3

Source: https://habr.com/ru/post/1773120/


All Articles