This might be old news but it was a treat for me. In debugging some multithreaded code recently got to use the improved debugger support for threads in Visual Studio 2008 (I'm running Beta 2) that John Robbins blogged about last month and Soma blogged last week.
这可能是个老新闻,但这对我来说是一种享受。 最近,在调试一些多线程代码时,必须使用对Visual Studio 2008(我正在运行Beta 2)中的线程的改进的调试器支持, John Robbins在上个月在博客上发表了文章, Soma在上周在博客上发表了文章。
Take a look at the IDE screenshot below (click to Zoom).
看一下下面的IDE屏幕截图(单击以放大)。
There's a few cool and subtle things going on here. Take a look at the current instruction location in yellow. It's right at the end of the CheckDependancyCallback method - but see the gray highlight with the squiggly "thread" in the margin? That's the current location of another thread of execution.
这里有一些很酷和微妙的事情。 以黄色查看当前指令位置。 就在CheckDependancyCallback方法的末尾-但是看到带有突出显示的“线程”边缘的灰色高亮显示了吗? 那是另一个执行线程的当前位置。
You can name your threads now just by entering their name in the Threads toolbox window, and some threads without names will get an automatic name. You can also flag threads you're interested in watching so you don't have to remember the Thread ID.Take a look at the Debug toolbar as well. You can see the Debug Location including Process and Thread (what thread I'm currently debugging).
现在,只需在“线程”工具箱窗口中输入它们的名称即可为线程命名,某些没有名称的线程将获得一个自动名称。 您还可以标记您有兴趣观看的线程,这样就不必记住线程ID。也请查看“调试”工具栏。 您可以看到调试位置,包括进程和线程(我当前正在调试的线程)。
What a treat.
真好
翻译自: https://www.hanselman.com/blog/multithreaded-debugging-in-visual-studio-2008