8.8 Debugging Target Software 8.10 Code Coverage of Target Software
Getting Started  /  8 Tutorials  / 

8.9 Using Breakpoints

Besides the source code or address breakpoints demonstrated in the debugging section, the Intel Simics simulator provides several other types of breakpoints:

8.9.1 Overview of Breakpoints

These are some examples of breakpoints:

8.9.2 Finding Breakpoint Commands

To list breakpoint related commands, use the help command the Breakpoints category:

simics> help category:Breakpoints
...
<bp-manager.time>.break           set time breakpoint
<bp-manager.time>.run-until       run until specified time
<bp-manager.time>.trace           enable tracing of time points
<bp-manager.time>.wait-for        wait for specified time
...

In the shortened list of break commands above, note that there are different command types:

8.9.3 The Breakpoint Manager

Most breakpoint commands are implemented by the breakpoint manager, which is an object named bp. To list the different breakpoint types that the breakpoint manager implements, use bp.list-types:

simics> bp.list-types
┌───────────────────┬────────────────────────────────────────┐
│     Provider      │            Breakpoint type             │
├───────────────────┼────────────────────────────────────────┤
│bp.bank            │device access                           │
│bp.console_string  │target console string output breakpoints│
│bp.control_register│control register access breakpoints     │
│bp.cycle           │cycle queue breakpoints                 │
│bp.cycle_event     │cycle event breakpoints                 │
│bp.exception       │exception breakpoints                   │
│bp.gfx             │graphics console output breakpoints     │
│bp.hap             │hap occurrence breakpoints              │
│bp.log             │log message breakpoints                 │
│bp.magic           │magic breakpoints                       │
│bp.memory          │memory access breakpoints               │
│bp.notifier        │notifier trigger breakpoints            │
│bp.os_awareness    │OS Awareness breakpoints                │
│bp.source_line     │source code line breakpoints            │
│bp.source_location │source code location breakpoints        │
│bp.step            │step queue breakpoints                  │
│bp.step_event      │step event breakpoints                  │
│bp.time            │virtual time breakpoints                │
└───────────────────┴────────────────────────────────────────┘

A breakpoint created with bp.<type>.break is assigned a breakpoint identity, and this identity can be used to inspect or manipulate that specific breakpoint. These are some common commands:

8.9.4 Breakpoint Examples

Here follows a few examples of how to use breakpoints.

8.9.4.1 Execution Breakpoint

In this example, we set an execution breakpoint on a memory address.

8.9.4.2 Exception Breakpoint

In this example, we will write an illegal instruction, and break on the exception that is raised when executing the illegal instruction.

8.9.4.3 Log Breakpoint

In this example, we will plant a temporary (-once) log breakpoint that triggers when the object board.mb.sb, or one of its child objects, logs an info log that contains the string lower. The selection of child objects is achieved with the -recursive flag.

8.8 Debugging Target Software 8.10 Code Coverage of Target Software