diff options
author | pierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2013-01-16 09:45:57 +0000 |
---|---|---|
committer | pierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2013-01-16 09:45:57 +0000 |
commit | 6b57e4e29816a20ec7e5b8d51438b5a39bf4e8ec (patch) | |
tree | 0b85f307f82a04945252015b0cb5e0be62617c4b | |
parent | a80476e7a6cabdd0359b78fe8d9c01485f3d3272 (diff) | |
download | fpc-6b57e4e29816a20ec7e5b8d51438b5a39bf4e8ec.tar.gz |
Increase status.errorcount only inside GenerateError procedure, to simplify debugging
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23398 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r-- | compiler/comphook.pas | 5 | ||||
-rw-r--r-- | compiler/parser.pas | 5 | ||||
-rw-r--r-- | compiler/verbose.pas | 14 |
3 files changed, 14 insertions, 10 deletions
diff --git a/compiler/comphook.pas b/compiler/comphook.pas index b7183d6a13..1bbcb8df13 100644 --- a/compiler/comphook.pas +++ b/compiler/comphook.pas @@ -79,7 +79,10 @@ type currentmodulestate : string[20]; { Total Status } compiledlines : longint; { the number of lines which are compiled } - errorcount, + errorcount, { this field should never be increased directly, + use Verbose.GenerateError procedure to do this, + this allows easier error catching using GDB by + adding a single breakpoint at this procedure } countWarnings, countNotes, countHints : longint; { number of found errors/warnings/notes/hints } diff --git a/compiler/parser.pas b/compiler/parser.pas index 7a14e23bb6..ae0301371d 100644 --- a/compiler/parser.pas +++ b/compiler/parser.pas @@ -359,8 +359,9 @@ implementation on Exception do begin { Increase errorcounter to prevent some - checks during cleanup } - inc(status.errorcount); + checks during cleanup, + but use GenerateError procedure for this. } + GenerateError; raise; end; end; diff --git a/compiler/verbose.pas b/compiler/verbose.pas index 9fb233e797..f38af4aabd 100644 --- a/compiler/verbose.pas +++ b/compiler/verbose.pas @@ -569,7 +569,7 @@ implementation begin UpdateStatus; do_internalerror(i); - inc(status.errorcount); + GenerateError; raise ECompilerAbort.Create; end; @@ -584,7 +584,7 @@ implementation (status.errorwarning and ((l and V_Warning)<>0)) or (status.errornote and ((l and V_Note)<>0)) or (status.errorhint and ((l and V_Hint)<>0)) then - inc(status.errorcount) + GenerateError else if l and V_Warning <> 0 then inc(status.countWarnings) @@ -652,7 +652,7 @@ implementation 'F' : begin v:=v or V_Fatal; - inc(status.errorcount); + GenerateError; dostop:=true; end; 'E','W','N','H': @@ -666,7 +666,7 @@ implementation if st=ms_error then begin v:=v or V_Error; - inc(status.errorcount); + GenerateError; end else if st<>ms_off then case ch of @@ -675,7 +675,7 @@ implementation v:=v or V_Warning; if CheckVerbosity(V_Warning) then if status.errorwarning then - inc(status.errorcount) + GenerateError else inc(status.countWarnings); end; @@ -684,7 +684,7 @@ implementation v:=v or V_Note; if CheckVerbosity(V_Note) then if status.errornote then - inc(status.errorcount) + GenerateError else inc(status.countNotes); end; @@ -693,7 +693,7 @@ implementation v:=v or V_Hint; if CheckVerbosity(V_Hint) then if status.errorhint then - inc(status.errorcount) + GenerateError else inc(status.countHints); end; |