Skip to content

TCF services ​

The extension implements the VS Code Debug Adapter Protocol (DAP) and translates DAP requests to commands of the Target Communication Framework (TCF). The debugger uses standard TCF services, so it should work with any agent that follows the TCF specification. The Simics console and snapshots need services that only the Simics agent has.

Turn on the TCF trace to see the messages between VS Code and the agent.

VS Code features ​

VS Code (DAP)TCF
attachTCP connection + Locator.Hello
threadsRunControl contexts with HasState, see Call stack
pause / continueRunControl.suspend / RunControl.resume
step over / into / outRunControl.resume with a step mode, see below
stopped / continuedcontextSuspended, containerSuspended, contextResumed, containerResumed events
call stackStackTrace.getChildrenRange / getChildren / getContext
Locals scopeExpressions.getChildren of the selected frame
watch / hover / Debug ConsoleExpressions.create / evaluate in the selected frame
Registers scopeRegisters.getChildren / getContext / get for the selected frame
disassemblyDisassembly.disassemble in the frame's context
breakpointsBreakpoints.add / change / remove, status events, see below
Target MemoryMemory.get / set / getChildren / getContext, memoryChanged events
symbol filesMemoryMap.set / get
path mappingPathMap.set / get
context queriesContextQuery.query
Simics consoleSimics CommandLine service
SnapshotsSimics SimUtils.getSnapshotIDs / takeSnapshot / restoreSnapshot / deleteSnapshot, snapshotsChanged events

Stepping ​

Steps are sent to the thread's own run control context.

VS CodeTCF resume mode (default)TCF resume mode (instruction granularity)
Step OverRM_STEP_OVER_LINE (3)RM_STEP_OVER (1)
Step IntoRM_STEP_INTO_LINE (4)RM_STEP_INTO (2)
Step OutRM_STEP_OUT (5)RM_STEP_OUT (5)

Breakpoints ​

VS CodeTCF breakpoint properties
Source line breakpointFile (path as in VS Code), Line, Column
Function breakpointLocation = the function name (any expression the agent accepts)
Data breakpointLocation = address, Size, AccessMode read/write
Instruction breakpointLocation = address, ContextIds = the process and its threads
ConditionCondition, evaluated by the agent
Hit count N or >= NIgnoreCount = N - 1 (break from the N:th hit)
Logpointa normal breakpoint, the message is printed by the extension

The contexts of a scoped function breakpoint are sent as the breakpoint's ContextIds, and a context query as its ContextQuery.