2

I was looking at the source of SystemC and saw that there are things like:

#define DEBUGF \
    if (0) std::cout << "sc_cor_pthread.cpp(" << __LINE__ << ") "

and later on there are lines such as:

    DEBUGF << this << ": sc_cor_pthread::sc_cor_pthread()" << std::endl;

(these are from sc_cor_pthread.cpp)

I have already enabled debug option when configuring using ../configure --enable-debug but it doesn't seem to activate these kinds of stuff. How am I supposed to turn these on instead of manually modifying source?

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
none
  • 11,793
  • 9
  • 51
  • 87

1 Answers1

2

Add this to your compile line:

-DDEBUGF
stephenmm
  • 2,640
  • 3
  • 30
  • 48
  • I think that is supposed to work for `#ifdef` not `#define`. anyway my question was more about enabling this in configuration rather than modifying the source or the generated makefile. I did end up changing `if (0)` to `if (1)` in the source but the question remains.. – none Sep 27 '12 at 21:29
  • Oh, right you are. Should have looked a little closer. Seems like someone just wanted to quickly remove the print statements as in some versions the if (0) is not there (line 66): http://code.google.com/p/syscpar/source/browse/trunk/code/current/systemc-2.2.0/src/sysc/kernel/sc_cor_pthread.cpp?spec=svn21&r=21 So it looks like it was not implemented in a way to change this easily. – stephenmm Sep 28 '12 at 05:12