You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

EPICS documentation says to create a Makefile.Host file.

https://epics.anl.gov/EpicsDocumentation/AppDevManuals/iocAppBuildSRcontrol.html

However, that did not work for me.  Instead, on the command line, I manually add the CFLAGS like this:

$ make BUILD_IOCS=YES USR_CFLAGS="-ggdb -O0"

With that, the debug symbols are included in the resulting executable (-ggdb).  However, optimization is still enabled (-03) and I don't know why.

With the debug symbols in the resulting executable, you get an error message when starting gdb and running the executable.  So you need to add this to your ~/.gdbinit file:

set auto-load safe-path /

Beware, with that you are executing python code automatically.  It is possible somebody does something bad to you.

You also need to add the source directory to your source code path.

(gdb) directory /path/to/src/dir

Example:

(gdb) directory /afs/slac.stanford.edu/u/gu/egumtow/code/ipmiComm/src

And now you should be ok to debug.  I will figure out the optimization issue later.

  • No labels