SST/macro
Classes | Namespaces | Macros | Functions
debug.h File Reference
#include <map>
#include <cstdio>
#include <string>
#include <stdint.h>
#include <iostream>
Include dependency graph for debug.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  sprockit::debug_int
 The debug_int class is an opaque wrapper around an integer used for checking if debug slots are active. More...
 
class  sprockit::debug_prefix_fxn
 The debug_prefix_fxn class Produces a string prefix (dynamically, called every time) that can be registered with the debug system to add extra metadata to each debug print. More...
 
class  sprockit::debug
 
class  sprockit::debug_register_slot
 The debug_register_slot class. More...
 

Namespaces

 sprockit
 

Macros

#define MAX_DEBUG_SLOT   63
 
#define DeclareDebugSlot(name)
 Macro used for declaring a debug slot in a header file. More...
 
#define RegisterDebugSlot(name, ...)
 Macro used for defining all the symbols associated with a previously declared debug slot (DeclareDebugSlot). More...
 
#define MakeDebugSlot(name, ...)
 Declare and define a debug slot in a single macro in a source file. More...
 
#define debug_printf(slot_bitmask, ...)
 

Functions

debug_int sprockit::operator| (const debug_int &lhs, const debug_int &rhs)
 
debug_int sprockit::operator& (const debug_int &lhs, const debug_int &rhs)
 

Macro Definition Documentation

#define debug_printf (   slot_bitmask,
  ... 
)
Value:
if (::sprockit::debug::slot_active(slot_bitmask)){ \
}
static bool slot_active(const debug_int &allowed)
slot_active Determine whether a debug slot is active.
std::string printf(const char *fmt,...)
static void print_debug_string(const std::string &str, std::ostream &os=std::cout)
print_debug_string Extra detail (prefix_fxn) can be added to each debug print.

Definition at line 275 of file debug.h.

Referenced by sstmac::hw::multipath_router< ParentRouter >::route().

#define DeclareDebugSlot (   name)
Value:
namespace sprockit { namespace dbg { \
extern debug_int name; \
} }

Macro used for declaring a debug slot in a header file.

This only declares the symbols used for debug printing without defining any of them. An arbitrary number of declarations are allowed.

Definition at line 244 of file debug.h.

#define MakeDebugSlot (   name,
  ... 
)
Value:
#define RegisterDebugSlot(name,...)
Macro used for defining all the symbols associated with a previously declared debug slot (DeclareDebu...
Definition: debug.h:256
#define DeclareDebugSlot(name)
Macro used for declaring a debug slot in a header file.
Definition: debug.h:244

Declare and define a debug slot in a single macro in a source file.

Should always go in global namespace

Definition at line 267 of file debug.h.

#define MAX_DEBUG_SLOT   63

Definition at line 21 of file debug.h.

#define RegisterDebugSlot (   name,
  ... 
)
Value:
namespace sprockit { \
namespace dbg { \
debug_int name; \
debug_register_slot name##_debug_registerer(#name, &name, "" __VA_ARGS__); \
} }

Macro used for defining all the symbols associated with a previously declared debug slot (DeclareDebugSlot).

This should be defined once in a single source file. The declaration should always go in the global namespace. VA_ARGS here is an optional docstring

Definition at line 256 of file debug.h.