소스 검색

* basic framework for debuginfo class added

git-svn-id: trunk@1084 -
peter 20 년 전
부모
커밋
fdc4925fcd

+ 3 - 0
.gitattributes

@@ -93,6 +93,9 @@ compiler/crc.pas svneol=native#text/plain
 compiler/cresstr.pas svneol=native#text/plain
 compiler/cresstr.pas svneol=native#text/plain
 compiler/cstreams.pas svneol=native#text/plain
 compiler/cstreams.pas svneol=native#text/plain
 compiler/cutils.pas svneol=native#text/plain
 compiler/cutils.pas svneol=native#text/plain
+compiler/dbgbase.pas svneol=native#text/plain
+compiler/dbgdwarf.pas svneol=native#text/plain
+compiler/dbgstabs.pas svneol=native#text/plain
 compiler/defcmp.pas svneol=native#text/plain
 compiler/defcmp.pas svneol=native#text/plain
 compiler/defutil.pas svneol=native#text/plain
 compiler/defutil.pas svneol=native#text/plain
 compiler/dwarf.pas svneol=native#text/plain
 compiler/dwarf.pas svneol=native#text/plain

+ 19 - 0
compiler/arm/cputarg.pas

@@ -54,6 +54,25 @@ implementation
     {$endif}
     {$endif}
 
 
       ,ogcoff
       ,ogcoff
+
+{**************************************
+        Assembler Readers
+**************************************}
+
+  {$ifndef NoRaarmgas}
+       ,raarmgas
+  {$endif NoRaarmgas}
+
+{**************************************
+             Debuginfo
+**************************************}
+
+  {$ifndef NoDbgStabs}
+      ,dbgstabs
+  {$endif NoDbgStabs}
+  {$ifndef NoDbgDwarf}
+      ,dbgdwarf
+  {$endif NoDbgDwarf}
       ;
       ;
 
 
 end.
 end.

+ 9 - 30
compiler/compiler.pas

