+ don't abuse status.currentsourcepath to pass on PPU names if the source is unavailable, causes side effects with other frontends (like the IDE). Improved solution for Mantis #27588

git-svn-id: trunk@30373 -
This commit is contained in:
Károly Balogh 2015-03-29 19:05:19 +00:00
parent ad995eb121
commit 72e1443081
2 changed files with 11 additions and 6 deletions

View File

@ -72,6 +72,8 @@ type
TCompilerStatus = record TCompilerStatus = record
{ Current status } { Current status }
currentmodule, currentmodule,
currentsourceppufilename, { the name of the ppu where the source file
comes from where the error location is given }
currentsourcepath, currentsourcepath,
currentsource : string; { filename } currentsource : string; { filename }
currentline, currentline,
@ -104,6 +106,7 @@ type
use_redir, use_redir,
use_bugreport, use_bugreport,
use_gccoutput, use_gccoutput,
sources_avail,
print_source_path : boolean; print_source_path : boolean;
{ Redirection support } { Redirection support }
redirfile : text; redirfile : text;
@ -310,7 +313,10 @@ begin
','+tostr(status.currentcolumn)+') '+hs+' '+s; ','+tostr(status.currentcolumn)+') '+hs+' '+s;
end; end;
if status.print_source_path then 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 end
else else
begin begin

View File

@ -451,15 +451,13 @@ implementation
begin begin
{ update status record } { update status record }
status.currentmodule:=module.modulename^; status.currentmodule:=module.modulename^;
status.currentsourceppufilename:=module.ppufilename;
status.currentmodulestate:=ModuleStateStr[module.state]; status.currentmodulestate:=ModuleStateStr[module.state];
status.currentsource:=module.sourcefiles.get_file_name(current_filepos.fileindex); status.currentsource:=module.sourcefiles.get_file_name(current_filepos.fileindex);
status.currentsourcepath:=module.sourcefiles.get_file_path(current_filepos.fileindex); status.currentsourcepath:=module.sourcefiles.get_file_path(current_filepos.fileindex);
{ if sources are not available, construct a prefix from the status.sources_avail:=module.sources_avail;
ppu file name }
if not(module.sources_avail) then
status.currentsourcepath:=module.ppufilename+':'
{ if currentsourcepath is relative, make it absolute } { 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; status.currentsourcepath:=GetCurrentDir+status.currentsourcepath;
{ update lastfileidx only if name known PM } { update lastfileidx only if name known PM }
@ -1002,6 +1000,7 @@ implementation
lastfileidx:=-1; lastfileidx:=-1;
lastmoduleidx:=-1; lastmoduleidx:=-1;
status.currentmodule:=''; status.currentmodule:='';
status.currentsourceppufilename:='';
status.currentsource:=''; status.currentsource:='';
status.currentsourcepath:=''; status.currentsourcepath:='';
{ Register internalerrorproc for cutils/cclasses } { Register internalerrorproc for cutils/cclasses }