Tech Tip: Debugging in Compiled Mode
PRODUCT: 4D | VERSION: 18 | PLATFORM: Mac & Win
Published On: December 30, 2019
4Dv18 introduces the ability to use the debugger in compiled mode. This is done by executing a TRACE contained in 4DCODE tags through the PROCESS 4D TAGS command.
Below is a simple example:
C_TEXT($myCode_t;$output_t) $myCode_t:="<!--4DCODE TRACE\nC_DATE($myDate_d)\n$myDate_d:=Current Date-->" PROCESS 4D TAGS($myCode_t;$output_t) |
$myCode contains:
TRACE C_DATE($myDate_d) $myDate_d:=Current Date |
This will trigger the debugger to run in compiled mode and allow the variables to be examined in the expression pane.
However this feature is only applicable to non-preemptive processes. The TRACE command is marked as thread safe, this is because the command is appears to be ignored in a compiled preemptive process. The behavior causes the TRACE command to not do anything when this new feature is applied to a preemptive process.