@@ -1,7 +1,7 @@
 {
 {
     This unit is the interface of the compiler which can be used by
     This unit is the interface of the compiler which can be used by
     external programs to link in the compiler
     external programs to link in the compiler
-    
+
     Copyright (c) 1998-2005 by Florian Klaempfl
     Copyright (c) 1998-2005 by Florian Klaempfl
 
 
     This program is free software; you can redistribute it and/or modify
     This program is free software; you can redistribute it and/or modify
@@ -141,9 +141,13 @@ uses
 {$ENDIF MACOS_USE_FAKE_SYSUTILS}
 {$ENDIF MACOS_USE_FAKE_SYSUTILS}
   verbose,comphook,systems,
   verbose,comphook,systems,
   cutils,cclasses,globals,options,fmodule,parser,symtable,
   cutils,cclasses,globals,options,fmodule,parser,symtable,
-  assemble,link,import,export,tokens,pass_1
-  { cpu overrides }
+  assemble,link,dbgbase,import,export,tokens,pass_1
+  { cpu specific commandline options }
   ,cpuswtch
   ,cpuswtch
+  { cpu parameter handling }
+  ,cpupara
+  { procinfo stuff }
+  ,cpupi
   { cpu codegenerator }
   { cpu codegenerator }
   ,cgcpu
   ,cgcpu
 {$ifndef NOPASS2}
 {$ifndef NOPASS2}
@@ -151,10 +155,6 @@ uses
 {$endif}
 {$endif}
   { cpu targets }
   { cpu targets }
   ,cputarg
   ,cputarg
-  { cpu parameter handling }
-  ,cpupara
-  { procinfo stuff }
-  ,cpupi
   { system information for source system }
   { system information for source system }
   { the information about the target os  }
   { the information about the target os  }
   { are pulled in by the t_* units       }
   { are pulled in by the t_* units       }
@@ -207,29 +207,6 @@ uses
 {$ifdef win32}
 {$ifdef win32}
   ,i_win
   ,i_win
 {$endif win32}
 {$endif win32}
-  { assembler readers }
-{$ifdef i386}
-  {$ifndef NoRa386Int}
-       ,ra386int
-  {$endif NoRa386Int}
-  {$ifndef NoRa386Att}
-       ,ra386att
-  {$endif NoRa386Att}
-{$else}
-  ,rasm
-{$endif i386}
-{$ifdef powerpc}
-  ,rappcgas
-{$endif powerpc}
-{$ifdef x86_64}
-  ,rax64att
-{$endif x86_64}
-{$ifdef arm}
-  ,raarmgas
-{$endif arm}
-{$ifdef SPARC}
-  ,racpugas
-{$endif SPARC}
   ;
   ;
 
 
 function Compile(const cmd:string):longint;
 function Compile(const cmd:string):longint;
@@ -273,6 +250,7 @@ begin
      DoneParser;
      DoneParser;
      DoneImport;
      DoneImport;
      DoneExport;
      DoneExport;
+     DoneDebuginfo;
      DoneLinker;
      DoneLinker;
      DoneAssembler;
      DoneAssembler;
      DoneAsm;
      DoneAsm;
@@ -316,6 +294,7 @@ begin
   InitExport;
   InitExport;
   InitLinker;
   InitLinker;
   InitAssembler;
   InitAssembler;
+  InitDebugInfo;
   InitAsm;
   InitAsm;
   CompilerInitedAfterArgs:=true;
   CompilerInitedAfterArgs:=true;
 end;
 end;

+ 84 - 0
compiler/dbgbase.pas

@@ -0,0 +1,84 @@
+{
+    Copyright (c) 2003-2004 by Peter Vreman and Florian Klaempfl
+
+    This units contains support for debug info generation
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************
+}
+unit dbgbase;
+
+{$i fpcdefs.inc}
+
+interface
+
+    uses
+      systems;
+
+    type
+      TDebugInfo=class
+      end;
+      TDebugInfoClass=class of TDebugInfo;
+
+    var
+      CDebugInfo : array[tdbg] of TDebugInfoClass;
+      DebugInfo  : TDebugInfo;
+
+    procedure InitDebugInfo;
+    procedure DoneDebugInfo;
+    procedure RegisterDebugInfo(const r:tdbginfo;c:TDebugInfoClass);
+
+
+implementation
+
+    uses
+      verbose;
+
+    procedure InitDebugInfo;
+      begin
+        if not assigned(CDebugInfo[target_dbg.id]) then
+          begin
+            Comment(V_Fatal,'cg_f_debuginfo_output_not_supported');
+            exit;
+          end;
+        DebugInfo:=CDebugInfo[target_dbg.id].Create;
+      end;
+
+
+    procedure DoneDebugInfo;
+      begin
+        if assigned(DebugInfo) then
+          begin
+            DebugInfo.Free;
+            DebugInfo:=nil;
+          end;
+      end;
+
+
+    procedure RegisterDebugInfo(const r:tdbginfo;c:TDebugInfoClass);
+      var
+        t : tdbg;
+      begin
+        t:=r.id;
+        if assigned(dbginfos[t]) then
+          writeln('Warning: DebugInfo is already registered!')
+        else
+          Getmem(dbginfos[t],sizeof(tdbginfo));
+        dbginfos[t]^:=r;
+        CDebugInfo[t]:=c;
+      end;
+
+end.

+ 49 - 0
compiler/dbgdwarf.pas

@@ -0,0 +1,49 @@
+{
+    Copyright (c) 2003-2004 by Peter Vreman and Florian Klaempfl
+
+    This units contains support for DWARF debug info generation
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************
+}
+unit dbgdwarf;
+
+{$i fpcdefs.inc}
+
+interface
+
+    uses
+      DbgBase;
+
+    type
+      TDebugInfoDwarf=class(TDebugInfo)
+      end;
+
+implementation
+
+    uses
+      Systems;
+
+    const
+      dbg_dwarf_info : tdbginfo =
+         (
+           id     : dbg_dwarf;
+           idtxt  : 'DWARF';
+         );
+
+initialization
+  RegisterDebugInfo(dbg_dwarf_info,TDebugInfoDwarf);
+end.

+ 49 - 0
compiler/dbgstabs.pas

@@ -0,0 +1,49 @@
+{
+    Copyright (c) 2003-2004 by Peter Vreman and Florian Klaempfl
+
+    This units contains support for STABS debug info generation
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************
+}
+unit dbgstabs;
+
+{$i fpcdefs.inc}
+
+interface
+
+    uses
+      DbgBase;
+
+    type
+      TDebugInfoStabs=class(TDebugInfo)
+      end;
+
+implementation
+
+    uses
+      Systems;
+
+    const
+      dbg_stabs_info : tdbginfo =
+         (
+           id     : dbg_stabs;
+           idtxt  : 'STABS';
+         );
+
+initialization
+  RegisterDebugInfo(dbg_stabs_info,TDebugInfoStabs);
+end.

+ 23 - 0
compiler/i386/cputarg.pas

@@ -88,6 +88,29 @@ implementation
 
 
       ,ogcoff
       ,ogcoff
       ,ogelf
       ,ogelf
+
+{**************************************
+        Assembler Readers
+**************************************}
+
+  {$ifndef NoRa386Int}
+       ,ra386int
+  {$endif NoRa386Int}
+  {$ifndef NoRa386Att}
+       ,ra386att
+  {$endif NoRa386Att}
+
+{**************************************
+             Debuginfo
+**************************************}
+
+  {$ifndef NoDbgStabs}
+      ,dbgstabs
+  {$endif NoDbgStabs}
+  {$ifndef NoDbgDwarf}
+      ,dbgdwarf
+  {$endif NoDbgDwarf}
+
       ;
       ;
 
 
 end.
 end.

+ 1 - 1
compiler/pmodules.pas

@@ -39,7 +39,7 @@ implementation
        aasmtai,aasmcpu,aasmbase,
        aasmtai,aasmcpu,aasmbase,
        cgbase,cgobj,
        cgbase,cgobj,
        nbas,ncgutil,
        nbas,ncgutil,
-       link,assemble,import,export,gendef,ppu,comprsrc,
+       link,assemble,import,export,gendef,ppu,comprsrc,dbgbase,
        cresstr,procinfo,
        cresstr,procinfo,
        dwarf,pexports,
        dwarf,pexports,
 {$ifdef GDB}
 {$ifdef GDB}

+ 20 - 2
compiler/powerpc/cputarg.pas

@@ -58,8 +58,26 @@ implementation
     {$ifndef NOAGPPPCMPW}
     {$ifndef NOAGPPPCMPW}
       ,agppcmpw
       ,agppcmpw
     {$endif}
     {$endif}
-    
-    
+
+{**************************************
+        Assembler Readers
+**************************************}
+
+  {$ifndef NoRaPPCGas}
+       ,rappcgas
+  {$endif NoRaPPCGas}
+
+{**************************************
+             Debuginfo
+**************************************}
+
+  {$ifndef NoDbgStabs}
+      ,dbgstabs
+  {$endif NoDbgStabs}
+  {$ifndef NoDbgDwarf}
+      ,dbgdwarf
+  {$endif NoDbgDwarf}
+
 {**************************************
 {**************************************
              Optimizer
              Optimizer
 **************************************}
 **************************************}

+ 19 - 0
compiler/sparc/cputarg.pas

@@ -52,6 +52,25 @@ implementation
 
 
       ,CpuGas
       ,CpuGas
 
 
+{**************************************
+        Assembler Readers
+**************************************}
+
+  {$ifndef NoSparcgas}
+       ,racpugas
+  {$endif NoSparcgas}
+
+{**************************************
+             Debuginfo
+**************************************}
+
+  {$ifndef NoDbgStabs}
+      ,dbgstabs
+  {$endif NoDbgStabs}
+  {$ifndef NoDbgDwarf}
+      ,dbgdwarf
+  {$endif NoDbgDwarf}
+
       ;
       ;
 
 
 end.
 end.

+ 53 - 10
compiler/systems.pas

@@ -157,6 +157,10 @@ interface
             ,res_gnu_wince_windres
             ,res_gnu_wince_windres
        );
        );
 
 
