소스 검색

+ stabs support for binary writers
* more fixes and missing updates from the previous commit :(

peter 26 년 전
부모
커밋
c5e45b576b
6개의 변경된 파일70개의 추가작업 그리고 45개의 파일을 삭제
  1. 8 3
      compiler/aasm.pas
  2. 11 6
      compiler/ag386int.pas
  3. 13 6
      compiler/ag386nsm.pas
  4. 28 19
      compiler/gdb.pas
  5. 5 6
      compiler/pstatmnt.pas
  6. 5 5
      compiler/psystem.pas

+ 8 - 3
compiler/aasm.pas

@@ -72,7 +72,8 @@ unit aasm;
 
        tsection=(sec_none,
          sec_code,sec_data,sec_bss,
-         sec_idata2,sec_idata4,sec_idata5,sec_idata6,sec_idata7,sec_edata
+         sec_idata2,sec_idata4,sec_idata5,sec_idata6,sec_idata7,sec_edata,
+         sec_stab,sec_stabstr,sec_fake
        );
 
 
@@ -836,7 +837,7 @@ uses
         hpold:=pasmsymbol(asmsymbollist^.search(sold));
         if not assigned(hpold) then
           internalerror(405406);
-          
+
         hpnew:=new(pasmsymbol,init(sold));
         { replace the old one }
         { WARNING this heavily depends on the
@@ -970,7 +971,11 @@ uses
 end.
 {
   $Log$
-  Revision 1.32  1999-03-01 13:31:59  pierre
+  Revision 1.33  1999-03-02 02:56:08  peter
+    + stabs support for binary writers
+    * more fixes and missing updates from the previous commit :(
+
+  Revision 1.32  1999/03/01 13:31:59  pierre
    * external used before implemented problem fixed
 
   Revision 1.31  1999/02/25 21:02:16  peter

+ 11 - 6
compiler/ag386int.pas

@@ -159,16 +159,17 @@ unit ag386int;
      end;
 
 {$ifdef AG386BIN}
+
     function getopstr(t : byte;o : pointer;s : topsize; _operator: tasmop;dest : boolean) : string;
     var
       hs : string;
     begin
-      if (t and OT_REGISTER)=OT_REGISTER then
+      if ((t and OT_REGISTER)=OT_REGISTER) or ((t and OT_FPUREG)=OT_FPUREG) then
         getopstr:=int_reg2str[tregister(o)]
       else
        if (t and OT_SYMBOL)=OT_SYMBOL then
         begin
-          hs:='offset '+pasmsymbol(o)^.name;
+          hs:='offset '+preference(o)^.symbol^.name;
           if preference(o)^.offset>0 then
            hs:=hs+'+'+tostr(preference(o)^.offset)
           else
@@ -220,12 +221,12 @@ unit ag386int;
     var
       hs : string;
     begin
-      if (t and OT_REGISTER)=OT_REGISTER then
+      if ((t and OT_REGISTER)=OT_REGISTER) or ((t and OT_FPUREG)=OT_FPUREG) then
        getopstr_jmp:=int_reg2str[tregister(o)]
       else
        if (t and OT_SYMBOL)=OT_SYMBOL then
         begin
-          hs:=pasmsymbol(o)^.name;
+          hs:=preference(o)^.symbol^.name;
           if preference(o)^.offset>0 then
            hs:=hs+'+'+tostr(preference(o)^.offset)
           else
@@ -336,7 +337,7 @@ unit ag386int;
         (#9'DD'#9,#9'DW'#9,#9'DB'#9);
 
       ait_section2masmstr : array[tsection] of string[6]=
-       ('','CODE','DATA','BSS','','','','','','');
+       ('','CODE','DATA','BSS','','','','','','','','','');
 
     Function PadTabs(const p:string;addch:char):string;
     var
@@ -786,7 +787,11 @@ ait_stab_function_name : ;
 end.
 {
   $Log$
-  Revision 1.28  1999-03-01 15:46:16  peter
+  Revision 1.29  1999-03-02 02:56:10  peter
+    + stabs support for binary writers
+    * more fixes and missing updates from the previous commit :(
+
+  Revision 1.28  1999/03/01 15:46:16  peter
     * ag386bin finally make cycles correct
     * prefixes are now also normal opcodes
 

+ 13 - 6
compiler/ag386nsm.pas

@@ -160,16 +160,17 @@ unit ag386nsm;
      end;
 
 {$ifdef AG386BIN}
+
     function getopstr(t : byte;o : pointer;s : topsize; opcode: tasmop;dest : boolean) : string;
     var
       hs : string;
     begin
-      if (t and OT_REGISTER)=OT_REGISTER then
+      if ((t and OT_REGISTER)=OT_REGISTER) or ((t and OT_FPUREG)=OT_FPUREG) then
         getopstr:=int_nasmreg2str[tregister(o)]
       else
        if (t and OT_SYMBOL)=OT_SYMBOL then
         begin
-          hs:='dword '+pasmsymbol(o)^.name;
+          hs:='dword '+preference(o)^.symbol^.name;
           if preference(o)^.offset>0 then
            hs:=hs+'+'+tostr(preference(o)^.offset)
           else
@@ -222,12 +223,12 @@ unit ag386nsm;
     var
       hs : string;
     begin
-      if (t and OT_REGISTER)=OT_REGISTER then
+      if ((t and OT_REGISTER)=OT_REGISTER) or ((t and OT_FPUREG)=OT_FPUREG) then
        getopstr_jmp:=int_nasmreg2str[tregister(o)]
       else
        if (t and OT_SYMBOL)=OT_SYMBOL then
         begin
-          hs:=pasmsymbol(o)^.name;
+          hs:=preference(o)^.symbol^.name;
           if preference(o)^.offset>0 then
            hs:=hs+'+'+tostr(preference(o)^.offset)
           else
@@ -340,7 +341,9 @@ unit ag386nsm;
         (#9'DD'#9,#9'DW'#9,#9'DB'#9);
 
       ait_section2nasmstr : array[tsection] of string[6]=
-       ('','.text','.data','.bss','.idata2','.idata4','.idata5','.idata6','.idata7','.edata');
+       ('','.text','.data','.bss',
+        '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
+        '.stab','.stabstr','');
 
     Function PadTabs(const p:string;addch:char):string;
     var
@@ -748,7 +751,11 @@ ait_stab_function_name : ;
 end.
 {
   $Log$
-  Revision 1.21  1999-03-01 15:46:17  peter
+  Revision 1.22  1999-03-02 02:56:11  peter
+    + stabs support for binary writers
+    * more fixes and missing updates from the previous commit :(
+
+  Revision 1.21  1999/03/01 15:46:17  peter
     * ag386bin finally make cycles correct
     * prefixes are now also normal opcodes
 

+ 28 - 19
compiler/gdb.pas

@@ -27,7 +27,11 @@ unit gdb;
     uses
       globtype,
 {$ifdef i386}
+   {$ifdef AG386BIN}
+       i386base,
+   {$else}
        i386,
+   {$endif}
 {$endif i386}
       strings,cobjects,globals,aasm;
 
@@ -80,26 +84,27 @@ Const
           destructor done; virtual;
        end;
 
-const          DBX_counter : plongint = nil;
-               do_count_dbx : boolean = false;
-           { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
-            "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
-           { this is the register order for GDB }
+    const
+       DBX_counter : plongint = nil;
+       do_count_dbx : boolean = false;
 
 {$ifdef i386}
-       {tregister = (R_NO,R_EAX,R_ECX,R_EDX,R_EBX,R_ESP,R_EBP,R_ESI,R_EDI,
-                    R_AX,R_CX,R_DX,R_BX,R_SP,R_BP,R_SI,R_DI,
-                    R_AL,R_CL,R_DL,R_BL,R_AH,R_CH,R_BH,R_DH,
-                     for an easier assembler generation
-                    R_DEFAULT_SEG,R_CS,R_DS,R_ES,R_FS,R_GS,R_SS,
-                    R_ST,R_ST0,R_ST1,R_ST2,R_ST3,R_ST4,R_ST5,R_ST6,R_ST7); }
-           GDB_i386index : array[tregister] of shortint =
-           (-1,0,1,2,3,4,5,6,7,0,1,2,3,4,5,7,0,1,2,3,0,1,2,3,
-           -1,10,12,13,14,15,11,
-           -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-           { I think, GDB doesn't know MMX (FK) }
-           -1,-1,-1,-1,-1,-1,-1,-1,
-           -1,-1,-1,-1,-1,-1,-1,-1);
+           { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
+             "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
+           { this is the register order for GDB }
+        GDB_i386index : array[tregister] of shortint =(-1,
+          0,1,2,3,4,5,6,7,0,1,2,3,4,5,7,0,1,2,3,0,1,2,3,
+          -1,10,12,13,14,15,11,
+          -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+{$ifdef AG386BIN}
+          -1,-1,-1,-1,-1,-1,
+          -1,-1,-1,-1,
+          -1,-1,-1,-1,-1,
+{$endif}
+          { I think, GDB doesn't know MMX (FK) }
+          -1,-1,-1,-1,-1,-1,-1,-1,
+          -1,-1,-1,-1,-1,-1,-1,-1
+        );
 {$endif i386}
 
   implementation
@@ -258,7 +263,11 @@ end.
 
 {
   $Log$
-  Revision 1.6  1999-01-08 12:39:23  florian
+  Revision 1.7  1999-03-02 02:56:12  peter
+    + stabs support for binary writers
+    * more fixes and missing updates from the previous commit :(
+
+  Revision 1.6  1999/01/08 12:39:23  florian
     Changes of Alexander Stohr integrated:
       + added KNI opcodes
       + added KNI registers

+ 5 - 6
compiler/pstatmnt.pas

@@ -22,11 +22,6 @@
 }
 unit pstatmnt;
 
-{$ifdef Ag386Bin}
-  {$define NoRA386ATT}
-  {$define NoRA386Int}
-{$endif}
-
   interface
 
     uses tree;
@@ -1290,7 +1285,11 @@ unit pstatmnt;
 end.
 {
   $Log$
-  Revision 1.68  1999-02-26 00:48:23  peter
+  Revision 1.69  1999-03-02 02:56:15  peter
+    + stabs support for binary writers
+    * more fixes and missing updates from the previous commit :(
+
+  Revision 1.68  1999/02/26 00:48:23  peter
     * assembler writers fixed for ag386bin
 
   Revision 1.67  1999/02/22 13:07:01  pierre

+ 5 - 5
compiler/psystem.pas

@@ -70,14 +70,12 @@ procedure insert_intern_types(p : psymtable);
 {
   all the types inserted into the system unit
 }
-{$ifdef GDB}
 var
   { several defs to simulate more or less C++ objects for GDB }
   vmtdef      : precdef;
   pvmtdef     : ppointerdef;
   vmtarraydef : parraydef;
   vmtsymtable : psymtable;
-{$endif GDB}
 begin
   p^.insert(new(ptypesym,init('longint',s32bitdef)));
   p^.insert(new(ptypesym,init('ulong',u32bitdef)));
@@ -147,7 +145,6 @@ begin
   p^.insert(new(ptypesym,init('INT64',cs64bitintdef)));
 {$endif INT64}
   p^.insert(new(ptypesym,init('TYPEDFILE',new(pfiledef,init(ft_typed,voiddef)))));
-{$ifdef GDB}
   { Add a type for virtual method tables in lowercase }
   { so it isn't reachable!                            }
   vmtsymtable:=new(psymtable,init(recordsymtable));
@@ -164,7 +161,6 @@ begin
   vmtarraydef:=new(parraydef,init(0,1,s32bitdef));
   vmtarraydef^.definition := pvmtdef;
   p^.insert(new(ptypesym,init('vtblarray',vmtarraydef)));
-{$endif GDB}
   insertinternsyms(p);
 end;
 
@@ -257,7 +253,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.15  1998-12-30 22:15:51  peter
+  Revision 1.16  1999-03-02 02:56:17  peter
+    + stabs support for binary writers
+    * more fixes and missing updates from the previous commit :(
+
+  Revision 1.15  1998/12/30 22:15:51  peter
     + farpointer type
     * absolutesym now also stores if its far