tools/summarise_gcc_errors.pl
author William Roberts <williamr@symbian.org>
Mon, 14 Jun 2010 15:47:21 +0100
changeset 7 8c4a7869f673
parent 3 5578c2bec847
child 8 c38b26fd0c68
permissions -rw-r--r--
Add heuristic for guessing the source file associated with assembler errors Generalise text in error: pasting "xxx" and "yyy" does not give a valid preprocessing token Ignore "No such file or directory", as these are unlikely to be gcc specific.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
#! perl
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
# Copyright (c) 2010 Symbian Foundation Ltd
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
#
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
# Initial Contributors:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
# Symbian Foundation Ltd - initial contribution.
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
# 
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
# Contributors:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
#
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
# Description:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
# Perl script to summarise GCC logs
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
use strict;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
use Getopt::Long;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
sub Usage($)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
  {
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
  my ($msg) = @_;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
  
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
  print "$msg\n\n" if ($msg ne "");
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
  
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
	print <<'EOF';
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
summarise_gcc_errors.pl - simple script for analysing gcc error logs
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
	
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
This script will read a collection of GCC output logs and summarise
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
the error messages in various useful ways.
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
Options:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
-warnings      process warnings as well as errors
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
-verbose       list the files associated with each error
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
EOF
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
  exit (1);  
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
  }
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
my $warnings = 0;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
my $verbose = 0;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
# Analyse the rest of command-line parameters
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
if (!GetOptions(
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
    "w|warnings" => \$warnings,
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
    "v|verbose" => \$verbose,
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
    ))
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
  {
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
  Usage("Invalid argument");
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
  }
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    52
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    53
my $current_package = ""; 
7
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    54
my $saved_filename = "";
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
my %files;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    56
my %errors_by_file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    57
my %error_count_by_file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
my %errors;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    59
my %message_ids;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    60
my %files_by_message_id;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    61
my %messages_by_id;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
my %unique_message_counts;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    63
my %all_message_counts;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
my $next_message_id = 1;
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    65
my %packages_by_file;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    66
my %package_count_by_file;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    67
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    68
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
my $line;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    70
while ($line = <>)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
	{
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    72
	# </pre>os/usb, usb_CompilerCompatibility.005, SF_builds/usb/builds/CompilerCompatibility/usb_CompilerCompatibility.005/html/os_usb_failures.html
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    73
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    74
	if ($line =~/\/html\/([^\/]+)_failures.html/)
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    75
		{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    76
		$current_package = $1;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    77
		$current_package =~ s/_/\//;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    78
		next;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    79
		}
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    80
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    81
	# M:/epoc32/include/elements/nm_interfaces.h:255: warning: dereferencing type-punned pointer will break strict-aliasing rules
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    82
	# M:/epoc32/include/f32file.h:2169: warning: invalid access to non-static data member 'TVolFormatParam::iUId'  of NULL object
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    83
	# M:/epoc32/include/f32file.h:2169: warning: (perhaps the 'offsetof' macro was used incorrectly)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    84
	# M:/epoc32/include/comms-infras/ss_nodemessages.h:301: error: wrong number of template arguments (3, should be 4)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    85
	# M:/epoc32/include/elements/nm_signatures.h:496: error: provided for 'template<class TSIGNATURE, int PAYLOADATTRIBOFFSET, class TATTRIBUTECREATIONPOLICY, int PAYLOADBUFFERMAXLEN> class Messages::TSignatureWithPolymorphicPayloadMetaType'
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    86
	# M:/epoc32/include/comms-infras/ss_nodemessages.h:301: error: invalid type in declaration before ';' token
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    87
	
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    88
	if ($line =~ /(^...*):(\d+): ([^:]+): (.*)$/)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    89
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    90
		my $filename = $1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    91
		my $lineno = $2;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    92
		my $messagetype = $3;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    93
		my $message = $4;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    94
		
7
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    95
		# Heuristic for guessing the problem file for assembler issues
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    96
		# 
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    97
		if ($filename =~ /\\TEMP\\/i)
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    98
			{
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    99
			$filename = $saved_filename;
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   100
			$lineno = 0;
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   101
			}
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   102
		else
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   103
			{
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   104
			$saved_filename = $filename;
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   105
			}
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   106
		
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   107
		if ($messagetype eq "note")
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   108
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   109
			next;		# ignore notes
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   110
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   111
		if ($messagetype eq "warning" && !$warnings)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   112
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   113
			next;		# ignore warnings
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   114
			}
7
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   115
		if ($message =~ /.*: No such file/ && !$warnings)
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   116
			{
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   117
			next;		# ignore "no such file", as these aren't likely to be GCC-specific
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   118
			}
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   119
		
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   120
		$filename =~ s/^.://;		# remove drive letter
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   121
		
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   122
		$message =~ s/&amp;/&/g;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   123
		$message =~ s/&gt;/>/g;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   124
		$message =~ s/&lt;/</g;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   125
		$message =~ s/&#39;/'/g;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   126
		my $generic_message = "$messagetype: $message";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   127
		$generic_message =~ s/'offsetof'/"offsetof"/;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   128
		$generic_message =~ s/'([^a-zA-Z])'/"\1"/g;	# don't catch ';' in next substitution
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   129
		$generic_message =~ s/['`][^']+'/XX/g;	# suppress quoted bits of the actual instance
