python的pdb有什么調試命令?python的pdb調試命令介紹

python的pdb調試命令介紹

1、next執行下一條語句,如果本句是函數調用,則執行函數,接著執行當前執行語句的下一條。文章源自四五設計網-http://www.wasochina.com/26971.html

def?stop_here(self,?frame): ????????... ????????#?如果frame還沒跳出stopframe,永遠返回true ????????if?frame?is?self.stopframe: ????????????if?self.stoplineno?==?-1: ????????????????return?False ????????????return?frame.f_lineno?>=?self.stoplineno ? ? ????????#?如果frame跳出了stopframe,進入下一個frame,則執行不會中斷,一直到跳出到stopframe ????????#?還有一種情況,如果在return事件中斷執行了next,下一次跟蹤在上一級frame中,此時上一級frame能跟蹤到botframe,中斷 ????????while?frame?is?not?None?and?frame?is?not?self.stopframe: ????????????if?frame?is?self.botframe: ????????????????return?True ????????????frame?=?frame.f_back ????????return?False
2、step執行下一條命令,如果本句是函數調用,則s會執行到函數的第一句。文章源自四五設計網-http://www.wasochina.com/26971.html

def?stop_here(self,?frame): ????????... ????????#?stopframe為None ????????if?frame?is?self.stopframe: ????????????... ????????#?當前frame一定會追溯到botframe,返回true ????????while?frame?is?not?None?and?frame?is?not?self.stopframe: ????????????if?frame?is?self.botframe: ????????????????return?True ????????????frame?=?frame.f_back ????????return?False
3、return執行當前運行函數到結束。文章源自四五設計網-http://www.wasochina.com/26971.html

def?stop_here(self,?frame): ????????... ????????#?如果當前幀代碼順序執行,下一個frame的lineno==stoplineno ????????#?如果執行到for循環的最后一行,下一個frame(for循環第一行)的lineno<stoplineno,不會中斷。直到for循環執行結束,緊接著的下一行的lineno==stoplineno,執行中斷 ????????if?frame?is?self.stopframe:="" ????????????if?self.stoplineno?="=?-1:" ????????????????return?false="" ????????????return?frame.f_lineno?="">=?self.stoplineno ? ? ????????#?如果在非botframe中,會先追溯到stopframe,返回false,同next ????????while?frame?is?not?None?and?frame?is?not?self.stopframe: ????????????if?frame?is?self.botframe: ????????????????return?True ????????????frame?=?frame.f_back ????????return?False
以上就是“python的pdb調試命令介紹”演示過程了,看完這個教程你學會了么。文章源自四五設計網-http://www.wasochina.com/26971.html

</stoplineno,不會中斷。直到for循環執行結束,緊接著的下一行的lineno==stoplineno,執行中斷>文章源自四五設計網-http://www.wasochina.com/26971.html 文章源自四五設計網-http://www.wasochina.com/26971.html

繼續閱讀
我的微信
微信掃一掃
weinxin
我的微信
惠生活福利社
微信掃一掃
weinxin
我的公眾號
 
  • 本文由 四五設計網小助手 發表于 2023年6月29日09:54:31
  • 轉載請務必保留本文鏈接:http://www.wasochina.com/26971.html

發表評論

匿名網友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

拖動滑塊以完成驗證