blob: 6c5e700ae4f6dded061a4d2e5e311e09b183def4 [file] [log] [blame]
Ted Kremenekfbeeca82008-07-19 06:11:04 +00001#!/usr/bin/env perl
Ted Kremenekb0982882008-03-25 22:35:32 +00002#
3# The LLVM Compiler Infrastructure
4#
5# This file is distributed under the University of Illinois Open Source
6# License. See LICENSE.TXT for details.
7#
8##===----------------------------------------------------------------------===##
9#
Ted Kremenekfbeeca82008-07-19 06:11:04 +000010# A script designed to interpose between the build system and gcc. It invokes
11# both gcc and the static analyzer.
Ted Kremenekb0982882008-03-25 22:35:32 +000012#
13##===----------------------------------------------------------------------===##
14
Ted Kremenekfbeeca82008-07-19 06:11:04 +000015use strict;
16use warnings;
Ted Kremenekb315a392008-09-21 19:56:14 +000017use Cwd qw/ getcwd abs_path /;
Ted Kremenek991c54b2008-08-08 20:46:42 +000018use File::Temp qw/ tempfile /;
19use File::Path qw / mkpath /;
Ted Kremenekddf32da2009-01-21 00:42:24 +000020use File::Basename;
Ted Kremenek2ec5cd52008-08-25 20:44:31 +000021
22my $CC = $ENV{'CCC_CC'};
23if (!defined $CC) { $CC = "gcc"; }
Ted Kremenekddf32da2009-01-21 00:42:24 +000024my $CleanupFile;
25my $ResultFile;
26
27# Remove any stale files at exit.
28END {
29 if (defined $CleanupFile && -z $CleanupFile) {
30 `rm -f $CleanupFile`;
31 }
32}
33
Ted Kremenek991c54b2008-08-08 20:46:42 +000034##----------------------------------------------------------------------------##
35# Process Clang Crashes.
36##----------------------------------------------------------------------------##
37
38sub GetPPExt {
39 my $Lang = shift;
40 if ($Lang =~ /objective-c/) { return ".mi"; }
41 return ".i";
42}
43
Ted Kremenek5d31f832008-08-18 18:38:29 +000044sub ProcessClangFailure {
Ted Kremenekc3998fa2008-09-25 00:51:44 +000045 my ($Clang, $Lang, $file, $Args, $HtmlDir, $ErrorType, $ofile) = @_;
Ted Kremenek991c54b2008-08-08 20:46:42 +000046 my $Dir = "$HtmlDir/crashes";
47 mkpath $Dir;
Ted Kremenekc3998fa2008-09-25 00:51:44 +000048
49 # Generate the preprocessed file with cc (i.e., gcc).
Ted Kremenek991c54b2008-08-08 20:46:42 +000050 my ($PPH, $PPFile) = tempfile("clang_crash_XXXXXX",
51 SUFFIX => GetPPExt($Lang),
52 DIR => $Dir);
53
Ted Kremenek2ec5cd52008-08-25 20:44:31 +000054 system $CC, @$Args, "-E", "-o", $PPFile;
Ted Kremenek991c54b2008-08-08 20:46:42 +000055 close ($PPH);
Ted Kremenekc3998fa2008-09-25 00:51:44 +000056
57 # Generate the preprocessed file with clang.
58 my $PPFile_Clang = $PPFile;
59 $PPFile_Clang =~ s/[.](.+)$/.clang.$1/;
60 system $Clang, @$Args, "-E", "-o", "$PPFile_Clang";
61
62 # Create the info file.
Ted Kremenek82a12532008-09-25 00:25:16 +000063 open (OUT, ">", "$PPFile.info.txt") or die "Cannot open $PPFile.info.txt\n";
Ted Kremenek5f2825f2008-09-21 18:04:49 +000064 print OUT abs_path($file), "\n";
Ted Kremenek5d31f832008-08-18 18:38:29 +000065 print OUT "$ErrorType\n";
Ted Kremenek2dd7ad12008-08-18 20:55:25 +000066 print OUT "@$Args\n";
Ted Kremenek991c54b2008-08-08 20:46:42 +000067 close OUT;
Ted Kremenek82a12532008-09-25 00:25:16 +000068 `uname -a >> $PPFile.info.txt 2>&1`;
69 `$CC -v >> $PPFile.info.txt 2>&1`;
Ted Kremenek9f9b1fd2008-09-12 22:49:36 +000070 system 'mv',$ofile,"$PPFile.stderr.txt";
Ted Kremenek991c54b2008-08-08 20:46:42 +000071}
Ted Kremenekb0982882008-03-25 22:35:32 +000072
Ted Kremenekfbeeca82008-07-19 06:11:04 +000073##----------------------------------------------------------------------------##
74# Running the analyzer.
75##----------------------------------------------------------------------------##
Ted Kremenekb0982882008-03-25 22:35:32 +000076
Ted Kremenekfbeeca82008-07-19 06:11:04 +000077sub Analyze {
78 my ($Clang, $Args, $Lang, $Output, $Verbose, $HtmlDir, $file, $Analyses) = @_;
Seo Sanghyeond3894652008-04-04 11:02:21 +000079
Ted Kremenekfbeeca82008-07-19 06:11:04 +000080 # Skip anything related to C++.
81 return if ($Lang =~ /c[+][+]/);
Ted Kremenek5d31f832008-08-18 18:38:29 +000082
Ted Kremenekfbeeca82008-07-19 06:11:04 +000083 my $RunAnalyzer = 0;
84 my $Cmd;
85 my @CmdArgs;
Ted Kremenek991c54b2008-08-08 20:46:42 +000086 my @CmdArgsSansAnalyses;
Ted Kremenek61cd9882008-05-24 15:58:54 +000087
Ted Kremenekfbeeca82008-07-19 06:11:04 +000088 if ($Lang =~ /header/) {
89 exit 0 if (!defined ($Output));
90 $Cmd = 'cp';
91 push @CmdArgs,$file;
92 # Remove the PCH extension.
93 $Output =~ s/[.]gch$//;
94 push @CmdArgs,$Output;
Ted Kremenek991c54b2008-08-08 20:46:42 +000095 @CmdArgsSansAnalyses = @CmdArgs;
Ted Kremenekfbeeca82008-07-19 06:11:04 +000096 }
97 else {
98 $Cmd = $Clang;
Ted Kremenekfbeeca82008-07-19 06:11:04 +000099 push @CmdArgs,'-DIBOutlet=__attribute__((iboutlet))';
100 push @CmdArgs,@$Args;
Ted Kremenek991c54b2008-08-08 20:46:42 +0000101 @CmdArgsSansAnalyses = @CmdArgs;
Daniel Dunbard4270232009-01-20 23:17:32 +0000102 push @CmdArgs,'--analyze';
Ted Kremenek491918e2009-01-23 20:52:26 +0000103 push @CmdArgs,"--analyzer-display-progress";
Ted Kremenek991c54b2008-08-08 20:46:42 +0000104 push @CmdArgs,(split /\s/,$Analyses);
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000105 $RunAnalyzer = 1;
106 }
107
108 my @PrintArgs;
109 my $dir;
110
111 if ($Verbose) {
112 $dir = getcwd();
113 print STDERR "\n[LOCATION]: $dir\n";
114 push @PrintArgs,"'$Cmd'";
115 foreach my $arg (@CmdArgs) { push @PrintArgs,"\'$arg\'"; }
116 }
117
118 if ($Verbose == 1) {
Ted Kremenek61cd9882008-05-24 15:58:54 +0000119 # We MUST print to stderr. Some clients use the stdout output of
120 # gcc for various purposes.
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000121 print STDERR join(' ',@PrintArgs);
122 print STDERR "\n";
123 }
124 elsif ($Verbose == 2) {
125 print STDERR "#SHELL (cd '$dir' && @PrintArgs)\n";
126 }
Ted Kremenek61cd9882008-05-24 15:58:54 +0000127
Ted Kremenekddf32da2009-01-21 00:42:24 +0000128 if ($RunAnalyzer) {
129 if (defined $ResultFile) {
130 push @CmdArgs,'-o';
131 push @CmdArgs, $ResultFile;
132 }
133 elsif (defined $HtmlDir) {
134 push @CmdArgs,'-o';
135 push @CmdArgs, $HtmlDir;
136 }
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000137 }
Ted Kremenek948e06b2008-08-27 22:30:34 +0000138
139 if (defined $ENV{'CCC_UBI'}) {
140 push @CmdArgs,"--analyzer-viz-egraph-ubigraph";
141 }
Ted Kremenek991c54b2008-08-08 20:46:42 +0000142
Ted Kremenek9a3c7da2008-09-04 00:02:34 +0000143 # Capture the STDERR of clang and send it to a temporary file.
144 # Capture the STDOUT of clang and reroute it to ccc-analyzer's STDERR.
145 # We save the output file in the 'crashes' directory if clang encounters
146 # any problems with the file.
Ted Kremenek13462682008-09-11 23:05:26 +0000147 pipe (FROM_CHILD, TO_PARENT);
Ted Kremenek9a3c7da2008-09-04 00:02:34 +0000148 my $pid = fork();
149 if ($pid == 0) {
Ted Kremenek13462682008-09-11 23:05:26 +0000150 close FROM_CHILD;
151 open(STDOUT,">&", \*TO_PARENT);
152 open(STDERR,">&", \*TO_PARENT);
Ted Kremenek9a3c7da2008-09-04 00:02:34 +0000153 exec $Cmd, @CmdArgs;
154 }
Ted Kremenek13462682008-09-11 23:05:26 +0000155
156 close TO_PARENT;
157 my ($ofh, $ofile) = tempfile("clang_output_XXXXXX", DIR => $HtmlDir);
158
159 while (<FROM_CHILD>) {
160 print $ofh $_;
161 print STDERR $_;
162 }
163
164 waitpid($pid,0);
Ted Kremenek9a3c7da2008-09-04 00:02:34 +0000165 my $Result = $?;
166
167 # Did the command die because of a signal?
168 if ($Result & 127 and $Cmd eq $Clang and defined $HtmlDir) {
Ted Kremenekc3998fa2008-09-25 00:51:44 +0000169 ProcessClangFailure($Clang, $Lang, $file, \@CmdArgsSansAnalyses, $HtmlDir,
Ted Kremenek9a3c7da2008-09-04 00:02:34 +0000170 "Crash", $ofile);
171 }
172 elsif ($Result) {
Ted Kremenekc3998fa2008-09-25 00:51:44 +0000173 ProcessClangFailure($Clang, $Lang, $file, \@CmdArgsSansAnalyses, $HtmlDir,
Ted Kremenek9a3c7da2008-09-04 00:02:34 +0000174 "Parser Rejects", $ofile);
175 }
176
177 `rm -f $ofile`;
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000178}
Ted Kremenek61cd9882008-05-24 15:58:54 +0000179
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000180##----------------------------------------------------------------------------##
181# Lookup tables.
182##----------------------------------------------------------------------------##
183
184my %CompileOptionMap = (
185 '-nostdinc' => 0,
Anders Carlsson06c58b12008-12-19 20:56:23 +0000186 '-fblocks' => 0,
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000187 '-fobjc-gc-only' => 0,
188 '-fobjc-gc' => 0,
189 '-include' => 1,
190 '-idirafter' => 1,
191 '-iprefix' => 1,
192 '-iquote' => 1,
193 '-isystem' => 1,
194 '-iwithprefix' => 1,
195 '-iwithprefixbefore' => 1
196);
197
198my %LinkerOptionMap = (
199 '-framework' => 1
200);
201
202my %CompilerLinkerOptionMap = (
203 '-isysroot' => 1,
204 '-arch' => 1,
Ted Kremeneke4f69522008-09-29 22:45:28 +0000205 '-v' => 0,
Ted Kremenekb10362a2008-09-30 23:40:25 +0000206 '-fpascal-strings' => 0,
207 '-mmacosx-version-min' => 0 # This is really a 1 argument, but always has '='
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000208);
209
210my %IgnoredOptionMap = (
Ted Kremenek94026092008-07-24 03:52:21 +0000211 '-MT' => 1, # Ignore these preprocessor options.
212 '-MF' => 1,
213
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000214 '-fsyntax-only' => 0,
215 '-save-temps' => 0,
216 '-install_name' => 1,
217 '-exported_symbols_list' => 1,
218 '-current_version' => 1,
219 '-compatibility_version' => 1,
220 '-init' => 1,
221 '-e' => 1,
222 '-seg1addr' => 1,
223 '-bundle_loader' => 1,
224 '-multiply_defined' => 1,
225 '-sectorder' => 3,
226 '--param' => 1,
227 '-u' => 1
228);
229
230my %LangMap = (
231 'c' => 'c',
232 'cpp' => 'c++',
233 'cc' => 'c++',
234 'i' => 'c-cpp-output',
235 'm' => 'objective-c',
236 'mi' => 'objective-c-cpp-output'
237);
238
Ted Kremeneka30730e2008-09-29 16:15:20 +0000239my %UniqueOptions = (
240 '-isysroot' => 0
241);
242
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000243##----------------------------------------------------------------------------##
244# Main Logic.
245##----------------------------------------------------------------------------##
246
247my $Action = 'link';
248my @CompileOpts;
249my @LinkOpts;
250my @Files;
251my $Lang;
252my $Output;
Ted Kremeneka30730e2008-09-29 16:15:20 +0000253my %Uniqued;
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000254
255# Forward arguments to gcc.
Ted Kremenekf17ef3c2008-08-21 21:47:09 +0000256my $Status = system($CC,@ARGV);
Ted Kremenekcb344d02008-08-28 01:18:44 +0000257if ($Status) { exit($Status >> 8); }
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000258
259# Get the analysis options.
260my $Analyses = $ENV{'CCC_ANALYZER_ANALYSIS'};
261if (!defined($Analyses)) { $Analyses = '-checker-cfref'; }
262
Zhongxing Xu07c37672008-10-27 14:26:32 +0000263# Get the store model.
264my $StoreModel = $ENV{'CCC_ANALYZER_STORE_MODEL'};
265
Ted Kremenekdb4f5f22008-11-04 00:02:53 +0000266# Get the output format.
267my $OutputFormat = $ENV{'CCC_ANALYZER_OUTPUT_FORMAT'};
268
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000269# Determine the level of verbosity.
270my $Verbose = 0;
271if (defined $ENV{CCC_ANALYZER_VERBOSE}) { $Verbose = 1; }
272if (defined $ENV{CCC_ANALYZER_LOG}) { $Verbose = 2; }
273
274# Determine what clang executable to use.
275my $Clang = $ENV{'CLANG'};
276if (!defined $Clang) { $Clang = 'clang'; }
277
278# Get the HTML output directory.
279my $HtmlDir = $ENV{'CCC_ANALYZER_HTML'};
280
Ted Kremenek27783eb2008-09-25 20:17:57 +0000281my %ArchsSeen;
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000282
283# Process the arguments.
284foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
Ted Kremenek89c4fcf2008-10-19 06:42:38 +0000285 my $Arg = $ARGV[$i];
286 my ($ArgKey) = split /=/,$Arg,2;
287
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000288 # Modes ccc-analyzer supports
289 if ($Arg eq '-E') { $Action = 'preprocess'; }
290 elsif ($Arg eq '-c') { $Action = 'compile'; }
291 elsif ($Arg =~ /^-print-prog-name/) { exit 0; }
Ted Kremenek27783eb2008-09-25 20:17:57 +0000292
293 # Specially handle duplicate cases of -arch
294 if ($Arg eq "-arch") {
295 my $arch = $ARGV[$i+1];
296 $ArchsSeen{$arch} = 1;
297 ++$i;
298 next;
299 }
300
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000301 # Options with possible arguments that should pass through to compiler.
Ted Kremenek89c4fcf2008-10-19 06:42:38 +0000302 if (defined $CompileOptionMap{$ArgKey}) {
303 my $Cnt = $CompileOptionMap{$ArgKey};
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000304 push @CompileOpts,$Arg;
305 while ($Cnt > 0) { ++$i; --$Cnt; push @CompileOpts, $ARGV[$i]; }
306 next;
307 }
308
309 # Options with possible arguments that should pass through to linker.
Ted Kremenek89c4fcf2008-10-19 06:42:38 +0000310 if (defined $LinkerOptionMap{$ArgKey}) {
311 my $Cnt = $LinkerOptionMap{$ArgKey};
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000312 push @LinkOpts,$Arg;
313 while ($Cnt > 0) { ++$i; --$Cnt; push @LinkOpts, $ARGV[$i]; }
314 next;
315 }
316
317 # Options with possible arguments that should pass through to both compiler
318 # and the linker.
Ted Kremenek89c4fcf2008-10-19 06:42:38 +0000319 if (defined $CompilerLinkerOptionMap{$ArgKey}) {
320 my $Cnt = $CompilerLinkerOptionMap{$ArgKey};
Ted Kremenek47fc25f2008-09-29 23:06:09 +0000321
Ted Kremeneka30730e2008-09-29 16:15:20 +0000322 # Check if this is an option that should have a unique value, and if so
323 # determine if the value was checked before.
324 if ($UniqueOptions{$Arg}) {
325 if (defined $Uniqued{$Arg}) {
326 $i += $Cnt;
327 next;
328 }
329 $Uniqued{$Arg} = 1;
330 }
331
Ted Kremenek47fc25f2008-09-29 23:06:09 +0000332 push @CompileOpts,$Arg;
333 push @LinkOpts,$Arg;
334
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000335 while ($Cnt > 0) {
336 ++$i; --$Cnt;
337 push @CompileOpts, $ARGV[$i];
338 push @LinkOpts, $ARGV[$i];
339 }
340 next;
341 }
Ted Kremenek61cd9882008-05-24 15:58:54 +0000342
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000343 # Ignored options.
Ted Kremenek89c4fcf2008-10-19 06:42:38 +0000344 if (defined $IgnoredOptionMap{$ArgKey}) {
345 my $Cnt = $IgnoredOptionMap{$ArgKey};
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000346 while ($Cnt > 0) {
347 ++$i; --$Cnt;
348 }
349 next;
350 }
Ted Kremenek61cd9882008-05-24 15:58:54 +0000351
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000352 # Compile mode flags.
353 if ($Arg =~ /^-[D,I,U](.*)$/) {
354 my $Tmp = $Arg;
355 if ($1 eq '') {
356 # FIXME: Check if we are going off the end.
357 ++$i;
358 $Tmp = $Arg . $ARGV[$i];
359 }
360 push @CompileOpts,$Tmp;
361 next;
362 }
363
364 # Language.
365 if ($Arg eq '-x') {
366 $Lang = $ARGV[$i+1];
367 ++$i; next;
368 }
Ted Kremenek61cd9882008-05-24 15:58:54 +0000369
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000370 # Output file.
371 if ($Arg eq '-o') {
372 ++$i;
373 $Output = $ARGV[$i];
374 next;
375 }
376
377 # Get the link mode.
378 if ($Arg =~ /^-[l,L,O]/) {
379 if ($Arg eq '-O') { push @LinkOpts,'-O1'; }
380 elsif ($Arg eq '-Os') { push @LinkOpts,'-O2'; }
381 else { push @LinkOpts,$Arg; }
382 next;
383 }
384
385 if ($Arg =~ /^-std=/) {
386 push @CompileOpts,$Arg;
387 next;
388 }
389
390# if ($Arg =~ /^-f/) {
391# # FIXME: Not sure if the remaining -fxxxx options have no arguments.
392# push @CompileOpts,$Arg;
393# push @LinkOpts,$Arg; # FIXME: Not sure if these are link opts.
394# }
395
396 # Get the compiler/link mode.
397 if ($Arg =~ /^-F(.+)$/) {
398 my $Tmp = $Arg;
399 if ($1 eq '') {
400 # FIXME: Check if we are going off the end.
401 ++$i;
402 $Tmp = $Arg . $ARGV[$i];
403 }
404 push @CompileOpts,$Tmp;
405 push @LinkOpts,$Tmp;
406 next;
407 }
Ted Kremenek61cd9882008-05-24 15:58:54 +0000408
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000409 # Input files.
410 if ($Arg eq '-filelist') {
411 # FIXME: Make sure we aren't walking off the end.
412 open(IN, $ARGV[$i+1]);
413 while (<IN>) { s/\015?\012//; push @Files,$_; }
414 close(IN);
415 ++$i; next;
416 }
417
418 if (!($Arg =~ /^-/)) {
419 push @Files,$Arg; next;
420 }
421}
Ted Kremenek61cd9882008-05-24 15:58:54 +0000422
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000423if ($Action eq 'compile' or $Action eq 'link') {
424 foreach my $file (@Files) {
425 # Determine the language for the file.
426 my $FileLang = $Lang;
427
428 if (!defined($FileLang)) {
429 # Infer the language from the extension.
430 if ($file =~ /[.]([^.]+)$/) {
431 $FileLang = $LangMap{$1};
432 }
433 }
Ted Kremenek1262fc42008-05-14 20:10:33 +0000434
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000435 next if (!defined $FileLang);
436
437 my @AnalyzeArgs;
438
439 if ($FileLang ne 'unknown') {
440 push @AnalyzeArgs,'-x';
441 push @AnalyzeArgs,$FileLang;
442 }
Ted Kremenekb0982882008-03-25 22:35:32 +0000443
Zhongxing Xu07c37672008-10-27 14:26:32 +0000444 if (defined $StoreModel) {
445 push @AnalyzeArgs, $StoreModel;
446 }
Ted Kremenekdb4f5f22008-11-04 00:02:53 +0000447
448 if (defined $OutputFormat) {
449 push @AnalyzeArgs, "-analyzer-output-" . $OutputFormat;
Ted Kremenekddf32da2009-01-21 00:42:24 +0000450 if ($OutputFormat eq "plist") {
451 # Change "Output" to be a file.
452 my ($h, $f) = tempfile("report-XXXXXX", SUFFIX => ".plist",
453 DIR => $HtmlDir);
454 $ResultFile = $f;
455 $CleanupFile = $f;
456 }
457
Ted Kremenekdb4f5f22008-11-04 00:02:53 +0000458 }
Zhongxing Xu07c37672008-10-27 14:26:32 +0000459
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000460 push @AnalyzeArgs,@CompileOpts;
461 push @AnalyzeArgs,$file;
Zhongxing Xu07c37672008-10-27 14:26:32 +0000462
Ted Kremenek27783eb2008-09-25 20:17:57 +0000463 my @Archs = keys %ArchsSeen;
464 if (scalar @Archs) {
465 foreach my $arch (@Archs) {
466 my @NewArgs;
467 push @NewArgs, '-arch';
468 push @NewArgs, $arch;
469 push @NewArgs, @AnalyzeArgs;
470 Analyze($Clang, \@NewArgs, $FileLang, $Output,
471 $Verbose, $HtmlDir, $file, $Analyses);
472 }
473 }
474 else {
475 Analyze($Clang, \@AnalyzeArgs, $FileLang, $Output,
476 $Verbose, $HtmlDir, $file, $Analyses);
477 }
Ted Kremenekfbeeca82008-07-19 06:11:04 +0000478 }
479}
Ted Kremenekb0982882008-03-25 22:35:32 +0000480
Ted Kremenek948e06b2008-08-27 22:30:34 +0000481exit($Status >> 8);
482