projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2002-10-11 08:04:55 by simonpj]
[ghc-hetmet.git]
/
ghc
/
utils
/
prof
/
ghcprof.prl
diff --git
a/ghc/utils/prof/ghcprof.prl
b/ghc/utils/prof/ghcprof.prl
index
55e5afe
..
6d5cac7
100644
(file)
--- a/
ghc/utils/prof/ghcprof.prl
+++ b/
ghc/utils/prof/ghcprof.prl
@@
-1,9
+1,9
@@
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
-# $Id: ghcprof.prl,v 1.1 2000/04/05 10:06:36 simonmar Exp $
+# $Id: ghcprof.prl,v 1.4 2000/09/05 10:16:41 simonmar Exp $
#
# (c) The GHC Team 2000
#
#
# (c) The GHC Team 2000
#
-# needs: INSTALLING, FPTOOLS_TOP_ABS, libdir, TARGETPLATFORM, TMPDIR
+# needs: FPTOOLS_TOP_ABS, INSTALLING, DEFAULT_TMPDIR, TARGETPLATFORM, libdir, libexecdir
#
if ($ENV{'DAVINCIHOME'}) {
#
if ($ENV{'DAVINCIHOME'}) {
@@
-33,8
+33,8
@@
$cgprof_dir = ( $INSTALLING ? "$libexecdir"
if ( $ENV{'TMPDIR'} ) {
$Tmp_prefix = $ENV{'TMPDIR'} . "/ghcprof";
} else {
if ( $ENV{'TMPDIR'} ) {
$Tmp_prefix = $ENV{'TMPDIR'} . "/ghcprof";
} else {
- $Tmp_prefix ="${TMPDIR}/ghcprof";
- $ENV{'TMPDIR'} = "${TMPDIR}"; # set the env var as well
+ $Tmp_prefix ="${DEFAULT_TMPDIR}/ghcprof";
+ $ENV{'TMPDIR'} = "${DEFAULT_TMPDIR}"; # set the env var as well
}
# Create an new temporary filename.
}
# Create an new temporary filename.
@@
-55,11
+55,14
@@
$SIG{'INT'} = 'quit_upon_signal';
$SIG{'QUIT'} = 'quit_upon_signal';
sub tidy_up_and_die {
$SIG{'QUIT'} = 'quit_upon_signal';
sub tidy_up_and_die {
- if ($tempfile ne "") {
- print STDERR "Deleting $tempfile .. \n";
+ local($msg) = @_;
+
+ print STDERR "$Pgm: $msg\n";
+ if ($tempfile ne "" && -e $tempfile) {
+ print STDERR "Deleting $tempfile .. \n" if $Verbose;
unlink "$tempfile";
}
unlink "$tempfile";
}
- exit($?);
+ exit(1);
}
select(STDERR); $| = 1; select(STDOUT); # no STDERR buffering, please.
}
select(STDERR); $| = 1; select(STDOUT); # no STDERR buffering, please.
@@
-147,7
+150,7
@@
print STDERR "$Pgm: ($Version)\n" if $Verbose;
# ToDo: use the real xmlparser
# system("$xmlparser < $InputFile > $tempfile");
# ToDo: use the real xmlparser
# system("$xmlparser < $InputFile > $tempfile");
-# if ($? != 0) { tidy_up_and_die(); }
+# if ($? != 0) { tidy_up_and_die("xmlparser failed"); }
# Stehpen's hacky replacement for xmlparser:
# Stehpen's hacky replacement for xmlparser:
@@
-155,8
+158,8
@@
$cc_write = 1;
$ccs_write = 1;
$scc_write = 1;
$ccs_write = 1;
$scc_write = 1;
-open(INPUT, "<$InputFile") || tidy_up_and_die();
-open(TEMPFILE, ">$tempfile") || tidy_up_and_die();
+open(INPUT, "<$InputFile") || tidy_up_and_die("can't open `$InputFile'");
+open(TEMPFILE, ">$tempfile") || tidy_up_and_die("can't create `$tempfile'");
while (<INPUT>) {
if (/^1 (\d+) (.*)$/)
while (<INPUT>) {
if (/^1 (\d+) (.*)$/)
@@
-231,10
+234,7
@@
exit(0);
sub readProfileHeader {
local($found);
sub readProfileHeader {
local($found);
- if (!open(PROFILE,$tempfile)) {
- printf STDERR "$Pgm: unable to open profile file \"$tempfile\".\n";
- $? = 1; tidy_up_and_die();
- }
+ open(PROFILE,$tempfile) || tidy_up_and_die("can't open `$tempfile'");
$found=0;
while(<PROFILE>) {
$found=0;
while(<PROFILE>) {