Embedded Systems Firmware Demystified (With CD-ROM)

Overview

I discussed some fundamental debugging steps in an earlier chapter but in the context of debugging the boot code. In this chapter, I will discuss debugging an application residing on top of MicroMonitor, using only the monitors debugging facilities.

Unlike remote, host-directed debugging, monitor-based debugging uses only target resources and only the capabilities built into the target microprocessor. In most cases (not always), monitor-based debugging requires the ability to write into the applications instruction space. Typically, when a breakpoint is set using the monitors command line interface (CLI), the monitor modifies the applications text space or sets some special registers in the processor. The monitor then transfers control to the application. If the instruction at the breakpoint location is executed, control is returned to the monitors CLI.

It is relatively straightforward to give the monitor the ability to display memory. Depending on the complexity of the application being debugged , it may even be reasonable to single step and resume execution following a breakpoint. Thus the monitor can supply the minimal necessary tools for debugging. Because the monitor, however, doesnt have access to the symbolic information in the source code (nearly all of that information remains on the host with the compiler), monitor-based debugging poses some serious challenges.

For example:

The preceding list explains why monitor-based debugging isnt that popular. It aint easy! Before you give up on it though, Id like to re-investigate the topic and see if there just might be some breath left in the old beast .

Категории