Keil Logo Arm Logo

Technical Support

On-Line Manuals

µVision4 User's Guide

About µVision User Interface Creating Applications Utilities Debugging Using the Debugger Simulation Start Debugging Application Program Execution Debug Windows and Dialogs Breakpoints Window Call Stack and Locals Window Code Coverage Command Window Disassembly Window Event Viewer Execution Profiler Instruction Trace Window Logic Analyzer Setup Setup in Detail Restrictions Using the Logic Analyzer Memory Map Memory Window Performance Analyzer Registers Window Serial Window Symbols Window System Viewer Adding System Viewer Windows Toolbox Trace Data Window Trace Navigation Watch Window Expressions Constants System Variables Peripheral Variables I/O Ports Serial Ports Program Variables (Symbols) Fully Qualified Symbols Non-Qualified Symbols Literal Symbols Using Symbols Line Numbers Bit Addresses Type Specifications Operators Memory Type Specifiers Differences Between µVision4 and C Expression Examples Cortex-M Code and Data Trace Trace Features Tracepoint Expressions Tracepoint Intrinsics Tracepoint Limitations Configuring the Trace Hardware Tracepoint Marks Tips and Tricks Review Peripherals and CPU Configuration Simulate I/O Ports Simulate Interrupts and Clock Inputs Simulate external I/O Devices Assign Serial I/O to a PC COM Port Check Illegal Memory Access Command Input from File Preset I/O Ports or Memory Contents Write Debug Output to a File Keyboard Shortcuts TPIU Initialization after RESET (Cortex-M) Debug Commands Debug Functions Simulation Flash Programming Dialogs Example Programs Command Line Appendix

µVision4 User's Guide

Breakpoints Window

Breakpoints are program addresses or expressions that, when true, halt program execution or execute a specified command. Breakpoints can be defined and modified in several ways:

Insert Breakpoint Button Using the Insert/Remove Breakpoint toolbar button. Select the code line in the Editor or Disassembly window and click the toolbar button or press F9.

  • Clicking into the left margin of the Editor or Disassembly window.
  • Using the context menu of the Editor or Disassembly window.
  • Using the Debug Commands BreakSet, BreakKill, BreakList, BreakEnable, and BreakDisable.
  • Using the dialog Debug - Breakpoints.

Breakpoint Control Dialog

Breakpoints describes the fields. This dialog allows to:

  • Define breakpoints of several types.
  • Temporarily enable or disable breakpoints using the tick-box in the field Current Breakpoints.
  • Review breakpoint definition by double-clicking the listed breakpoint.
  • Remove one or all breakpoints.

Use Expressions to define one of the following breakpoint types:

  • Execution Break (E) gets defined when Expression is a code address. The breakpoint triggers when the specified code address is reached. The code address must refer to the first byte of a CPU instruction.
  • Access Break (A) gets defined when the flags Read or Write (or both) have been set. The breakpoint is triggered when the specified memory access occurs. Developers can specify the size of the memory access window in bytes or as an object-size of the expression. For this breakpoint type, Expression must reduce to a memory address and memory type. The operators (&, &&, <. <=. >, >=, = =, and !=) can be used to compare variable values before the Access Break halts program execution or executes the Command.
  • Conditional Break (C) is defined when Expression cannot be reduced to an address. The breakpoint triggers when the specified conditional expression becomes true. The conditional expression is recalculated after each CPU instruction. Therefore, the program execution speed may slow down considerably.

The Count value specifies the number of times the breakpoint expression must be true before the breakpoint is triggered.

When a Command is specified, µVision executes the statement and then resumes program execution. The command specified in here can be a µVision debug- or signal function. To halt program execution from within such functions, set the System Variable _break_.

Note

  • When an Access Breakpoint (read or write) is set to a peripheral register (SFR) in the Simulator, the breakpoint might trigger even though the application did not access the peripheral register. This happens because the µVision Simulator makes no difference between application-driven and Simulator-internal accesses.
Breakpoint Examples

Several breakpoint types defined in the picture are explaind below.

Expression: \Measure\125 Execution Break (E) that halts when the target program reaches the code line 125 in the module MEASURE.
Expression: main Execution Break (E) that halts when the target program reaches the main function.
Expression:
Count:
save_current_measurements
10
Execution Break (E) that halts when the target program reaches the function save_current_measurements the 10th time.
Expression:
Command:
tc0
printf ("T0 Interrupt 0ccurred")

Execution Break (E) that prints T0 Interrupt occurred in the Output Window – Command page when the target program reaches the tc0 function.

Expression:
sendchar == 96 Conditional Break (C) that halts program execution when the expression sendchar == 96 becomes true. This breakpoint is disabled in the above Breakpoints dialog.
Expression:
Access:
Size:
save_record[10]
Read Write
3 Objects
Access Break (A) that halts program execution when an read or write access occurs to save_record[10] and the following 2 objects. Since save_record is a structure with size 16 bytes this break defines an access region of 48 bytes.
Expression:
Access:
sindex == 10
Write
Access Break (A) that halts program execution when the value 10 is written to the variable sindex.
Expression:
Command:
measure_display
MyStatus ()
Execution Break (E) that executes the µVision debug function MyStatus when the target program reaches the function measure_display. The target program execution resumes after the debug function MyStatus has been executed.
Expression:
(not in picture)
\\cpp_template\../../source/main.cpp\268 Execution Break (E) that halts when the target program reaches the code line 268 in the module main.cpp. The module has the relative path ../../source and belongs to the application cpp_template.

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.