Add heuristic for guessing the source file associated with assembler errors
authorWilliam Roberts <williamr@symbian.org>
Mon, 14 Jun 2010 15:47:21 +0100
changeset 7 8c4a7869f673
parent 6 2618a0f10e3e
child 8 c38b26fd0c68
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.
tools/summarise_gcc_errors.pl
--- a/tools/summarise_gcc_errors.pl	Wed Apr 14 09:46:27 2010 +0100
+++ b/tools/summarise_gcc_errors.pl	Mon Jun 14 15:47:21 2010 +0100
@@ -51,6 +51,7 @@
   }
 
 my $current_package = ""; 
+my $saved_filename = "";
 my %files;
 my %errors_by_file;
 my %error_count_by_file;
@@ -91,6 +92,18 @@
 		my $messagetype = $3;
 		my $message = $4;
 		
+		# Heuristic for guessing the problem file for assembler issues
+		# 
+		if ($filename =~ /\\TEMP\\/i)
+			{
+			$filename = $saved_filename;
+			$lineno = 0;
+			}
+		else
+			{
+			$saved_filename = $filename;
+			}
+		
 		if ($messagetype eq "note")
 			{
 			next;		# ignore notes
@@ -99,6 +112,10 @@
 			{
 			next;		# ignore warnings
 			}
+		if ($message =~ /.*: No such file/ && !$warnings)
+			{
+			next;		# ignore "no such file", as these aren't likely to be GCC-specific
+			}
 		
 		$filename =~ s/^.://;		# remove drive letter
 		
@@ -110,6 +127,7 @@
 		$generic_message =~ s/'offsetof'/"offsetof"/;
 		$generic_message =~ s/'([^a-zA-Z])'/"\1"/g;	# don't catch ';' in next substitution
 		$generic_message =~ s/['`][^']+'/XX/g;	# suppress quoted bits of the actual instance
+		$generic_message =~ s/pasting ""(.*)"" and ""(.*)""/pasting XX and YY/g;	# suppress detail of "pasting" error
 		
 		my $message_id = $next_message_id;
 		if (!defined $message_ids{$generic_message})