7
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   130
		$generic_message =~ s/pasting ""(.*)"" and ""(.*)""/pasting XX and YY/g;	# suppress detail of "pasting" error
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   131
		
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   132
		my $message_id = $next_message_id;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   133
		if (!defined $message_ids{$generic_message})
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   134
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   135
			$next_message_id++;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   136
			$message_ids{$generic_message} = $message_id;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   137
			$messages_by_id{$message_id} = $generic_message;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   138
			$all_message_counts{$message_id} = 1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   139
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   140
		else
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   141
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   142
			$message_id = $message_ids{$generic_message};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   143
			$all_message_counts{$message_id} += 1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   144
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   145
		my $instance = sprintf("%s:%d: %s-#%d", $filename, $lineno, $messagetype, $message_id);
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   146
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   147
		my $packages = $packages_by_file{$filename};
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   148
		if (!defined $packages)
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   149
			{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   150
			$packages_by_file{$filename} = "\t$current_package\t";
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   151
			$package_count_by_file{$filename} = 1;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   152
			}
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   153
		else
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   154
			{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   155
			if (index($packages,"\t$current_package\t") < 0)
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   156
				{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   157
				$packages_by_file{$filename} .= "\t$current_package\t";
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   158
				$package_count_by_file{$filename} += 1;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   159
				}
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   160
			}
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   161
		
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   162
		if (defined $files{$instance})
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   163
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   164
			# already seen this one
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   165
			next;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   166
			}
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   167
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   168
		if (!defined $unique_message_counts{$message_id})
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   169
			{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   170
			$unique_message_counts{$message_id} = 1;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   171
			}
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   172
		else
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   173
			{
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   174
			$unique_message_counts{$message_id} += 1;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   175
			}
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   176
		$files{$instance} = $message;
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   177
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   178
		if (!defined $files_by_message_id{$message_id})
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   179
			{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   180
			$files_by_message_id{$message_id} = $filename;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   181
			}
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   182
		else
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   183
			{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   184
			$files_by_message_id{$message_id} .= "\n$filename";
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   185
			}
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   186
				
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   187
		my $error = sprintf "%-5d: %s: %s", $lineno, $messagetype, $message;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   188
		if (!defined $errors_by_file{$filename})
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   189
			{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   190
			$errors_by_file{$filename} = $error;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   191
			$error_count_by_file{$filename} = 1;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   192
			}
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   193
		else
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   194
			{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   195
			$errors_by_file{$filename} .= "\n$error";
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   196
			$error_count_by_file{$filename} += 1;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   197
			}
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   198
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   199
		next;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   200
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   201
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   202
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   203
# clean up the file lists
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   204
my %filecount_by_message_id;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   205
foreach my $id (keys %files_by_message_id)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   206
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   207
	my @longlist = split /\n/, $files_by_message_id{$id};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   208
	my %uniq;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   209
	foreach my $file (@longlist)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   210
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   211
		$uniq{$file} = 1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   212
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   213
	my $uniqlist = join( "\n\t", sort keys %uniq);
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   214
	$files_by_message_id{$id} = $uniqlist;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   215
	$filecount_by_message_id{$id} = scalar keys %uniq;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   216
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   217
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   218
print "\n\n====Occurrences of messages (distinct, all)\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   219
foreach my $id ( sort {$unique_message_counts{$b} <=> $unique_message_counts{$a}} keys %unique_message_counts)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   220
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   221
	printf "%-6d\t%-6d\t%s\n", $unique_message_counts{$id}, $all_message_counts{$id}, $messages_by_id{$id};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   222
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   223
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   224
print "\n\n====Files affected per message\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   225
foreach my $id ( sort {$filecount_by_message_id{$b} <=> $filecount_by_message_id{$a}} keys %filecount_by_message_id)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   226
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   227
	printf "%-6d\t%s\n", $filecount_by_message_id{$id}, $messages_by_id{$id};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   228
	if ($verbose)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   229
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   230
		print "\t", $files_by_message_id{$id};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   231
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   232
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   233
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   234
print "\n\n====Packages impacted (if > 1)\n";
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   235
foreach my $file ( sort {$package_count_by_file{$b} <=> $package_count_by_file{$a}} keys %package_count_by_file)
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   236
	{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   237
	if ($package_count_by_file{$file} < 2)
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   238
		{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   239
		next;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   240
		}
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   241
	my ($empty,@packages) = split /\t+/, $packages_by_file{$file};
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   242
	printf "%-6d\t%s\n\t(%s)\n",$package_count_by_file{$file}, $file, join(", ", @packages);
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   243
	}
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   244
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   245
print "\n\n====Affected files by package\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   246
my $current_package = "";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   247
my @currentfiles;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   248
foreach my $file (sort keys %error_count_by_file)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   249
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   250
	my ($root, $sf, $layer, $packagename, @rest) = split /[\/\\]/, $file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   251
	my $package = "$sf/$layer/$packagename";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   252
	if ($layer eq "include")
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   253
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   254
		$package = "$sf/$layer";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   255
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   256
	if ($package ne $current_package)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   257
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   258
		if ($current_package ne "")
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   259
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   260
			printf "%-6d\t%s\n", scalar @currentfiles, $current_package;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   261
			print join("\n",@currentfiles);
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   262
			print "\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   263
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   264
		$current_package = $package;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   265
		@currentfiles = ();
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   266
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   267
	my $filedetails = sprintf "\t%-6d\t%s", $error_count_by_file{$file}, $file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   268
	push @currentfiles, $filedetails;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   269
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   270
printf "%-6d\t%s\n", scalar @currentfiles, $current_package;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   271
print join("\n",@currentfiles);
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   272
print "\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   273
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   274
print "\n\n====Messages by file\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   275
foreach my $file ( sort keys %error_count_by_file)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   276
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   277
	my @details = split "\n", $errors_by_file{$file};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   278
	printf "%-6d\t%s\n\t", $error_count_by_file{$file}, $file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   279
	print join("\n\t", @details);
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   280
	print "\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   281
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   282