summaryrefslogtreecommitdiff
path: root/src/base/misc.cc
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2009-01-30 20:04:15 -0500
committerAli Saidi <saidi@eecs.umich.edu>2009-01-30 20:04:15 -0500
commitf4291aac256622546a5a51dce109599007f5b3cb (patch)
treeb40cdfa74233584291953ec236ff20aaf159a1fb /src/base/misc.cc
parent35a85a4e86143c5bf23d5b74c14856792a0a624c (diff)
downloadgem5-f4291aac256622546a5a51dce109599007f5b3cb.tar.xz
Errors: Print a URL with a hash of the format string to find more information about an error.
Diffstat (limited to 'src/base/misc.cc')
-rw-r--r--src/base/misc.cc14
1 files changed, 14 insertions, 0 deletions
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 <cstdlib>
#include <iostream>
#include <string>
+#include <zlib.h>
#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);
}