Skip to content

Debugging Workflow

Debugging is a last resort when everything else has failed. Some of the tools that can be used are :

  • code reviews and pair programming,
  • static code analysis: on top of a robust type system, more powerful methods can be used (like Formal methods, Model checker),
  • behavior over time: breakpoint, simulation, visualize signals,
  • behavior over space: split code in small test cases, dependency analysis of software parts, ...

To debug, it is necessary to have an understanding of the whole compilation process: parsing, processes, applications, tracing mechanisms.

In U, all debugging directives start with \!.

Print

\!< 'buggy line'

Trace

\!.render

#or 
\!::trace :render

#or simply 
\!.render

Debug

Useful debugger features are available:

\!> :debugger.start()

\!: BP2 # Breakpoints
...
\!< :debugger.end()

Observe

Observers can log data without stopping the process.

# Create an Observer
\!-:observer :> Memory.usage

\!-> observer # observer.start
...
\!<- observer # observer.end

Work in progress....