Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

Trace Statements

A Trace Statement is a message that is output during execution of a debug session. Trace statements can be defined in Enterprise Architect without requiring any changes to your application source code.

Tracepoint Markers are set in the code editor. Like breakpoints, they are placed on a line of code. When that line of code executes, the debugger evaluates the statement, the result of which is logged to the Debug window (or to file if overridden by the Analyzer script).


Any existing Trace statements can be viewed and managed in the Breakpoints & Markers window. The Breakpoints & Markers window can be displayed using either of the methods outlined here.


Execute > Windows > Breakpoints

Add a Tracepoint Marker



See also


Open the source code to debug in the source code editor.

Editing Source Code


Find the appropriate code line, right-click in the left margin and select the 'Add Tracepoint Marker' option.

If a marker is already there, press Ctrl+click to show the Breakpoint Properties window.

Breakpoint Properties


Ensure the 'Trace statement' checkbox is selected.


In the text field under the 'Trace statement' checkbox, type the required Trace statement.

Trace Statements


Click on the OK button. A Tracepoint Marker is shown in the left margin of the code editor.

Specifying a Trace Statement

A trace statement can be any freeform text. The value of any variables currently in scope can also be included in a trace statement by prefixing the variable name with a special token.

The available tokens are:

  • $ - when the variable is to be interpreted as a string
  • @ - when the variable is a primitive type (int, double, char)

Using our example in the image, we could output the number of people getting off a train by using this statement:

     There were @Passengers before @PeopleOFF got off the train at $Arriving.Name Station

In addition to tracing the values of variables from your code, you can use the $stack and $frame keywords in your Trace statement to print the current stack trace; use:

  • $stack - to print all frames, or
  • $frame[start](count) - print a specific number of frames from the stack starting at a given frame; for example, $frame[0](5) will print the current frame and 4 ancestors

Learn more


  • Trace statements can be included on any type of breakpoint or marker.