fble-0.5 (2025-07-13,fble-0.4-212-ga8f8ad0f)
Fble has some limited support for debugging. This document explains tips and tricks for making the most of the currently available debug support.
Use the /Core/Debug%.Trace
functions for the strings to print.
For example:
Unit@ _ = /Core/Debug%.Trace(Strs[Str|'x is: ', /Core/Int/Show%.Show(x)]); ...
To more easily enable or disable tracing, and avoid the costs of computing the trace message when disabled, you can use a style like this:
% Trace = /Core/Debug%.Enable(True); # Change to False to disable tracing. Unit@ _ = { Unit@ _ <- Trace.TraceLn; String@ debugDump = ExpensiveDebugFunction(x); Strs[Str|'x is: ', debugDump]; };
You should see Trace values printed to stderr as the program executes.
There is dwarf debug support for compiled fble code generated using the aarch64 target. Dwarf based debug is not currently available for compiled fble generated using the c target nor for interpreted fble code. Compile your code using the aarch64 target to access that debug support.
You should now be able to debug your fble code with gdb.
Int@
variable value in gdbprint FbleIntValueAccess(foo)
String@
variable value in gdbprint FbleStringValueAccess(foo)
print FbleStructValueField(foo, tag)
break fprintf
skip -gfi *.c
Note: This currently will not work because it's too much of a pain to maintain the code needed to support it.