Sfoglia il codice sorgente

* changed paratargetdbg from a global variable into a field of toption

git-svn-id: trunk@31443 -
Jonas Maebe 10 anni fa
parent
commit
0d74e4f719

+ 0 - 2
compiler/globals.pas

@@ -230,7 +230,6 @@ interface
        asmextraopt       : string;
 
        { things specified with parameters }
-       paratargetdbg     : tdbg;
        paralinkoptions   : TCmdStr;
        paradynamiclinker : string;
        paraprintnodetree : byte;
@@ -1370,7 +1369,6 @@ implementation
         compile_level:=0;
         codegenerror:=false;
         DLLsource:=false;
-        paratargetdbg:=dbg_none;
 
         { Output }
         OutputFileName:='';

+ 6 - 4
compiler/options.pas

@@ -52,6 +52,7 @@ Type
     ParaAlignment   : TAlignmentInfo;
     paratarget        : tsystem;
     paratargetasm     : tasm;
+    paratargetdbg     : tdbg;
     Constructor Create;
     Destructor Destroy;override;
     procedure WriteLogo;
@@ -3096,6 +3097,7 @@ begin
   MacVersionSet:=false;
   paratarget:=system_none;
   paratargetasm:=as_none;
+  paratargetdbg:=dbg_none;
 end;
 
 
@@ -3659,11 +3661,11 @@ begin
           Message1(option_asm_forced,target_asm.idtxt);
         end;
       if (af_no_debug in asminfos[option.paratargetasm]^.flags) and
-         (paratargetdbg<>dbg_none) then
+         (option.paratargetdbg<>dbg_none) then
         begin
           Message1(option_confict_asm_debug,
             asminfos[option.paratargetasm]^.idtxt);
-          paratargetdbg:=dbg_none;
+          option.paratargetdbg:=dbg_none;
           exclude(init_settings.moduleswitches,cs_debuginfo);
         end;
     end;
@@ -3671,8 +3673,8 @@ begin
   option.checkoptionscompatibility;
 
   { maybe override debug info format }
-  if (paratargetdbg<>dbg_none) then
-    if not set_target_dbg(paratargetdbg) then
+  if (option.paratargetdbg<>dbg_none) then
+    if not set_target_dbg(option.paratargetdbg) then
       Message(option_w_unsupported_debug_format);
 
   { switch assembler if it's binary and we got -a on the cmdline }

+ 3 - 3
compiler/pmodules.pas

@@ -145,7 +145,7 @@ implementation
         if not(target_info.system in systems_darwin) and
            (
             (tf_needs_dwarf_cfi in target_info.flags) or
-            (paratargetdbg in [dbg_dwarf2, dbg_dwarf3])
+            (target_dbg.id in [dbg_dwarf2, dbg_dwarf3])
            ) then
           begin
             current_asmdata.asmlists[al_dwarf_frame].Free;
@@ -313,7 +313,7 @@ implementation
              AddUnit('heaptrc');
            { Lineinfo unit }
            if (cs_use_lineinfo in current_settings.globalswitches) then begin
-             case paratargetdbg of
+             case target_dbg.id of
                dbg_stabs:
                  AddUnit('lineinfo');
                dbg_stabx:
@@ -434,7 +434,7 @@ implementation
            if s='LINEINFO' then
              begin
                Message(parser_w_no_lineinfo_use_switch);
-               if (paratargetdbg in [dbg_dwarf2, dbg_dwarf3]) then
+               if (target_dbg.id in [dbg_dwarf2, dbg_dwarf3]) then
                 s := 'LNFODWRF';
               sorg := s;
              end;

+ 1 - 1
compiler/scandir.pas

@@ -1203,7 +1203,7 @@ unit scandir;
     procedure dir_smartlink;
       begin
         do_moduleswitch(cs_create_smart);
-        if (paratargetdbg in [dbg_dwarf2,dbg_dwarf3]) and
+        if (target_dbg.id in [dbg_dwarf2,dbg_dwarf3]) and
             not(target_info.system in (systems_darwin+[system_i8086_msdos])) and
             { smart linking does not yet work with DWARF debug info on most targets }
             (cs_create_smart in current_settings.moduleswitches) and

+ 1 - 1
compiler/systems/t_msdos.pas

@@ -265,7 +265,7 @@ begin
 
   LinkRes.Add('option quiet');
 
-  if paratargetdbg in [dbg_dwarf2,dbg_dwarf3,dbg_dwarf4] then
+  if target_dbg.id in [dbg_dwarf2,dbg_dwarf3,dbg_dwarf4] then
     LinkRes.Add('debug dwarf');
 
   { add objectfiles, start with prt0 always }

+ 1 - 1
compiler/systems/t_win.pas

@@ -956,7 +956,7 @@ implementation
                     imagebase:=$10000
                   else
 {$ifdef cpu64bitaddr}
-                    if (paratargetdbg = dbg_stabs) then
+                    if (target_dbg.id = dbg_stabs) then
                       imagebase:=$400000
                     else
                       imagebase:= $100000000;

+ 1 - 1
compiler/x86/agx86nsm.pas

@@ -1098,7 +1098,7 @@ interface
         AsmWriteLn('GROUP DGROUP rodata data fpc bss stack heap')
       else
         AsmWriteLn('GROUP DGROUP rodata data fpc bss');
-      if paratargetdbg in [dbg_dwarf2,dbg_dwarf3,dbg_dwarf4] then
+      if target_dbg.id in [dbg_dwarf2,dbg_dwarf3,dbg_dwarf4] then
         begin
           AsmWriteLn('SECTION .debug_frame  use32 class=DWARF align=4');
           AsmWriteLn('SECTION .debug_info   use32 class=DWARF align=4');