Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Double dot .. in Delphi Map file

I have been inspecting Delphi generated Map files and I found one strange thing there. Identifiers delimited with double dots instead single one.

For instance MapFile..TFoo taken from simple example

program MapFile;

{$APPTYPE CONSOLE}

{$R *.res}

type
  TFoo = class(TObject)
  public
    function GetFoo: string;
  end;

function TFoo.GetFoo: string;
begin
  Result := 'foo';
end;

var
  foo: TFoo;

begin
  foo := TFoo.Create;
  writeln(foo.GetFoo);
  foo.Free;
end.

and its publics map file

  Address             Publics by Name

 0001:00005AC8       MapFile..TFoo
 0001:00005BBC       MapFile.Finalization
 0004:00002BA0       MapFile.foo
 0002:000000BC       MapFile.MapFile
 0001:00005B88       MapFile.TFoo.GetFoo
 0001:000059D0       SysInit...
 0001:000059C0       SysInit...
 0001:00005AA8       SysInit...
 0001:000059B0       SysInit...
 0001:00005A98       SysInit...
 0001:00005A74       SysInit...
 0003:000007D8       SysInit...
 0001:000059A0       SysInit...
 0001:000059E0       SysInit...
 0001:000059F0       SysInit...
 0001:00005A04       SysInit...
 0001:00005A34       SysInit...
 0001:00005A4C       SysInit...
 0004:00002B98       SysInit..1

My best guess is that MapFile..TFoo is a class, but why double dots? And what is then SysInit..1 As far as I know Delphi does not have anonymous classes.

like image 696
Dalija Prasnikar Avatar asked Apr 07 '16 09:04

Dalija Prasnikar


1 Answers

The ".." entries are references to the class-type or more correctly, the VMT for the class. A symbol is generated because the linker needs to identify it when linking together v-table ancestry and for linking run-time type information.

The compiler generates symbols which cannot ever be generated by the user's code. This ensures that the symbols are always unique and will never collide. Even temporary variables get a special name and an entry in the symbol table. They are actively skipped or ignored by the mapfile/debug info generation, but they are there.

like image 136
Allen Bauer Avatar answered Nov 05 '22 21:11

Allen Bauer