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 。 這個(gè)特性不僅在將gnu工具移植到一個(gè)新的操作系統(tǒng)和微處理器的時(shí)候很有用,對(duì)于想調(diào)試一個(gè)基于gnu支持的芯片的嵌入式系統(tǒng)的開(kāi)發(fā)人員來(lái)說(shuō),也是非常有用的。由于gdb提供了在大多數(shù)嵌入式系統(tǒng)上的可移植的、復(fù)雜的調(diào)試功能,它已成為嵌入式開(kāi)發(fā)的首選解決方案。本文討論了當(dāng)前的各種嵌入式調(diào)試器的現(xiàn)狀,結(jié)合源代碼詳細(xì)分析了gdb的結(jié)構(gòu)和調(diào)試原理,介紹了開(kāi)發(fā)基于gdb的嵌入式系統(tǒng)調(diào)試器常用的遠(yuǎn)程調(diào)試技術(shù)和gdb / mi接口;然后詳細(xì)闡述了如何使用gdb / mi開(kāi)發(fā)gdb的圖形前端和怎樣使用rsp協(xié)議、 stub和gdbserver設(shè)計(jì)一個(gè)調(diào)試代理,從而較深入地討論了基于gdb的嵌入式調(diào)試器的設(shè)計(jì)方法;最后,結(jié)合國(guó)家中小型企業(yè)創(chuàng)新基金項(xiàng)目“嵌入式仿真開(kāi)發(fā)平臺(tái)” ,給出了一個(gè)基于gdb的嵌入式系統(tǒng)調(diào)試器具體實(shí)現(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 調(diào)試器的設(shè)計(jì)和實(shí)現(xiàn)總是在分析帶調(diào)試信息的特定目標(biāo)文件格式基礎(chǔ)上而進(jìn)行的,論文詳細(xì)地介紹了elf ( executableandlinkableformat )目標(biāo)文件格式和stabs調(diào)試信息表示格式,并對(duì)調(diào)試器如何實(shí)現(xiàn)提取和進(jìn)一步加工這些調(diào)試信息作了較深入的論述。
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 被調(diào)試程序的運(yùn)行硬件平臺(tái)與調(diào)試器本身的運(yùn)行平臺(tái)的不一致性就要求嵌入式系統(tǒng)軟件開(kāi)法環(huán)境中的調(diào)試器具有交叉調(diào)試功能,論文介紹了一種常用的遠(yuǎn)程串行通信協(xié)議,通過(guò)該協(xié)議可完成調(diào)試器與被調(diào)試程序的交互,并對(duì)嵌入式系統(tǒng)軟件開(kāi)發(fā)環(huán)境中兩種常用的遠(yuǎn)程調(diào)試方式stub - debugger與ocd ( on - chipdebugger )的特點(diǎn)與實(shí)現(xiàn)作了論述。