2010-11-18 51 views
2

我正在使用python 2.4並嘗試調試一個扭曲的應用程序。監視pdb中對象的狀態

有沒有什麼辦法可以讓我把一隻手錶放在一個物體上,並在其值發生變化時中斷執行。

對於實施例

首先A.state =「連接」 我要的是一個通知或執行中的暫停時A.state改變其值。

我是新來的pdb和扭曲,所以如果你覺得這個問題需要更多的信息,我可以提供它。

+0

http://stackoverflow.com/questions/192109/is-there-a-function-in-python-to-print-all-the-current-properties-and-values-of this question and the the @JeremyCantrell給出的答案是最有用的。 – franklin 2013-07-19 03:11:21

+0

可能重複的[你如何看pdb中的變量](http://stackoverflow.com/questions/7668979/how-do-you-watch-a-variable-in-pdb) – qff 2016-04-12 13:29:13

+0

可能的重複:https:/ /stackoverflow.com/questions/14139817/python-in-pdb-is-it-possible-to-enable-a-breakpoint-only-after-n-hit-counts – anijhaw 2018-01-22 00:58:15

回答