将调试器分解为工作线程? [英] Break debugger into worker thread?

查看:78
本文介绍了将调试器分解为工作线程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以将调试器分解为工作线程吗?现在,我的应用程序是冻结的
,当我按下暂停时,它会停止:


Application.Run(new MyForm());


我不知道这意味着什么。我知道应用程序从那里开始。

但是为什么调试器会停止呢?为什么它不停在运行

代码的地方?我觉得工作线程搞砸了。


Zytan

Can I break the debugger into a worker thread? Right now, my app is
freezing, and when I press pause, it stops on:

Application.Run(new MyForm());

I don''t know what that means. I know the application starts there.
But why would the debugger stop on it? Why doesn''t it stop where the
code is being run? I think there''s a worker thread that is messed up.

Zytan

推荐答案

嗨Zytan,

调试器将在那里打破,因为主UI线程将坐在

等待Windows消息在消息循环中处理。


您是否使用与主UI不同的线程更新控件

线程,使用.Net1.1?如果是这样,这可以解释你的冻结。


Mark。

-
http://www.markdawson.org

" Zytan"写道:
Hi Zytan,
the debugger will break there since the main UI thread will be sitting
waiting for Windows messages to process in the message loop.

Are you updating your controls using a different thread than the main UI
thread, using .Net1.1? If so this could explain your freezing.

Mark.
--
http://www.markdawson.org
"Zytan" wrote:

我可以将调试器分解为工作线程吗?现在,我的应用程序是冻结的
,当我按下暂停时,它会停止:


Application.Run(new MyForm());


我不知道这意味着什么。我知道应用程序从那里开始。

但是为什么调试器会停止呢?为什么它不停在运行

代码的地方?我觉得工作线程搞砸了。


Zytan

Can I break the debugger into a worker thread? Right now, my app is
freezing, and when I press pause, it stops on:

Application.Run(new MyForm());

I don''t know what that means. I know the application starts there.
But why would the debugger stop on it? Why doesn''t it stop where the
code is being run? I think there''s a worker thread that is messed up.

Zytan


" ; Zytan" < zy ********** @ gmail.comwrote in message

news:11 ******************** **@r35g2000prh.googlegr oups.com ...
"Zytan" <zy**********@gmail.comwrote in message
news:11**********************@r35g2000prh.googlegr oups.com...

我可以将调试器分解为工作线程吗?现在,我的应用程序是冻结的
,当我按下暂停时,它会停止:


Application.Run(new MyForm());


我不知道这意味着什么。我知道应用程序从那里开始。

但是为什么调试器会停止呢?为什么它不停在运行

代码的地方?我认为有一个工作线程搞砸了。
Can I break the debugger into a worker thread? Right now, my app is
freezing, and when I press pause, it stops on:

Application.Run(new MyForm());

I don''t know what that means. I know the application starts there.
But why would the debugger stop on it? Why doesn''t it stop where the
code is being run? I think there''s a worker thread that is messed up.



我已经回答了这个问题的大部分内容,回复了另一个主题你

开始了。


调试器没有停在它上面......它应该以绿色显示,这意味着

它只是其中一个当前调用堆栈的一部分你的线程(在这种情况下,这是主线程的

)。当然,

代码行是你的一个线程中当前调用堆栈的一部分应该不足为奇了,

对吗? :)


当您在调试器中断时,* all * threads被停止。调试器

显示你的主线程,但正如我在另一篇文章中所解释的那样,你有

访问你喜欢的任何线程。你只需要告诉调试器你要看哪一个




Pete

I already answered most of this question, in reply to a different thread you
started.

The debugger didn''t "stop on it"...it should be shown in green, which means
that it''s simply part of the current call stack in one of your threads (in
this case, the main thread). And of course, it should be no surprise that
that line of code is part of the current call stack in one of your threads,
right? :)

When you break in the debugger, *all* threads are stopped. The debugger
shows you your main thread, but as I explained in the other post, you have
access to any thread you like. You just have to tell the debugger which one
you want to look at.

Pete


嗨Zytan,


除了Mark和Peter所说的:打开线程窗口。在那里你

con在所有线程之间切换。您可以通过

在代码中设置线程的Name属性来帮助识别您的线程。此名称将显示在

列表中。


Christof
Hi Zytan,

in addition to what Mark and Peter said: Open the threads window. There you
con switch between all threads. You can help to recognice your thread by
setting the Name property of the thread in code. This name will be shown in
the list.

Christof


这篇关于将调试器分解为工作线程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