RAM 6.0 BUX II Series Uživatelská příručka Strana 135

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 189
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 134
4 Debugging Your BSP
4.3 Advanced Debugging Techniques
127
4
Software Breakpoints
The type of breakpoints typically used during application development are
software breakpoints. With software breakpoints, the debugger takes an opcode
from RAM and replaces it with a special instruction that causes a debug exception,
and sets up a handler to be executed when the debug exception occurs. When the
handler runs, it checks to see if the developer has a breakpoint set at that location
at the time. If the developer does not have a breakpoint set, the handler executes
the saved opcode and continues execution of the program. However, if the
developer set a debugging breakpoint to stop the application from executing, the
exception handler turns control over to the debugger. At this time, the developer
can perform whatever action is required.
Hardware Breakpoints
Hardware breakpoints allow similar functionality to software breakpoints, but
they do so without replacing the opcode as is done by software breakpoints. To use
this type of breakpoint, the processor must support hardware breakpoints.
Different processors support different hardware breakpoint functionality, but it is
common for the hardware breakpoint support to be limited to one or two
breakpoints.
Because the hardware breakpoints have access to the processor internals, they can
also provide additional functionality that is not available with software
breakpoints. For example, on some processors, it is possible to set a hardware
breakpoint to cause a debug exception when a given memory location is modified,
or even when a given memory location is read. This allows watchpoints and other
capabilities without the cumbersome mechanisms required to implement that
functionality using software breakpoints.
For the remainder of this discussion, these additional features are not important.
Nevertheless, these additional capabilities should be kept in mind while
debugging.
Overview of the Boot Procedure as it Relates to OCD
The nature of breakpoints is important when debugging BSPs. Recall that on
powerup, the processor starts executing at the reset vector address, usually
contained in flash. The code contained in the flash copies itself to RAM and begins
execution. Often, the boot loader then loads another image into a different location
in RAM and starts that image executing.
Zobrazit stránku 134
1 2 ... 130 131 132 133 134 135 136 137 138 139 140 ... 188 189

Komentáře k této Příručce

Žádné komentáře