From 581ef3c0763923b2e08f6899233281d07e07b781 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Fri, 13 May 2005 00:28:42 -0400 Subject: [PATCH] panic vs fatal fixes in bus.cc base/misc.hh: Add some comments explaining the difference between panic() and fatal(). --HG-- extra : convert_revision : 876f0c98276fa1060c0589dc179022a297a8ed2e --- base/misc.hh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/base/misc.hh b/base/misc.hh index a4f9a99c5..ac5eab1cb 100644 --- a/base/misc.hh +++ b/base/misc.hh @@ -33,7 +33,11 @@ #include "base/cprintf.hh" // -// This implements a cprintf based panic +// This implements a cprintf based panic() function. panic() should +// be called when something happens that should never ever happen +// regardless of what the user does (i.e., an acutal m5 bug). panic() +// calls abort which can dump core or enter the debugger. +// // void __panic(const std::string&, cp::ArgList &, const char*, const char*, int) __attribute__((noreturn)); @@ -44,7 +48,12 @@ void __panic(const std::string&, cp::ArgList &, const char*, const char*, int) __panic__(args, cp::ArgListNull()) // -// This implements a cprintf based fatal +// This implements a cprintf based fatal() function. fatal() should +// be called when the simulation cannot continue due to some condition +// that is the user's fault (bad configuration, invalid arguments, +// etc.) and not a simulator bug. fatal() calls exit(1), i.e., a +// "normal" exit with an error code, as opposed to abort() like +// panic() does. // void __fatal(const std::string&, cp::ArgList &, const char*, const char*, int) __attribute__((noreturn)); -- 2.30.2