diff options
author | Ian Lynagh <igloo@earth.li> | 2007-08-16 18:32:59 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2007-08-16 18:32:59 +0000 |
commit | 0dfcd5776f3ef89ceaafef6c4730ddac759e3716 (patch) | |
tree | 3c141e70877e3b3e1494b2621f102afcbbbe5cce /rts/RtsUtils.c | |
parent | 0ee85183fac8129a3c1b890849f32f30fd3940ec (diff) | |
download | haskell-0dfcd5776f3ef89ceaafef6c4730ddac759e3716.tar.gz |
Document +RTS --info, and make it a Read'able Haskell value
Diffstat (limited to 'rts/RtsUtils.c')
-rw-r--r-- | rts/RtsUtils.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c index 94c357e5ba..c730d7aec4 100644 --- a/rts/RtsUtils.c +++ b/rts/RtsUtils.c @@ -460,3 +460,23 @@ int genericRaise(int sig) { return raise(sig); #endif } + +static void mkRtsInfoPair(char *key, char *val) { + /* XXX should check for "s, \s etc in key and val */ + printf(" ,(\"%s\", \"%s\")\n", key, val); +} + +void printRtsInfo(void) { + /* The first entry is just a hack to make it easy to get the + * commas right */ + printf(" [(\"GHC RTS\", \"Yes\")\n"); + mkRtsInfoPair("GHC version", ProjectVersion); + mkRtsInfoPair("RTS way", RtsWay); + mkRtsInfoPair("Host platform", HostPlatform); + mkRtsInfoPair("Build platform", BuildPlatform); + mkRtsInfoPair("Target platform", TargetPlatform); + mkRtsInfoPair("Compiler unregisterised", GhcUnregisterised); + mkRtsInfoPair("Tables next to code", GhcEnableTablesNextToCode); + printf(" ]\n"); +} + |