For faster navigation, this Iframe is preloading the Wikiwand page for 调试工具.

调试工具

偵錯器(英語:Debugger)亦稱偵錯程式偵錯工具,指一種用於偵錯其它程式的電腦程式及工具。能夠讓程式碼指令組模擬器(ISS)中可以檢查運行狀況以及選擇性地運行,以便排错、偵錯。當開發的進度遇到瓶頸或找不出哪裡有問題時,這技術將是非常有用的。但是將程式運行在偵錯器之下,這將比直接在運作的平台以及處理器上執行還要來得慢。

當程式當機時,如果偵錯器是屬於來源階段偵錯器(source-level debugger)或象徵階段偵錯器(symbolic debugger),偵錯器即可以顯示出錯誤所在位置的原始碼,並使其於整合開發環境裡也能看見。要是屬於低階偵錯器(low-level debugger)或機器語言偵錯器(machine-language debugger)的話,它將能顯示的是一行一行的反組譯碼(這裡指的當機情況是指,當發生原因是因為程式設計師在設計上的疏失,使得程式無法繼續正常執行的情況。例如程式嘗試去調用某個對在該版本的CPU上而言是不合理的操作,或者是對保護或無法存取的記憶體位置進行寫入)。

典型的偵錯器通常能夠在程式執行時擁有以下這些功能,例如單步執行(single-stepping)、利用中斷點(breakpoint)使程式遇到各種種類的事件(event)時停止(breaking)(一般用於使程式停止在想要檢查的狀態)、以及追蹤某些變數的變化。有些偵錯器也有能力在想要偵錯的程式在執行狀態時,去改變它的狀態,而不僅僅只是用來觀察而已。

一個好的偵錯器存在的重要性不誇張。就算一個程式語言/平台在電腦的行程裡運作非常良好。有無偵錯器以及偵錯器的好壞,對於一個程式語言及平台來說,經常是能不能正常執行的重要因素。總之,軟體要能夠(或經常)執行在不同的偵錯器下進行測試,是非常重要的。不過由於偵錯器出現將做對軟體程式的內部時間的不可避免的變動。所以,即使是一個幾近完美的偵錯器,在多工環境或分散式系統下,它也會更難去測試到執行時(runtime)的問題。

一個偵錯器除了能夠用來偵錯(debug),同樣的,它也經常被用來作為破解軟體的工具,像是用來跳過軟體的防拷貝保護,還有破解序號驗證,以及其它軟體保護功能。

大部份的主流偵錯工程,譬如gdb和dbx提供基於主控台的命令提示介面(console-based command line)。偵錯器前端應用,現在普遍是提供給整合式開發工具(IDE)做為偵錯引撆、動態化、視覺化等特點。

硬體偵錯器

[编辑]

大部份現代微處理器它們都至少會擁有以下這些特點的其中一個包含在他們的CPU設計裡,使得偵錯更加容易:

  • 硬體支援單步執行(single-steping)程式,以及設置旗標(flag)。
  • 利用Popek and Goldberg virtualization requirements指令組使它更加容易去設計偵錯軟體,讓偵錯軟體能夠在相同的CPU下執行時,有如使用純軟體偵錯一般。這樣CPU就可能在測試程式時,以全速執行的狀態下同時能夠保持程式執行速度,並使得其仍然保持在偵錯器的控制之下。
  • 在系統編程允許一臺外在硬體偵錯器,在測試時重新編輯一個程式系統,如增加或去除指示的中斷點
  • 硬體支援資料中斷點(breakpoint)的設置,譬如專門處理分頁錯誤的硬體的資料中斷點的設置。
  • 設有JTAG

偵錯器列表

[编辑]
Winpdb debugging itself.
  • CA/EZTEST(Cics Interactive test/debug)
  • CodeView
  • DBG - A PHP Debugger and Profiler
  • dbx
  • DebugView
  • DDD, Data Display Debugger
  • DEBUG DOS Command
  • DuxDebugger页面存档备份,存于互联网档案馆)— Debugger Disassembler for Windows 64-bit
  • Distributed Debugging Tool(DDT)
  • Dynamic debugging technique (DDT), and its octal counterpart Octal Debugging Technique
  • Eclipse
  • TotalView
  • GNU Debugger(GDB)
  • Insight
  • Interactive Disassembler(IDA Pro)
  • Java Platform Debugger Architecture
  • JSwat,開源Java調試工具
  • Nemiver, Graphical C/C++ Debugger for the GNOME desktop environment
  • MacsBug
  • OLIVER (CICS interactive test/debug)
  • OllyDbg
  • PyDbg,開源Python調試工具
  • IBM Rational Purify
  • sdb
  • SIMMON(Simulation Monitor)
  • SIMON (Batch Interactive test/debug)
  • SoftICE
  • Turbo Debugger
  • Ups - C, Fortran source level debugger
  • WinDbg
  • Valgrind
  • VB Watch Debugger for Visual Basic 6.0
  • x64dbg
  • Visual Studio Debugger

參見

[编辑]

參考資料

[编辑]
  • Jonathan B. Rosenberg, How Debuggers Work: Algorithms, Data Structures, and Architecture, John Wiley & Sons, ISBN 0-471-14966-7

外部連結

[编辑]
{{bottomLinkPreText}} {{bottomLinkText}}
调试工具
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?