BKPT LabsDOCS/BKPT DEBUG/SOURCE AND ASSEMBLY BKPT DEBUG · VS CODE
BKPT DEBUG · USER GUIDE

Source and assembly

Use Code → Mixed when one C line becomes several instructions, the compiler moves code, or a watchpoint stops just after the access you are investigating. Assembly also works when source lines are unavailable.

Needs: a halted debug session. Matching ELF debug information adds function names and source lines; readable instruction memory is still required when symbols are missing.

Choose a display

The Code tile in Mixed mode, with source beside the live instruction list and the selected frame PC marked by an arrow.
THE CODE TILE IN MIXED MODE, WITH SOURCE BESIDE THE LIVE INSTRUCTION LIST AND THE SELECTED FRAME PC MARKED BY AN ARROW
DROPDOWN VALUE WHAT YOU SEE
SourceThe integrated source editor, breakpoint gutter, and available sampling heat
MixedSource with the live instruction pane, including available source annotations
AssemblyThe instruction pane without the source editor
  1. Pause in a function or hit a breakpoint.
  2. Select Mixed in the Code tile's display dropdown.
  3. Find the → marker beside the selected frame's PC.
  4. Click an instruction row to select it. The row selection is the operand for the toolbar actions; it does not move the actual PC.
  5. Use Frame PC to return after browsing a branch target or another page.

Read an instruction row

Rows contain a breakpoint marker, the frame-PC arrow where applicable, address, opcode bytes, disassembled instruction, and available function plus offset. Source annotations identify a file and line; click one to reveal that source location.

A ↗ address link follows a decoded branch target for browsing. It does not execute the branch. Next instructions loads the next bounded chunk; the debugger does not disassemble the whole image on every halt.

Assembly mode on the G474, showing instruction addresses, opcodes, branch links, and instruction controls.
ASSEMBLY MODE ON THE G474, SHOWING INSTRUCTION ADDRESSES, OPCODES, BRANCH LINKS, AND INSTRUCTION CONTROLS

Instruction controls

CONTROL EFFECT
Hollow/filled circle beside a rowToggle a breakpoint at this exact instruction address
BreakpointToggle a breakpoint at the selected row
Run to cursorResume until a temporary breakpoint at the selected instruction is reached; another breakpoint or fault can stop execution first
Set next…Ask to change PC to the selected address without executing the intervening instructions
Copy addressCopy the selected instruction's hexadecimal address
Copy opcodeCopy its opcode bytes
Frame PCBrowse back to the selected frame's PC

Instruction breakpoints created here belong to the current session. Source breakpoints are saved through VS Code. If an instruction marker represents an existing source breakpoint at the same address, toggling it off also removes that source breakpoint so the gutter and hardware agree.

For exact execution, use Step one instruction in the main run-control strip or Ctrl+F11. Source Step over/into operate at source-level stepping boundaries; an optimized line may cover multiple, reordered instructions.

Set next

Select frame #0, select a valid instruction boundary, choose Set next…, and read the confirmation. Accepting moves PC while leaving the target halted. It does not run skipped assignments, undo side effects, repair the stack, or initialize the destination's local variables.

Warning: use Set next only when you understand the resulting machine state. Jumping into or out of a function can invalidate its stack frame. Use Run to cursor when you want the program to execute normally on the way to a location.

Run to cursor and Set next require frame #0. A caller frame's PC is its unwound context, not another live CPU. Selecting a different frame or resuming while a confirmation is open cancels that edit.

Missing source or symbols

If source files are unavailable, instructions can still appear with an explanation in the pane. With a stripped ELF, expect addresses and opcodes but fewer names and source annotations. A partially symbolized ELF can show a mixture of named and unnamed rows. Confirm the ELF matches the program on the board before trusting an address or source line.

An invalid/unreadable instruction address produces a visible error. It is not a reason to reset the target automatically. Return to Frame PC or pause at a known location and retry.

Live assembly versus ETM history

The live pane describes instructions around the current selected frame. It does not prove those instructions executed. A sampled PC proves a sample was observed at an address; it is not a complete path through the function.

On a target with supported ETM History, a selected historical execution has its own cursor and an executed marker for the selected decoded instruction. Moving that history cursor does not move live PC or restore old variables. ETM records execution information, not a history of all RAM values. An ITM/SWO connection alone does not provide ETM history; the target needs a supported ETM and trace-sink route.

The ETM execution history tutorial walks through capture, flame navigation, historical disassembly, and the separate live halt with real H7S examples.