Debugging PowerDEVS

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

  • In $PD/engine/model.cpp comment the following lines

//signal(SIGFPE,sig_hdlr);
//signal(SIGSEGV,sig_hdlr);
  • In $PD/engine/Makefile.include add the debugging flag


OPTFLAGS = -O2 -g –Q



  • Compile the model.

  • The simulation must be started from a terminal: Open a terminal and execute inside $PD/output:

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:

  • Gdb ./model <coreFile>

  • <a name="_GoBack"></a> Where to see the stack trace

-- LucioEmilioSanti - 2018-08-10

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2018-08-10 - LucioEmilioSanti
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback