summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2006-03-14 17:08:13 +0000
committerSimon Marlow <simonmar@microsoft.com>2006-03-14 17:08:13 +0000
commit04089f99f55e719afd0c967be35e8bbb8691dbed (patch)
tree756015e2720e046fb5ff66bf53e7a0eea382f341
parentaa056e7fda12383c88de03c7b2ac611307d8019c (diff)
downloadhaskell-04089f99f55e719afd0c967be35e8bbb8691dbed.tar.gz
improve panic messages a bit, with the GHC version and platform
-rw-r--r--ghc/compiler/Makefile12
-rw-r--r--ghc/compiler/utils/Panic.lhs7
-rw-r--r--ghc/rts/Makefile2
-rw-r--r--ghc/rts/RtsMessages.c6
4 files changed, 16 insertions, 11 deletions
diff --git a/ghc/compiler/Makefile b/ghc/compiler/Makefile
index 1a9b428483..c1819f2cd2 100644
--- a/ghc/compiler/Makefile
+++ b/ghc/compiler/Makefile
@@ -261,9 +261,9 @@ stage1/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk Makefile
@echo "#ifndef __PLATFORM_H__" >$@
@echo "#define __PLATFORM_H__" >>$@
@echo >> $@
- @echo "#define BuildPlatform_TYPE $(BuildPlatform_CPP)" >> $@
- @echo "#define HostPlatform_TYPE $(HostPlatform_CPP)" >> $@
- @echo "#define TargetPlatform_TYPE $(TargetPlatform_CPP)" >> $@
+ @echo "#define BuildPlatform_NAME \"$(BUILDPLATFORM)\"" >> $@
+ @echo "#define HostPlatform_NAME \"$(HOSTPLATFORM)\"" >> $@
+ @echo "#define TargetPlatform_NAME \"$(TARGETPLATFORM)\"" >> $@
@echo >> $@
@echo "#define $(BuildPlatform_CPP)_BUILD 1" >> $@
@echo "#define $(HostPlatform_CPP)_HOST 1" >> $@
@@ -307,9 +307,9 @@ stage2/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk Makefile
@echo "#ifndef __PLATFORM_H__" >$@
@echo "#define __PLATFORM_H__" >>$@
@echo >> $@
- @echo "#define BuildPlatform_TYPE $(HostPlatform_CPP)" >> $@
- @echo "#define HostPlatform_TYPE $(TargetPlatform_CPP)" >> $@
- @echo "#define TargetPlatform_TYPE $(TargetPlatform_CPP)" >> $@
+ @echo "#define BuildPlatform_NAME \"$(HOSTPLATFORM)\"" >> $@
+ @echo "#define HostPlatform_NAME \"$(TARGETPLATFORM)\"" >> $@
+ @echo "#define TargetPlatform_NAME \"$(TARGETPLATFORM)\"" >> $@
@echo >> $@
@echo "#define $(HostPlatform_CPP)_BUILD 1" >> $@
@echo "#define $(TargetPlatform_CPP)_HOST 1" >> $@
diff --git a/ghc/compiler/utils/Panic.lhs b/ghc/compiler/utils/Panic.lhs
index cdfc9628b9..1a74d5db32 100644
--- a/ghc/compiler/utils/Panic.lhs
+++ b/ghc/compiler/utils/Panic.lhs
@@ -120,11 +120,10 @@ showGhcException (InstallationError str)
showGhcException (Interrupted)
= showString "interrupted"
showGhcException (Panic s)
- = showString ("panic! (the `impossible' happened, GHC version "
- ++ cProjectVersion ++ "):\n\t"
+ = showString ("panic! (the 'impossible' happened)\n"
+ ++ " (GHC version " ++ cProjectVersion ++ " for " ++ TargetPlatform_NAME ++ "):\n\t"
++ s ++ "\n\n"
- ++ "Please report this as a compiler bug. See:\n"
- ++ " http://www.haskell.org/ghc/reportabug\n")
+ ++ "Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug\n")
#if __GLASGOW_HASKELL__ < 603
myMkTyConApp = mkAppTy
diff --git a/ghc/rts/Makefile b/ghc/rts/Makefile
index 34bb7f52d1..ef3e244032 100644
--- a/ghc/rts/Makefile
+++ b/ghc/rts/Makefile
@@ -124,6 +124,8 @@ SRC_HC_OPTS += -static
endif
# SRC_HC_OPTS += -fPIC
+RtsMessages_CC_OPTS += -DProjectVersion=\"$(ProjectVersion)\"
+
ifeq "$(way)" "mp"
SRC_HC_OPTS += -I$$PVM_ROOT/include
endif
diff --git a/ghc/rts/RtsMessages.c b/ghc/rts/RtsMessages.c
index 9f36e2e97d..1242d886eb 100644
--- a/ghc/rts/RtsMessages.c
+++ b/ghc/rts/RtsMessages.c
@@ -107,6 +107,9 @@ isGUIApp()
}
#endif
+#define xstr(s) str(s)
+#define str(s) #s
+
void
rtsFatalInternalErrorFn(char *s, va_list ap)
{
@@ -135,7 +138,8 @@ rtsFatalInternalErrorFn(char *s, va_list ap)
}
vfprintf(stderr, s, ap);
fprintf(stderr, "\n");
- fprintf(stderr, " Please report this as a compiler bug. See:\n http://www.haskell.org/ghc/reportabug\n");
+ fprintf(stderr, " (GHC version %s for %s)\n", ProjectVersion, xstr(HostPlatform_TYPE));
+ fprintf(stderr, " Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug\n");
fflush(stderr);
}