If there is an error executing powerDEVS the only default diagnostic tool is the log generated with printLog. This can be very inconvenient in certain occations.
Debugging with Core Dump
When there is an error executing a C++ program a core dump can be used to find the problem.This is not generated by default in PD. These are the steps to generate core dumps
//signal(SIGFPE,sig_hdlr);
//signal(SIGSEGV,sig_hdlr);
OPTFLAGS = -O2 -g –Q
ulimit -c unlimited
./ model –tf <yourDesiredFinalTime>
If there is an error a message “ Segmentation Faul (core dumped) “ (o similar) should be printed in the terminal an core dump file should be generated in $PD/output. If the file is not in that folder you can verify the /proc/sys/kernel/core_pattern file.
To debug the core dump with gdb:
--
LucioEmilioSanti - 2018-08-10