summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/fmodule.pas20
-rw-r--r--compiler/globals.pas2
-rw-r--r--compiler/scanner.pas1
-rw-r--r--compiler/symtype.pas5
-rw-r--r--compiler/verbose.pas27
5 files changed, 39 insertions, 16 deletions
diff --git a/compiler/fmodule.pas b/compiler/fmodule.pas
index 8a5cd9abcc..c2f3e2bfea 100644
--- a/compiler/fmodule.pas
+++ b/compiler/fmodule.pas
@@ -195,6 +195,7 @@ interface
SmartLinkOFiles : TStringList; { List of .o files which are generated,
used to delete them after linking }
+ function get_module(moduleindex : longint) : tmodule;
function get_source_file(moduleindex,fileindex : longint) : tinputfile;
procedure addloadedunit(hp:tmodule);
@@ -217,13 +218,28 @@ implementation
Global Functions
*****************************************************************************}
- function get_source_file(moduleindex,fileindex : longint) : tinputfile;
+ function get_module(moduleindex : longint) : tmodule;
var
hp : tmodule;
begin
+ result:=nil;
+ if moduleindex=0 then
+ exit;
+ result:=current_module;
+ if not(assigned(loaded_units)) then
+ exit;
hp:=tmodule(loaded_units.first);
while assigned(hp) and (hp.unit_index<>moduleindex) do
hp:=tmodule(hp.next);
+ result:=hp;
+ end;
+
+
+ function get_source_file(moduleindex,fileindex : longint) : tinputfile;
+ var
+ hp : tmodule;
+ begin
+ hp:=get_module(moduleindex);
if assigned(hp) then
get_source_file:=hp.sourcefiles.get_file(fileindex)
else
@@ -585,7 +601,7 @@ implementation
localmacrosymtable.free;
localmacrosymtable:=nil;
end;
- deflist.free;
+ deflist.free;
deflist:=TFPObjectList.Create(false);
symlist.free;
symlist:=TFPObjectList.Create(false);
diff --git a/compiler/globals.pas b/compiler/globals.pas
index e598da8e82..4064ccfd0a 100644
--- a/compiler/globals.pas
+++ b/compiler/globals.pas
@@ -111,7 +111,7 @@ interface
line : longint;
column : word;
fileindex : word;
- { moduleindex : word; }
+ moduleindex : word;
end;
tcodepagestring = string[20];
diff --git a/compiler/scanner.pas b/compiler/scanner.pas
index d4c067704a..6445fc07b9 100644
--- a/compiler/scanner.pas
+++ b/compiler/scanner.pas
@@ -2085,6 +2085,7 @@ In case not, the value returned can be arbitrary.
akttokenpos.line:=line_no;
akttokenpos.column:=lasttokenpos-lastlinepos;
akttokenpos.fileindex:=inputfile.ref_index;
+ akttokenpos.moduleindex:=current_module.unit_index;
aktfilepos:=akttokenpos;
end;
diff --git a/compiler/symtype.pas b/compiler/symtype.pas
index 86b25891f3..0191220098 100644
--- a/compiler/symtype.pas
+++ b/compiler/symtype.pas
@@ -625,8 +625,8 @@ implementation
addconst(slt,v,nil);
lastsym^.valuedefderef:=d;
end;
-
-
+
+
procedure tpropaccesslist.addtypederef(slt:tsltype;d:tderef);
begin
addtype(slt,nil);
@@ -879,6 +879,7 @@ implementation
2 : p.column:=(getbyte shl 16) or getword;
3 : p.column:=getlongint;
end;
+ p.moduleindex:=current_module.unit_index;
end;
diff --git a/compiler/verbose.pas b/compiler/verbose.pas
index 4ebf147605..e409ec87ab 100644
--- a/compiler/verbose.pas
+++ b/compiler/verbose.pas
@@ -118,7 +118,7 @@ interface
implementation
uses
- comphook;
+ comphook,fmodule;
var
compiling_module : tmodulebase;
@@ -362,23 +362,28 @@ var
end;
- var
- lastfileidx,
- lastmoduleidx : longint;
+ var
+ lastfileidx,
+ lastmoduleidx : longint;
+
+
Procedure UpdateStatus;
+ var
+ module : tmodulebase;
begin
{ fix status }
status.currentline:=aktfilepos.line;
status.currentcolumn:=aktfilepos.column;
- if assigned(compiling_module) and
- assigned(compiling_module.sourcefiles) and
- ((compiling_module.unit_index<>lastmoduleidx) or
+ module:=get_module(aktfilepos.moduleindex);
+ if assigned(module) and
+ assigned(module.sourcefiles) and
+ ((module.unit_index<>lastmoduleidx) or
(aktfilepos.fileindex<>lastfileidx)) then
begin
{ update status record }
- status.currentmodule:=compiling_module.modulename^;
- status.currentsource:=compiling_module.sourcefiles.get_file_name(aktfilepos.fileindex);
- status.currentsourcepath:=compiling_module.sourcefiles.get_file_path(aktfilepos.fileindex);
+ status.currentmodule:=module.modulename^;
+ status.currentsource:=module.sourcefiles.get_file_name(aktfilepos.fileindex);
+ status.currentsourcepath:=module.sourcefiles.get_file_path(aktfilepos.fileindex);
{ update lastfileidx only if name known PM }
if status.currentsource<>'' then
lastfileidx:=aktfilepos.fileindex
@@ -386,7 +391,7 @@ var
lastfileidx:=0;
lastmoduleidx:=compiling_module.unit_index;
end;
- if assigned(compiling_module) then
+ if assigned(module) then
status.compiling_current:=(compiling_module.state in [ms_compile,ms_second_compile]);
end;