As a crucial embedded development tool , the embedded system debugger is usually used to debug and test embedded software 。 a embedded system debugger consists of a cross debugger and a debugger agent , which characteristic lies in the separation of running environments between the cross debugger and the debuggee and the dependence on the gdb agent in the debug session 。 with the development of embedded technique , various embedded debug techniques continuously advance and all kinds of embedded system debuggers are playing a more and more important role in the embedded software development 。 the gnu debugger , gdb as a tool in the gnu toolkits , is an extremely powerful source - level debugger 。 among gdb ’ s many noteworthy features , its ability to debug programs “ remote ” is fascinating 。 this capability is not only essential when porting gnu tools to a new operation system or microprocessor , but it ’ s also useful for developers who need to debug an embedded system based on a processor that gnu already supports 。 gdb is the preferred solution in embedded development because it provides portable , sophisticated debugging over a broad rang of embedded systems 。 this paper discusses the status quo of various embedded system debuggers ; deeply analyses the overall structure of gdb and the debugging mechanism of gdb based on its source codes ; introduces the gdb ’ s remote debug technique and gdb / mi , which are usually used to develop the gdb - based embedded system debugger 。 then dwells on how to use gdb / mi to develop a gui front and how to use rsp 、 stub and gdbserver to design a debug agent , in order to expatiate on the design method of the gdb - based embedded system debugger 。 in the end , provides a concrete implementation of the gdb - based embedded system debugger of “ embedded simulation development platform ” , the project of the innovation fund for technology based firms 。 這個特性不僅在將gnu工具移植到一個新的操作系統(tǒng)和微處理器的時候很有用,對于想調試一個基于gnu支持的芯片的嵌入式系統(tǒng)的開發(fā)人員來說,也是非常有用的。由于gdb提供了在大多數嵌入式系統(tǒng)上的可移植的、復雜的調試功能,它已成為嵌入式開發(fā)的首選解決方案。本文討論了當前的各種嵌入式調試器的現(xiàn)狀,結合源代碼詳細分析了gdb的結構和調試原理,介紹了開發(fā)基于gdb的嵌入式系統(tǒng)調試器常用的遠程調試技術和gdb / mi接口;然后詳細闡述了如何使用gdb / mi開發(fā)gdb的圖形前端和怎樣使用rsp協(xié)議、 stub和gdbserver設計一個調試代理,從而較深入地討論了基于gdb的嵌入式調試器的設計方法;最后,結合國家中小型企業(yè)創(chuàng)新基金項目“嵌入式仿真開發(fā)平臺” ,給出了一個基于gdb的嵌入式系統(tǒng)調試器具體實現(xiàn)。
So elf ( executable and linkable format ) . a kind of object file format , and stabs , a kind of format presenting debugging information , are introduced in detail . and how to abstract and process debugging information from object file are discussed deeply . one of debugging features in embedded software development environment is that the running hardware platform of debugged program and that of debugger are not discordant , so cross debugging function of debugger has to be implemented 調試器的設計和實現(xiàn)總是在分析帶調試信息的特定目標文件格式基礎上而進行的,論文詳細地介紹了elf ( executableandlinkableformat )目標文件格式和stabs調試信息表示格式,并對調試器如何實現(xiàn)提取和進一步加工這些調試信息作了較深入的論述。
And a kind of remote serial protocol is introduced , through which the interaction between debugger and debugged program is implemented . sub - debugger and ocd ( on - chip debugging ) . two debugging modes in common use in embedded software development , are discussed too . finallybased on the cross debugger of x86 and powerpc86o on the nt platform , of which the author participates in the development . the data structure used to process and abstract debugging information is presented . the implementation methods of functions in common use are introduced . and the specific implementation algorithms of partial functions are supplied also 被調試程序的運行硬件平臺與調試器本身的運行平臺的不一致性就要求嵌入式系統(tǒng)軟件開法環(huán)境中的調試器具有交叉調試功能,論文介紹了一種常用的遠程串行通信協(xié)議,通過該協(xié)議可完成調試器與被調試程序的交互,并對嵌入式系統(tǒng)軟件開發(fā)環(huán)境中兩種常用的遠程調試方式stub - debugger與ocd ( on - chipdebugger )的特點與實現(xiàn)作了論述。