Modules | Defines

Debugging
[Core]

Collaboration diagram for Debugging:

Modules

 Assert
 

assert functions and macros


 Logging
 

Logging functions and macros.


Defines

#define NS_BREAKPOINT()   ns3::BreakpointFallback ()
#define NS_FATAL_ERROR(msg)
 fatal error handling

Define Documentation

#define NS_BREAKPOINT (  )     ns3::BreakpointFallback ()

Inserts a breakpoint instruction (or equivalent system call) into the code for selected machines. When an NS_ASSERT cannot verify its condition, this macro is used. Falls back to calling AssertBreakpoint() for architectures where breakpoint assembly instructions are not supported.

#define NS_FATAL_ERROR (   msg  ) 
Value:
do                                                    \
    {                                                   \
      std::cerr << msg << std::endl;            \
      NS_BREAKPOINT ();                                 \
    }                                                   \
  while (false)

fatal error handling

Parameters:
msg message to output when this macro is hit.

When this macro is hit at runtime, the user-specified error message is output and the program is halted by calling the NS_BREAKPOINT macro. This macro is enabled unconditionally in all builds, including debug and optimized builds.