From f4291aac256622546a5a51dce109599007f5b3cb Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Fri, 30 Jan 2009 20:04:15 -0500 Subject: Errors: Print a URL with a hash of the format string to find more information about an error. --- src/base/misc.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/base') diff --git a/src/base/misc.cc b/src/base/misc.cc index b0c769ac6..035282baf 100644 --- a/src/base/misc.cc +++ b/src/base/misc.cc @@ -31,6 +31,7 @@ #include #include #include +#include #include "base/cprintf.hh" #include "base/hostinfo.hh" @@ -68,15 +69,20 @@ __exit_message(const char *prefix, int code, default: format += "\n"; } + + uint32_t crc = crc32(0, (const Bytef*)fmt, strlen(fmt)); format += " @ cycle %d\n[%s:%s, line %d]\n"; format += "Memory Usage: %ld KBytes\n"; + format += "For more information see: http://www.m5sim.org/%s/%x\n"; args.push_back(curTick); args.push_back(func); args.push_back(file); args.push_back(line); args.push_back(memUsage()); + args.push_back(prefix); + args.push_back(crc); ccprintf(cerr, format.c_str(), args); @@ -103,6 +109,8 @@ __base_message(std::ostream &stream, const char *prefix, bool verbose, default: format += "\n"; } + + uint32_t crc = crc32(0, (const Bytef*)fmt, strlen(fmt)); if (verbose) { format += " @ cycle %d\n[%s:%s, line %d]\n"; @@ -112,5 +120,11 @@ __base_message(std::ostream &stream, const char *prefix, bool verbose, args.push_back(line); } + if (strcmp(prefix, "warn") == 0) { + format += "For more information see: http://www.m5sim.org/%s/%x\n"; + args.push_back(prefix); + args.push_back(crc); + } + ccprintf(stream, format.c_str(), args); } -- cgit v1.2.3