diff --git a/compiler/comphook.pas b/compiler/comphook.pas index 1bbcb8df13..288902b044 100644 --- a/compiler/comphook.pas +++ b/compiler/comphook.pas @@ -72,6 +72,8 @@ type TCompilerStatus = record { Current status } currentmodule, + currentsourceppufilename, { the name of the ppu where the source file + comes from where the error location is given } currentsourcepath, currentsource : string; { filename } currentline, @@ -104,6 +106,7 @@ type use_redir, use_bugreport, use_gccoutput, + sources_avail, print_source_path : boolean; { Redirection support } redirfile : text; @@ -310,7 +313,10 @@ begin ','+tostr(status.currentcolumn)+') '+hs+' '+s; end; if status.print_source_path then - hs:=status.currentsourcepath+hs; + if status.sources_avail then + hs:=status.currentsourcepath+hs + else + hs:=status.currentsourceppufilename+':'+hs; end else begin diff --git a/compiler/verbose.pas b/compiler/verbose.pas index 67c1a6b242..74cc416d24 100644 --- a/compiler/verbose.pas +++ b/compiler/verbose.pas @@ -451,15 +451,13 @@ implementation begin { update status record } status.currentmodule:=module.modulename^; + status.currentsourceppufilename:=module.ppufilename; status.currentmodulestate:=ModuleStateStr[module.state]; status.currentsource:=module.sourcefiles.get_file_name(current_filepos.fileindex); status.currentsourcepath:=module.sourcefiles.get_file_path(current_filepos.fileindex); - { if sources are not available, construct a prefix from the - ppu file name } - if not(module.sources_avail) then - status.currentsourcepath:=module.ppufilename+':' + status.sources_avail:=module.sources_avail; { if currentsourcepath is relative, make it absolute } - else if not path_absolute(status.currentsourcepath) then + if not path_absolute(status.currentsourcepath) then status.currentsourcepath:=GetCurrentDir+status.currentsourcepath; { update lastfileidx only if name known PM } @@ -1002,6 +1000,7 @@ implementation lastfileidx:=-1; lastmoduleidx:=-1; status.currentmodule:=''; + status.currentsourceppufilename:=''; status.currentsource:=''; status.currentsourcepath:=''; { Register internalerrorproc for cutils/cclasses }