- Embedded Systems Architecture
- Daniele Lacamera
- 322字
- 2021-06-25 21:55:01
Debugger
In the host environment, debugging an application that runs on top of the operating system is done by running a debugger tool, which can attach to an existing process, or spawn a new one given an executable ELF file and its command-line arguments. The default debugging option provided by the GCC suite is called GDB, an acronym for the GNU Debugger. While GDB is a command-line tool, several frontends have been developed to provide a better visualization of the state of the execution, and some integrated development environments provide built-in frontends for interacting with the debugger while tracing the single lines being executed.
Once again, the situation is slightly changed when the software to debug is running on a remote platform. A version of GDB, distributed with the toolchain and specific for the target platform, can be run on the development machine to connect to a remote debug session. A debug session on a remote target requires an intermediate tool that is configured to translate GDB commands into actual actions on the core CPU, and the related hardware infrastructure, to establish the communication with the core.
Some embedded platforms provide hardware breakpoints, which are used to trigger system exceptions every time the selected instructions are executed.
Later on in this chapter, we'll see how a remote GDB session can be established with the target, in order to interrupt its execution at the current point, proceed to step through the code, place breakpoints and watch points, and inspect and modify the values in memory. A handful of GDB commands are introduced, giving a quick reference to some of the functionalities provided by the GDB command-line interface, which can be effectively used to debug embedded applications.
The debugger gives the best possible understanding of what the software is actually doing at runtime, and facilitates the hunt for programming errors while directly looking at the effects of the execution on memory and CPU registers.
- Learning Windows Server Containers
- 大學(xué)計(jì)算機(jī)應(yīng)用基礎(chǔ)實(shí)踐教程(Windows 7+Office 2013)
- WordPress Mobile Web Development:Beginner's Guide
- 玩到極致 iPhone 4S完全攻略
- 嵌入式Linux驅(qū)動(dòng)程序和系統(tǒng)開(kāi)發(fā)實(shí)例精講
- Windows Phone 8 Application Development Essentials
- 奔跑吧 Linux內(nèi)核(入門(mén)篇)
- 完美應(yīng)用RHEL 8
- Linux服務(wù)器配置與管理
- Vim 8文本處理實(shí)戰(zhàn)
- Windows 7實(shí)戰(zhàn)從入門(mén)到精通
- Advanced Infrastructure Penetration Testing
- Windows Server 2008組網(wǎng)技術(shù)與實(shí)訓(xùn)(第3版)
- Web Penetration Testing with Kali Linux(Third Edition)
- 大學(xué)計(jì)算機(jī)應(yīng)用基礎(chǔ)實(shí)踐教程(Windows 7+MS Office 2010)