42#include "debug/FmtFlag.hh"
43#include "debug/FmtStackTrace.hh"
44#include "debug/FmtTicksOff.hh"
50 static const std::string default_name(
"global");
87 warn(
"Trying to set debug logger to NULL\n");
109 const void *
d,
int len,
const std::string &flag)
114 const char *
data =
static_cast<const char *
>(
d);
117 for (
i = 0;
i <
len;
i += 16) {
118 std::ostringstream line;
124 for (j = 0; j <
c; j++) {
126 if ((j & 0xf) == 7 && j > 0)
134 for (j = 0; j <
c; j++) {
135 int ch =
data[
i + j] & 0x7f;
136 ccprintf(line,
"%c", (
char)(isprint(ch) ? ch :
' '));
149 const std::string &flag,
const std::string &message)
154 if (!debug::FmtTicksOff && (when !=
MaxTick))
157 if (debug::FmtFlag && !flag.empty())
166 if (debug::FmtStackTrace) {
#define STATIC_ERR(m)
Statically allocate a string and write it to STDERR.
ObjectMatch contains a vector of expressions.
static void globalEnable()
static void globalDisable()
Debug logging base class.
bool isEnabled(const std::string &name) const
virtual std::ostream & getOstream()=0
Return an ostream that can be used to send messages to the 'same place' as formatted logMessage messa...
virtual void logMessage(Tick when, const std::string &name, const std::string &flag, const std::string &message)=0
Log formatted message.
void dump(Tick when, const std::string &name, const void *d, int len, const std::string &flag)
Dump a block of data of length len.
Logging wrapper for ostreams with the format: <when>: <name>: <message-body>
void logMessage(Tick when, const std::string &name, const std::string &flag, const std::string &message) override
Log formatted message.
void enable()
Enable/disable debug logging.
void setDebugLogger(Logger *logger)
Delete the current global logger and assign a new one.
Logger * getDebugLogger()
Get the current global debug logger.
std::ostream & output()
Get the ostream from the current global logger.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
void print_backtrace()
Print a gem5 post-mortem report.
uint64_t Tick
Tick count type.
void ccprintf(cp::Print &print)
const std::string & name()