+       tdbg = (dbg_none
+            ,dbg_stabs,dbg_dwarf
+       );
+
        tscripttype = (script_none
        tscripttype = (script_none
             ,script_dos,script_unix,script_amiga,
             ,script_dos,script_unix,script_amiga,
             script_mpw
             script_mpw
@@ -233,6 +237,12 @@ interface
           rescmd  : string[50];
           rescmd  : string[50];
        end;
        end;
 
 
+       pdbginfo = ^tdbginfo;
+       tdbginfo = record
+          id      : tdbg;
+          idtxt   : string[12];
+       end;
+
        tsystemflags = (tf_none,
        tsystemflags = (tf_none,
             tf_under_development,
             tf_under_development,
             tf_need_export,tf_needs_isconsole,
             tf_need_export,tf_needs_isconsole,
@@ -284,6 +294,7 @@ interface
           linkextern   : tabstractlinkerclass;  { external linker, used by -s }
           linkextern   : tabstractlinkerclass;  { external linker, used by -s }
           ar           : tar;
           ar           : tar;
           res          : tres;
           res          : tres;
+          dbg          : tdbg;
           script       : tscripttype;
           script       : tscripttype;
           endian       : tendian;
           endian       : tendian;
           alignment    : talignmentinfo;
           alignment    : talignmentinfo;
@@ -320,6 +331,7 @@ interface
        arinfos       : array[tar] of parinfo;
        arinfos       : array[tar] of parinfo;
        resinfos      : array[tres] of presinfo;
        resinfos      : array[tres] of presinfo;
        asminfos      : array[tasm] of pasminfo;
        asminfos      : array[tasm] of pasminfo;
+       dbginfos      : array[tdbg] of pdbginfo;
 
 
        source_info : tsysteminfo;
        source_info : tsysteminfo;
        target_cpu  : tsystemcpu;
        target_cpu  : tsystemcpu;
@@ -327,6 +339,7 @@ interface
        target_asm  : tasminfo;
        target_asm  : tasminfo;
        target_ar   : tarinfo;
        target_ar   : tarinfo;
        target_res  : tresinfo;
        target_res  : tresinfo;
+       target_dbg  : tdbginfo;
        target_cpu_string,
        target_cpu_string,
        target_os_string   : string[12]; { for rtl/<X>/,fcl/<X>/, etc. }
        target_os_string   : string[12]; { for rtl/<X>/,fcl/<X>/, etc. }
        target_full_string : string[24];
        target_full_string : string[24];
@@ -335,9 +348,11 @@ interface
     function set_target_asm(t:tasm):boolean;
     function set_target_asm(t:tasm):boolean;
     function set_target_ar(t:tar):boolean;
     function set_target_ar(t:tar):boolean;
     function set_target_res(t:tres):boolean;
     function set_target_res(t:tres):boolean;
+    function set_target_dbg(t:tdbg):boolean;
 
 
     function set_target_by_string(const s : string) : boolean;
     function set_target_by_string(const s : string) : boolean;
     function set_target_asm_by_string(const s : string) : boolean;
     function set_target_asm_by_string(const s : string) : boolean;
+    function set_target_dbg_by_string(const s : string) : boolean;
 
 
     procedure set_source_info(const ti : tsysteminfo);
     procedure set_source_info(const ti : tsysteminfo);
 
 
@@ -419,6 +434,7 @@ begin
      set_target_asm(target_info.assem);
      set_target_asm(target_info.assem);
      set_target_ar(target_info.ar);
      set_target_ar(target_info.ar);
      set_target_res(target_info.res);
      set_target_res(target_info.res);
+     set_target_dbg(target_info.dbg);
      target_cpu:=target_info.cpu;
      target_cpu:=target_info.cpu;
      target_os_string:=lower(target_info.shortname);
      target_os_string:=lower(target_info.shortname);
      target_cpu_string:=cpu2str[target_cpu];
      target_cpu_string:=cpu2str[target_cpu];
@@ -445,11 +461,11 @@ end;
 
 
 function set_target_ar(t:tar):boolean;
 function set_target_ar(t:tar):boolean;
 begin
 begin
-  set_target_ar:=false;
+  result:=false;
   if assigned(arinfos[t]) then
   if assigned(arinfos[t]) then
    begin
    begin
      target_ar:=arinfos[t]^;
      target_ar:=arinfos[t]^;
-     set_target_ar:=true;
+     result:=true;
      exit;
      exit;
    end;
    end;
 end;
 end;
@@ -457,11 +473,23 @@ end;
 
 
 function set_target_res(t:tres):boolean;
 function set_target_res(t:tres):boolean;
 begin
 begin
-  set_target_res:=false;
+  result:=false;
   if assigned(resinfos[t]) then
   if assigned(resinfos[t]) then
    begin
    begin
      target_res:=resinfos[t]^;
      target_res:=resinfos[t]^;
-     set_target_res:=true;
+     result:=true;
+     exit;
+   end;
+end;
+
+
+function set_target_dbg(t:tdbg):boolean;
+begin
+  result:=false;
+  if assigned(dbginfos[t]) then
+   begin
+     target_dbg:=dbginfos[t]^;
+     result:=true;
      exit;
      exit;
    end;
    end;
 end;
 end;
@@ -472,14 +500,13 @@ var
   hs : string;
   hs : string;
   t  : tsystem;
   t  : tsystem;
 begin
 begin
-  set_target_by_string:=false;
-  { this should be case insensitive !! PM }
+  result:=false;
   hs:=upper(s);
   hs:=upper(s);
   for t:=low(tsystem) to high(tsystem) do
   for t:=low(tsystem) to high(tsystem) do
    if assigned(targetinfos[t]) and
    if assigned(targetinfos[t]) and
       (upper(targetinfos[t]^.shortname)=hs) then
       (upper(targetinfos[t]^.shortname)=hs) then
     begin
     begin
-      set_target_by_string:=set_target(t);
+      result:=set_target(t);
       exit;
       exit;
     end;
     end;
 end;
 end;
@@ -490,14 +517,30 @@ var
   hs : string;
   hs : string;
   t  : tasm;
   t  : tasm;
 begin
 begin
-  set_target_asm_by_string:=false;
-  { this should be case insensitive !! PM }
+  result:=false;
   hs:=upper(s);
   hs:=upper(s);
   for t:=low(tasm) to high(tasm) do
   for t:=low(tasm) to high(tasm) do
    if assigned(asminfos[t]) and
    if assigned(asminfos[t]) and
       (asminfos[t]^.idtxt=hs) then
       (asminfos[t]^.idtxt=hs) then
     begin
     begin
-      set_target_asm_by_string:=set_target_asm(t);
+      result:=set_target_asm(t);
+      exit;
+    end;
+end;
+
+
+function set_target_dbg_by_string(const s : string) : boolean;
+var
+  hs : string;
+  t  : tdbg;
+begin
+  result:=false;
+  hs:=upper(s);
+  for t:=low(tdbg) to high(tdbg) do
+   if assigned(dbginfos[t]) and
+      (dbginfos[t]^.idtxt=hs) then
+    begin
+      result:=set_target_dbg(t);
       exit;
       exit;
     end;
     end;
 end;
 end;

+ 2 - 0
compiler/systems/i_amiga.pas

@@ -65,6 +65,7 @@ unit i_amiga;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_amiga;
             script       : script_amiga;
             endian       : endian_big;
             endian       : endian_big;
             alignment    :
             alignment    :
@@ -127,6 +128,7 @@ unit i_amiga;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_amiga;
             script       : script_amiga;
             endian       : endian_big;
             endian       : endian_big;
             alignment    :
             alignment    :

+ 1 - 0
compiler/systems/i_atari.pas

@@ -62,6 +62,7 @@ unit i_atari;
             linkextern   : ld_m68k_atari;
             linkextern   : ld_m68k_atari;
             ar           : ar_m68k_ar;
             ar           : ar_m68k_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_big;
             endian       : endian_big;
             stackalignment : 2;
             stackalignment : 2;

+ 1 - 0
compiler/systems/i_beos.pas

@@ -65,6 +65,7 @@ unit i_beos;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :

+ 7 - 0
compiler/systems/i_bsd.pas

@@ -68,6 +68,7 @@ unit i_bsd;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
@@ -130,6 +131,7 @@ unit i_bsd;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
@@ -192,6 +194,7 @@ unit i_bsd;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
@@ -253,6 +256,7 @@ unit i_bsd;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
@@ -314,6 +318,7 @@ unit i_bsd;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_big;
             endian       : endian_big;
             alignment    :
             alignment    :
@@ -375,6 +380,7 @@ unit i_bsd;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_big;
             endian       : endian_big;
             alignment    :
             alignment    :
@@ -439,6 +445,7 @@ unit i_bsd;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_big;
             endian       : endian_big;
             alignment    :
             alignment    :

+ 1 - 0
compiler/systems/i_emx.pas

@@ -73,6 +73,7 @@ unit i_emx;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_emxbind;
             res          : res_emxbind;
+            dbg          : dbg_stabs;
             script       : script_dos;
             script       : script_dos;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :

+ 3 - 2
compiler/systems/i_gba.pas

@@ -1,6 +1,6 @@
 {
 {
     This unit implements support information structures for GameBoy Advance
     This unit implements support information structures for GameBoy Advance
-    
+
     Copyright (c) 1998-2002 by Peter Vreman
     Copyright (c) 1998-2002 by Peter Vreman
 
 
     This program is free software; you can redistribute it and/or modify
     This program is free software; you can redistribute it and/or modify
@@ -54,7 +54,7 @@ unit i_gba;
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
-            p_ext_support : false;            
+            p_ext_support : false;
             Cprefix      : '';
             Cprefix      : '';
             newline      : #10;
             newline      : #10;
             dirsep       : '/';
             dirsep       : '/';
@@ -65,6 +65,7 @@ unit i_gba;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :

+ 1 - 0
compiler/systems/i_go32v2.pas

@@ -65,6 +65,7 @@ unit i_go32v2;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_dos;
             script       : script_dos;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :

+ 8 - 0
compiler/systems/i_linux.pas

@@ -79,6 +79,7 @@ unit i_linux;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
@@ -141,6 +142,7 @@ unit i_linux;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
@@ -203,6 +205,7 @@ unit i_linux;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_big;
             endian       : endian_big;
             alignment    :
             alignment    :
@@ -265,6 +268,7 @@ unit i_linux;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_big;
             endian       : endian_big;
             alignment    :
             alignment    :
@@ -327,6 +331,7 @@ unit i_linux;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
@@ -390,6 +395,7 @@ unit i_linux;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
@@ -452,6 +458,7 @@ unit i_linux;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_big;
             endian       : endian_big;
             alignment    :
             alignment    :
@@ -514,6 +521,7 @@ unit i_linux;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :

+ 1 - 0
compiler/systems/i_macos.pas

@@ -64,6 +64,7 @@ unit i_macos;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_mpw_ar;
             ar           : ar_mpw_ar;
             res          : res_powerpc_mpw;
             res          : res_powerpc_mpw;
+            dbg          : dbg_stabs;
             script       : script_mpw;
             script       : script_mpw;
             endian       : endian_big;
             endian       : endian_big;
             alignment    :
             alignment    :

+ 1 - 0
compiler/systems/i_morph.pas

@@ -65,6 +65,7 @@ unit i_morph;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_amiga;
             script       : script_amiga;
             endian       : endian_big;
             endian       : endian_big;
             alignment    :
             alignment    :

+ 1 - 0
compiler/systems/i_nwl.pas

@@ -65,6 +65,7 @@ unit i_nwl;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :

+ 1 - 0
compiler/systems/i_nwm.pas

@@ -65,6 +65,7 @@ unit i_nwm;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :

+ 1 - 0
compiler/systems/i_os2.pas

@@ -73,6 +73,7 @@ unit i_os2;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_emxbind;
             res          : res_emxbind;
+            dbg          : dbg_stabs;
             script       : script_dos;
             script       : script_dos;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :

+ 1 - 0
compiler/systems/i_palmos.pas

@@ -62,6 +62,7 @@ unit i_palmos;
             linkextern   : ld_m68k_palmos;
             linkextern   : ld_m68k_palmos;
             ar           : ar_m68k_ar;
             ar           : ar_m68k_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_big;
             endian       : endian_big;
             stackalignment : 2;
             stackalignment : 2;

+ 2 - 0
compiler/systems/i_sunos.pas

@@ -65,6 +65,7 @@ unit i_sunos;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
@@ -126,6 +127,7 @@ unit i_sunos;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_big;
             endian       : endian_big;
             alignment    :
             alignment    :

+ 1 - 0
compiler/systems/i_watcom.pas

@@ -67,6 +67,7 @@ unit i_watcom;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_none;
             res          : res_none;
+            dbg          : dbg_stabs;
             script       : script_dos;
             script       : script_dos;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :

+ 1 - 0
compiler/systems/i_wdosx.pas

@@ -65,6 +65,7 @@ unit i_wdosx;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_gnu_windres;
             res          : res_gnu_windres;
+            dbg          : dbg_stabs;
             script       : script_dos;
             script       : script_dos;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :

+ 4 - 0
compiler/systems/i_win.pas

@@ -65,6 +65,7 @@ unit i_win;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_gnu_windres;
             res          : res_gnu_windres;
+            dbg          : dbg_stabs;
             script       : script_dos;
             script       : script_dos;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
@@ -126,6 +127,7 @@ unit i_win;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_gnu_windres;
             res          : res_gnu_windres;
+            dbg          : dbg_stabs;
             script       : script_dos;
             script       : script_dos;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
@@ -187,6 +189,7 @@ unit i_win;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_gnu_wince_windres;
             res          : res_gnu_wince_windres;
+            dbg          : dbg_stabs;
             script       : script_dos;
             script       : script_dos;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
@@ -248,6 +251,7 @@ unit i_win;
             linkextern   : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_gnu_windres;
             res          : res_gnu_windres;
+            dbg          : dbg_stabs;
             script       : script_dos;
             script       : script_dos;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :

+ 0 - 50
compiler/x86/rax86.pas

@@ -86,24 +86,6 @@ uses
   cpuinfo,cgbase,cgutils,
   cpuinfo,cgbase,cgutils,
   itcpugas,cgx86;
   itcpugas,cgx86;
 
 
-{$define ATTOP}
-{$define INTELOP}
-
-{$ifdef NORA386INT}
-  {$ifdef NOAG386NSM}
-    {$ifdef NOAG386INT}
-      {$undef INTELOP}
-    {$endif}
-  {$endif}
-{$endif}
-
-{$ifdef NORA386ATT}
-  {$ifdef NOAG386ATT}
-    {$undef ATTOP}
-  {$endif}
-{$endif}
-
-
 
 
 {*****************************************************************************
 {*****************************************************************************
                               Parser Helpers
                               Parser Helpers
@@ -548,15 +530,7 @@ begin
          opcode:=A_FDIVP
          opcode:=A_FDIVP
        else if opcode=A_FDIVR then
        else if opcode=A_FDIVR then
          opcode:=A_FDIVRP;
          opcode:=A_FDIVRP;
-{$ifdef ATTOP}
-       message1(asmr_w_fadd_to_faddp,gas_op2str[opcode]);
-{$else}
-  {$ifdef INTELOP}
        message1(asmr_w_fadd_to_faddp,std_op2str[opcode]);
        message1(asmr_w_fadd_to_faddp,std_op2str[opcode]);
-  {$else}
-       message1(asmr_w_fadd_to_faddp,'fXX');
-  {$endif INTELOP}
-{$endif ATTOP}
      end;
      end;
 
 
   {It is valid to specify some instructions without operand size.}
   {It is valid to specify some instructions without operand size.}
@@ -596,15 +570,7 @@ begin
       (opcode=A_FDIV) or
       (opcode=A_FDIV) or
       (opcode=A_FDIVR)) then
       (opcode=A_FDIVR)) then
      begin
      begin
-{$ifdef ATTOP}
-       message1(asmr_w_adding_explicit_args_fXX,gas_op2str[opcode]);
-{$else}
-  {$ifdef INTELOP}
        message1(asmr_w_adding_explicit_args_fXX,std_op2str[opcode]);
        message1(asmr_w_adding_explicit_args_fXX,std_op2str[opcode]);
-  {$else}
-       message1(asmr_w_adding_explicit_args_fXX,'fXX');
-  {$endif INTELOP}
-{$endif ATTOP}
        ops:=2;
        ops:=2;
        operands[1].opr.typ:=OPR_REGISTER;
        operands[1].opr.typ:=OPR_REGISTER;
        operands[2].opr.typ:=OPR_REGISTER;
        operands[2].opr.typ:=OPR_REGISTER;
@@ -627,15 +593,7 @@ begin
       (opcode=A_FMULP)
       (opcode=A_FMULP)
      ) then
      ) then
      begin
      begin
-{$ifdef ATTOP}
-       message1(asmr_w_adding_explicit_first_arg_fXX,gas_op2str[opcode]);
-{$else}
-  {$ifdef INTELOP}
        message1(asmr_w_adding_explicit_first_arg_fXX,std_op2str[opcode]);
        message1(asmr_w_adding_explicit_first_arg_fXX,std_op2str[opcode]);
-  {$else}
-       message1(asmr_w_adding_explicit_first_arg_fXX,'fXX');
-  {$endif INTELOP}
-{$endif ATTOP}
        ops:=2;
        ops:=2;
        operands[2].opr.typ:=OPR_REGISTER;
        operands[2].opr.typ:=OPR_REGISTER;
        operands[2].opr.reg:=operands[1].opr.reg;
        operands[2].opr.reg:=operands[1].opr.reg;
@@ -658,15 +616,7 @@ begin
       (opcode=A_FMUL)
       (opcode=A_FMUL)
      ) then
      ) then
      begin
      begin
-{$ifdef ATTOP}
-       message1(asmr_w_adding_explicit_second_arg_fXX,gas_op2str[opcode]);
-{$else}
-  {$ifdef INTELOP}
        message1(asmr_w_adding_explicit_second_arg_fXX,std_op2str[opcode]);
        message1(asmr_w_adding_explicit_second_arg_fXX,std_op2str[opcode]);
-  {$else}
-       message1(asmr_w_adding_explicit_second_arg_fXX,'fXX');
-  {$endif INTELOP}
-{$endif ATTOP}
        ops:=2;
        ops:=2;
        operands[2].opr.typ:=OPR_REGISTER;
        operands[2].opr.typ:=OPR_REGISTER;
        operands[2].opr.reg:=NR_ST0;
        operands[2].opr.reg:=NR_ST0;

+ 20 - 0
compiler/x86_64/cputarg.pas

@@ -59,6 +59,26 @@ implementation
 
 
       ,ogcoff
       ,ogcoff
       ,ogelf
       ,ogelf
+
+{**************************************
+        Assembler Readers
+**************************************}
+
+  {$ifndef NoRax64att}
+       ,rax64att
+  {$endif NoRax64att}
+
+{**************************************
+             Debuginfo
+**************************************}
+
+  {$ifndef NoDbgStabs}
+      ,dbgstabs
+  {$endif NoDbgStabs}
+  {$ifndef NoDbgDwarf}
+      ,dbgdwarf
+  {$endif NoDbgDwarf}
+
       ;
       ;
 
 
 end.
 end.