* aktoutputformat removed, add new paraXX vars for target

assembler and debuginfo and use these vars to override
    the defaults for the target after the parameters are read
  * remove not-maintained and tested gdb code

git-svn-id: trunk@1201 -
This commit is contained in:
peter 2005-09-25 21:17:37 +00:00
parent 43cf42b3b6
commit ec4d287fd8
22 changed files with 77 additions and 343 deletions

View File

@ -247,7 +247,7 @@ Implementation
begin begin
DoPipe:=(cs_asm_pipe in aktglobalswitches) and DoPipe:=(cs_asm_pipe in aktglobalswitches) and
not(cs_asm_leave in aktglobalswitches) not(cs_asm_leave in aktglobalswitches)
and ((aktoutputformat in [as_gas,as_darwin])); and ((target_asm.id in [as_gas,as_darwin]));
end; end;
@ -1474,9 +1474,6 @@ Implementation
procedure InitAssembler; procedure InitAssembler;
begin begin
{ target_asm is already set by readarguments }
initoutputformat:=target_asm.id;
aktoutputformat:=target_asm.id;
end; end;

View File

@ -993,10 +993,6 @@ uses
Message1(unit_u_ppu_write,realmodulename^); Message1(unit_u_ppu_write,realmodulename^);
{ create unit flags } { create unit flags }
{$ifdef GDB}
if cs_gdb_dbx in aktglobalswitches then
flags:=flags or uf_has_dbx;
{$endif GDB}
if cs_browser in aktmoduleswitches then if cs_browser in aktmoduleswitches then
flags:=flags or uf_has_browser; flags:=flags or uf_has_browser;
if cs_local_browser in aktmoduleswitches then if cs_local_browser in aktmoduleswitches then

View File

@ -48,11 +48,6 @@ Const
N_EINCL = $A2; N_EINCL = $A2;
N_EXCL = $C2; N_EXCL = $C2;
const
DBX_counter : plongint = nil;
do_count_dbx : boolean = false;
implementation implementation
uses fmodule; uses fmodule;

View File

@ -136,6 +136,9 @@ interface
outputunitdir : dirstr; outputunitdir : dirstr;
{ things specified with parameters } { things specified with parameters }
paratarget : tsystem;
paratargetdbg : tdbg;
paratargetasm : tasm;
paralinkoptions, paralinkoptions,
paradynamiclinker : string; paradynamiclinker : string;
paraprintnodetree : byte; paraprintnodetree : byte;
@ -216,7 +219,6 @@ interface
initfputype : tfputype; initfputype : tfputype;
initasmmode : tasmmode; initasmmode : tasmmode;
initinterfacetype : tinterfacetypes; initinterfacetype : tinterfacetypes;
initoutputformat : tasm;
initdefproccall : tproccalloption; initdefproccall : tproccalloption;
initsourcecodepage : tcodepagestring; initsourcecodepage : tcodepagestring;
@ -242,7 +244,6 @@ interface
aktfputype : tfputype; aktfputype : tfputype;
aktasmmode : tasmmode; aktasmmode : tasmmode;
aktinterfacetype : tinterfacetypes; aktinterfacetype : tinterfacetypes;
aktoutputformat : tasm;
aktdefproccall : tproccalloption; aktdefproccall : tproccalloption;
aktsourcecodepage : tcodepagestring; aktsourcecodepage : tcodepagestring;
@ -2184,6 +2185,9 @@ end;
resolving_forward:=false; resolving_forward:=false;
make_ref:=false; make_ref:=false;
LinkTypeSetExplicitly:=false; LinkTypeSetExplicitly:=false;
paratarget:=system_none;
paratargetasm:=as_none;
paratargetdbg:=dbg_none;
{ Output } { Output }
OutputFile:=''; OutputFile:='';
@ -2229,7 +2233,6 @@ end;
initmoduleswitches:=[cs_extsyntax,cs_implicit_exceptions]; initmoduleswitches:=[cs_extsyntax,cs_implicit_exceptions];
initsourcecodepage:='8859-1'; initsourcecodepage:='8859-1';
initglobalswitches:=[cs_check_unit_name,cs_link_static{$ifdef INTERNALLINKER},cs_link_internal,cs_link_map{$endif}]; initglobalswitches:=[cs_check_unit_name,cs_link_static{$ifdef INTERNALLINKER},cs_link_internal,cs_link_map{$endif}];
initoutputformat:=target_asm.id;
fillchar(initalignment,sizeof(talignmentinfo),0); fillchar(initalignment,sizeof(talignmentinfo),0);
{ might be overridden later } { might be overridden later }
initasmmode:=asmmode_standard; initasmmode:=asmmode_standard;

View File

@ -119,9 +119,9 @@ than 255 characters. That's why using Ansi Strings}
cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_align,cs_loopunroll, cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_align,cs_loopunroll,
{ browser } { browser }
cs_browser_log, cs_browser_log,
{ debugger } { debuginfo }
cs_gdb_dbx,cs_gdb_gsym,cs_gdb_heaptrc,cs_gdb_lineinfo, cs_gdb_heaptrc,cs_gdb_lineinfo,
cs_gdb_valgrind,cs_gdb_dwarf, cs_gdb_valgrind,
{ assembling } { assembling }
cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source, cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source,
cs_asm_regalloc,cs_asm_tempalloc,cs_asm_nodes, cs_asm_regalloc,cs_asm_tempalloc,cs_asm_nodes,

View File

@ -1645,8 +1645,6 @@ implementation
{$ifdef GDB} {$ifdef GDB}
if (cs_debuginfo in aktmoduleswitches) then if (cs_debuginfo in aktmoduleswitches) then
begin begin
if (po_global in current_procinfo.procdef.procoptions) then
Tprocsym(current_procinfo.procdef.procsym).is_global:=true;
current_procinfo.procdef.concatstabto(list); current_procinfo.procdef.concatstabto(list);
Tprocsym(current_procinfo.procdef.procsym).isstabwritten:=true; Tprocsym(current_procinfo.procdef.procsym).isstabwritten:=true;
end; end;

View File

@ -1283,7 +1283,6 @@ implementation
{$ifdef GDB} {$ifdef GDB}
if (cs_debuginfo in aktmoduleswitches) then if (cs_debuginfo in aktmoduleswitches) then
begin begin
do_count_dbx:=true;
if assigned(_class.owner) and assigned(_class.owner.name) then if assigned(_class.owner) and assigned(_class.owner.name) then
asmlist[al_globals].concat(Tai_stab.create(stab_stabs,strpnew('"vmt_'+_class.owner.name^+_class.name+':S'+ asmlist[al_globals].concat(Tai_stab.create(stab_stabs,strpnew('"vmt_'+_class.owner.name^+_class.name+':S'+
tstoreddef(vmttype.def).numberstring+'",'+tostr(N_STSYM)+',0,0,'+_class.vmt_mangledname))); tstoreddef(vmttype.def).numberstring+'",'+tostr(N_STSYM)+',0,0,'+_class.vmt_mangledname)));

View File

@ -90,9 +90,7 @@ const
var var
option : toption; option : toption;
read_configfile, { read config file, set when a cfgfile is found } read_configfile, { read config file, set when a cfgfile is found }
disable_configfile, disable_configfile : boolean;
target_is_set : boolean; { do not allow contradictory target settings }
asm_is_set : boolean; { -T also change initoutputformat if not set idrectly }
fpcdir, fpcdir,
ppccfg, ppccfg,
ppcaltcfg, ppcaltcfg,
@ -279,9 +277,7 @@ begin
if show then if show then
begin begin
case s[2] of case s[2] of
{$ifdef GDB}
'g', 'g',
{$endif}
{$ifdef Unix} {$ifdef Unix}
'L', 'L',
{$endif} {$endif}
@ -388,7 +384,6 @@ var
d : DirStr; d : DirStr;
e : ExtStr; e : ExtStr;
s : string; s : string;
forceasm : tasm;
begin begin
if opt='' then if opt='' then
exit; exit;
@ -453,9 +448,8 @@ begin
'A' : 'A' :
begin begin
if set_target_asm_by_string(More) then paratargetasm:=find_asm_by_string(More);
asm_is_set:=true if paratargetasm=as_none then
else
IllegalPara(opt); IllegalPara(opt);
end; end;
@ -749,41 +743,30 @@ begin
if UnsetBool(More, 0) then if UnsetBool(More, 0) then
begin begin
exclude(initmoduleswitches,cs_debuginfo); exclude(initmoduleswitches,cs_debuginfo);
exclude(initglobalswitches,cs_gdb_dbx);
exclude(initglobalswitches,cs_gdb_gsym);
exclude(initglobalswitches,cs_gdb_heaptrc); exclude(initglobalswitches,cs_gdb_heaptrc);
exclude(initglobalswitches,cs_gdb_lineinfo); exclude(initglobalswitches,cs_gdb_lineinfo);
exclude(initlocalswitches,cs_checkpointer); exclude(initlocalswitches,cs_checkpointer);
end end
else else
begin begin
{$ifdef GDB}
include(initmoduleswitches,cs_debuginfo); include(initmoduleswitches,cs_debuginfo);
{$else GDB}
Message(option_no_debug_support);
Message(option_no_debug_support_recompile_fpc);
{$endif GDB}
end; end;
{$ifdef GDB}
if not RelocSectionSetExplicitly then if not RelocSectionSetExplicitly then
RelocSection:=false; RelocSection:=false;
j:=1; j:=1;
while j<=length(more) do while j<=length(more) do
begin begin
case more[j] of case more[j] of
'c' :
begin
if UnsetBool(More, j) then
exclude(initlocalswitches,cs_checkpointer)
else
include(initlocalswitches,cs_checkpointer);
end;
'd' : 'd' :
begin begin
if UnsetBool(More, j) then paratargetdbg:=dbg_dwarf;
exclude(initglobalswitches,cs_gdb_dbx)
else
include(initglobalswitches,cs_gdb_dbx);
end;
'g' :
begin
if UnsetBool(More, j) then
exclude(initglobalswitches,cs_gdb_gsym)
else
include(initglobalswitches,cs_gdb_gsym);
end; end;
'h' : 'h' :
begin begin
@ -799,12 +782,9 @@ begin
else else
include(initglobalswitches,cs_gdb_lineinfo); include(initglobalswitches,cs_gdb_lineinfo);
end; end;
'c' : 's' :
begin begin
if UnsetBool(More, j) then paratargetdbg:=dbg_stabs;
exclude(initlocalswitches,cs_checkpointer)
else
include(initlocalswitches,cs_checkpointer);
end; end;
'v' : 'v' :
begin begin
@ -813,19 +793,11 @@ begin
else else
include(initglobalswitches,cs_gdb_valgrind); include(initglobalswitches,cs_gdb_valgrind);
end; end;
'w' :
begin
if UnsetBool(More, j) then
exclude(initglobalswitches,cs_gdb_dwarf)
else
include(initglobalswitches,cs_gdb_dwarf);
end;
else else
IllegalPara(opt); IllegalPara(opt);
end; end;
inc(j); inc(j);
end; end;
{$endif GDB}
end; end;
'h' : 'h' :
@ -1028,22 +1000,18 @@ begin
'T' : 'T' :
begin begin
more:=Upper(More); more:=Upper(More);
if not target_is_set then if paratarget=system_none then
begin begin
{ remove old target define } { remove old target define }
TargetDefines(false); TargetDefines(false);
{ Save assembler if set }
if asm_is_set then
forceasm:=target_asm.id;
{ load new target } { load new target }
if not(set_target_by_string(More)) then paratarget:=find_system_by_string(More);
if paratarget<>system_none then
set_target(paratarget)
else
IllegalPara(opt); IllegalPara(opt);
{ also initialize assembler if not explicitly set }
if asm_is_set then
set_target_asm(forceasm);
{ set new define } { set new define }
TargetDefines(true); TargetDefines(true);
target_is_set:=true;
end end
else else
if More<>upper(target_info.shortname) then if More<>upper(target_info.shortname) then
@ -1935,8 +1903,6 @@ begin
read_configfile := false; read_configfile := false;
{ Read commandline and configfile } { Read commandline and configfile }
target_is_set:=false;
asm_is_set:=false;
param_file:=''; param_file:='';
{ read configfile } { read configfile }
@ -2099,6 +2065,14 @@ begin
objectsearchpath.AddList(unitsearchpath,false); objectsearchpath.AddList(unitsearchpath,false);
librarysearchpath.AddList(unitsearchpath,false); librarysearchpath.AddList(unitsearchpath,false);
{ maybe override debug info format }
if (paratargetdbg<>dbg_none) then
set_target_dbg(paratargetdbg);
{ maybe override assembler }
if (paratargetasm<>as_none) then
set_target_asm(paratargetasm);
{ switch assembler if it's binary and we got -a on the cmdline } { switch assembler if it's binary and we got -a on the cmdline }
if (cs_asm_leave in initglobalswitches) and if (cs_asm_leave in initglobalswitches) and
(af_outputbinary in target_asm.flags) then (af_outputbinary in target_asm.flags) then

View File

@ -329,7 +329,6 @@ implementation
oldaktpackenum : shortint; oldaktpackenum : shortint;
oldaktmaxfpuregisters : longint; oldaktmaxfpuregisters : longint;
oldaktalignment : talignmentinfo; oldaktalignment : talignmentinfo;
oldaktoutputformat : tasm;
oldaktspecificoptprocessor, oldaktspecificoptprocessor,
oldaktoptprocessor : tprocessors; oldaktoptprocessor : tprocessors;
oldaktfputype : tfputype; oldaktfputype : tfputype;
@ -340,9 +339,6 @@ implementation
oldcurrent_procinfo : tprocinfo; oldcurrent_procinfo : tprocinfo;
oldaktdefproccall : tproccalloption; oldaktdefproccall : tproccalloption;
oldsourcecodepage : tcodepagestring; oldsourcecodepage : tcodepagestring;
{$ifdef GDB}
store_dbx : plongint;
{$endif GDB}
end; end;
var var
@ -395,17 +391,12 @@ implementation
oldaktpackrecords:=aktpackrecords; oldaktpackrecords:=aktpackrecords;
oldaktfputype:=aktfputype; oldaktfputype:=aktfputype;
oldaktmaxfpuregisters:=aktmaxfpuregisters; oldaktmaxfpuregisters:=aktmaxfpuregisters;
oldaktoutputformat:=aktoutputformat;
oldaktoptprocessor:=aktoptprocessor; oldaktoptprocessor:=aktoptprocessor;
oldaktspecificoptprocessor:=aktspecificoptprocessor; oldaktspecificoptprocessor:=aktspecificoptprocessor;
oldaktasmmode:=aktasmmode; oldaktasmmode:=aktasmmode;
oldaktinterfacetype:=aktinterfacetype; oldaktinterfacetype:=aktinterfacetype;
oldaktfilepos:=aktfilepos; oldaktfilepos:=aktfilepos;
oldaktmodeswitches:=aktmodeswitches; oldaktmodeswitches:=aktmodeswitches;
{$ifdef GDB}
store_dbx:=dbx_counter;
dbx_counter:=nil;
{$endif GDB}
end; end;
{ show info } { show info }
Message1(parser_i_compiling,filename); Message1(parser_i_compiling,filename);
@ -453,8 +444,6 @@ implementation
aktfputype:=initfputype; aktfputype:=initfputype;
aktpackenum:=initpackenum; aktpackenum:=initpackenum;
aktpackrecords:=0; aktpackrecords:=0;
aktoutputformat:=initoutputformat;
set_target_asm(aktoutputformat);
aktoptprocessor:=initoptprocessor; aktoptprocessor:=initoptprocessor;
aktspecificoptprocessor:=initspecificoptprocessor; aktspecificoptprocessor:=initspecificoptprocessor;
aktasmmode:=initasmmode; aktasmmode:=initasmmode;
@ -567,8 +556,6 @@ implementation
aktpackenum:=oldaktpackenum; aktpackenum:=oldaktpackenum;
aktpackrecords:=oldaktpackrecords; aktpackrecords:=oldaktpackrecords;
aktmaxfpuregisters:=oldaktmaxfpuregisters; aktmaxfpuregisters:=oldaktmaxfpuregisters;
aktoutputformat:=oldaktoutputformat;
set_target_asm(aktoutputformat);
aktoptprocessor:=oldaktoptprocessor; aktoptprocessor:=oldaktoptprocessor;
aktspecificoptprocessor:=oldaktspecificoptprocessor; aktspecificoptprocessor:=oldaktspecificoptprocessor;
aktfputype:=oldaktfputype; aktfputype:=oldaktfputype;
@ -578,9 +565,6 @@ implementation
aktmodeswitches:=oldaktmodeswitches; aktmodeswitches:=oldaktmodeswitches;
aktexceptblock:=0; aktexceptblock:=0;
exceptblockcounter:=0; exceptblockcounter:=0;
{$ifdef GDB}
dbx_counter:=store_dbx;
{$endif GDB}
end; end;
end end
else else

View File

@ -776,19 +776,6 @@ implementation
tglobalsymtable(current_module.globalsymtable).concattypestabto(asmlist[al_debugtypes]); tglobalsymtable(current_module.globalsymtable).concattypestabto(asmlist[al_debugtypes]);
if assigned(current_module.localsymtable) then if assigned(current_module.localsymtable) then
tstaticsymtable(current_module.localsymtable).concattypestabto(asmlist[al_debugtypes]); tstaticsymtable(current_module.localsymtable).concattypestabto(asmlist[al_debugtypes]);
{ include files }
if (cs_gdb_dbx in aktglobalswitches) then
begin
asmlist[al_debugtypes].concat(tai_comment.Create(strpnew('EINCL of global '+
tglobalsymtable(current_module.globalsymtable).name^+' has index '+
tostr(tglobalsymtable(current_module.globalsymtable).moduleid))));
asmlist[al_debugtypes].concat(Tai_stab.create(stab_stabs,strpnew('"'+
tglobalsymtable(current_module.globalsymtable).name^+'",'+
tostr(N_EINCL)+',0,0,0')));
tglobalsymtable(current_module.globalsymtable).dbx_count_ok:={true}false;
dbx_counter:=tglobalsymtable(current_module.globalsymtable).prev_dbx_counter;
do_count_dbx:=false;
end;
aktfilepos:=storefilepos; aktfilepos:=storefilepos;
end; end;
{$EndIf GDB} {$EndIf GDB}

View File

@ -1207,7 +1207,7 @@ interface
DoAssemble:=Inherited DoAssemble; DoAssemble:=Inherited DoAssemble;
(* (*
{ masm does not seem to recognize specific extensions and uses .obj allways PM } { masm does not seem to recognize specific extensions and uses .obj allways PM }
if (aktoutputformat = as_i386_masm) then if (target_asm.id = as_i386_masm) then
begin begin
if not(cs_asm_extern in aktglobalswitches) then if not(cs_asm_extern in aktglobalswitches) then
begin begin
@ -1230,7 +1230,7 @@ interface
(* (*
AsmWriteLn(#9'.386p'); AsmWriteLn(#9'.386p');
{ masm 6.11 does not seem to like LOCALS PM } { masm 6.11 does not seem to like LOCALS PM }
if (aktoutputformat = as_i386_tasm) then if (target_asm.id = as_i386_tasm) then
begin begin
AsmWriteLn(#9'LOCALS '+target_asm.labelprefix); AsmWriteLn(#9'LOCALS '+target_asm.labelprefix);
end; end;

View File

@ -41,10 +41,6 @@ implementation
globtype,systems, globtype,systems,
cutils,verbose,globals, cutils,verbose,globals,
symconst,symbase,symsym,symtable,defutil,paramgr,parabase, symconst,symbase,symsym,symtable,defutil,paramgr,parabase,
{$ifdef GDB}
strings,
gdb,
{$endif GDB}
cgbase,pass_2, cgbase,pass_2,
cpuinfo,cpubase,aasmbase,aasmtai,aasmcpu, cpuinfo,cpubase,aasmbase,aasmtai,aasmcpu,
nmem,nld,ncnv, nmem,nld,ncnv,

View File

@ -38,10 +38,6 @@ uses
globtype, systems, globtype, systems,
cutils, verbose, globals, cutils, verbose, globals,
symconst, symbase, symsym, symtable, defutil, paramgr, parabase, symconst, symbase, symsym, symtable, defutil, paramgr, parabase,
{$IFDEF GDB}
strings,
gdb,
{$ENDIF GDB}
cgbase, pass_2, cgbase, pass_2,
cpuinfo, cpubase, aasmbase, aasmtai, aasmcpu, cpuinfo, cpubase, aasmbase, aasmtai, aasmcpu,
nmem, nld, ncnv, nmem, nld, ncnv,

View File

@ -73,7 +73,6 @@ const
iblinkotherofiles = 8; iblinkotherofiles = 8;
iblinkotherstaticlibs = 9; iblinkotherstaticlibs = 9;
iblinkothersharedlibs = 10; iblinkothersharedlibs = 10;
ibdbxcount = 11;
ibsymref = 12; ibsymref = 12;
ibdefref = 13; ibdefref = 13;
ibendsymtablebrowser = 14; ibendsymtablebrowser = 14;
@ -134,7 +133,6 @@ const
uf_init = $1; uf_init = $1;
uf_finalize = $2; uf_finalize = $2;
uf_big_endian = $4; uf_big_endian = $4;
uf_has_dbx = $8;
uf_has_browser = $10; uf_has_browser = $10;
uf_in_library = $20; { is the file in another file than <ppufile>.* ? } uf_in_library = $20; { is the file in another file than <ppufile>.* ? }
uf_smart_linked = $40; { the ppu can be smartlinked } uf_smart_linked = $40; { the ppu can be smartlinked }

View File

@ -671,20 +671,6 @@ implementation
do_delphiswitch('P'); do_delphiswitch('P');
end; end;
procedure dir_output_format;
begin
if not current_module.in_global then
Message(scan_w_switch_is_global)
else
begin
current_scanner.skipspace;
if set_target_asm_by_string(current_scanner.readid) then
aktoutputformat:=target_asm.id
else
Message1(scan_w_illegal_switch,pattern);
end;
end;
procedure dir_overflowchecks; procedure dir_overflowchecks;
begin begin
do_delphiswitch('Q'); do_delphiswitch('Q');
@ -1145,7 +1131,6 @@ implementation
AddDirective('OBJECTCHECKS',directive_all, @dir_objectchecks); AddDirective('OBJECTCHECKS',directive_all, @dir_objectchecks);
AddDirective('OBJECTPATH',directive_all, @dir_objectpath); AddDirective('OBJECTPATH',directive_all, @dir_objectpath);
AddDirective('OPENSTRINGS',directive_all, @dir_openstrings); AddDirective('OPENSTRINGS',directive_all, @dir_openstrings);
AddDirective('OUTPUT_FORMAT',directive_all, @dir_output_format);
AddDirective('OVERFLOWCHECKS',directive_all, @dir_overflowchecks); AddDirective('OVERFLOWCHECKS',directive_all, @dir_overflowchecks);
AddDirective('PACKENUM',directive_all, @dir_packenum); AddDirective('PACKENUM',directive_all, @dir_packenum);
AddDirective('PACKRECORDS',directive_all, @dir_packrecords); AddDirective('PACKRECORDS',directive_all, @dir_packrecords);

View File

@ -1075,13 +1075,7 @@ implementation
ppufile.putderef(inittablesymderef); ppufile.putderef(inittablesymderef);
{$ifdef GDB} {$ifdef GDB}
if globalnb=0 then if globalnb=0 then
begin
if (cs_gdb_dbx in aktglobalswitches) and
assigned(owner) then
globalnb := owner.getnewtypecount
else
set_globalnb; set_globalnb;
end;
{$endif GDB} {$endif GDB}
end; end;
@ -1182,19 +1176,7 @@ implementation
stab_state:=stab_state_used; stab_state:=stab_state_used;
{ Need a new number? } { Need a new number? }
if globalnb=0 then if globalnb=0 then
begin
if (cs_gdb_dbx in aktglobalswitches) and
assigned(owner) then
globalnb := owner.getnewtypecount
else
set_globalnb; set_globalnb;
end;
if (cs_gdb_dbx in aktglobalswitches) and
assigned(typesym) and
(ttypesym(typesym).owner.symtabletype in [staticsymtable,globalsymtable]) and
(ttypesym(typesym).owner.iscurrentunit) then
result:='('+tostr(tabstractunitsymtable(ttypesym(typesym).owner).moduleid)+','+tostr(tstoreddef(ttypesym(typesym).restype.def).globalnb)+')'
else
result:=tostr(globalnb); result:=tostr(globalnb);
end; end;
@ -1228,21 +1210,6 @@ implementation
begin begin
if (stab_state in [stab_state_writing,stab_state_written]) then if (stab_state in [stab_state_writing,stab_state_written]) then
exit; exit;
If cs_gdb_dbx in aktglobalswitches then
begin
{ otherwise you get two of each def }
If assigned(typesym) then
begin
if (ttypesym(typesym).owner = nil) or
((ttypesym(typesym).owner.symtabletype = globalsymtable) and
tglobalsymtable(ttypesym(typesym).owner).dbx_count_ok) then
begin
{with DBX we get the definition from the other objects }
stab_state := stab_state_written;
exit;
end;
end;
end;
{ to avoid infinite loops } { to avoid infinite loops }
stab_state := stab_state_writing; stab_state := stab_state_writing;
stab_str := allstabstring; stab_str := allstabstring;
@ -4353,7 +4320,7 @@ implementation
begin begin
obj := procsym.name; obj := procsym.name;
info := ''; info := '';
if tprocsym(procsym).is_global then if (po_global in procoptions) then
RType := 'F' RType := 'F'
else else
RType := 'f'; RType := 'f';

View File

@ -95,9 +95,6 @@ interface
function getprocdef(nr:cardinal):Tprocdef; function getprocdef(nr:cardinal):Tprocdef;
public public
procdef_count : byte; procdef_count : byte;
{$ifdef GDB}
is_global : boolean;
{$endif GDB}
overloadchecked : boolean; overloadchecked : boolean;
property procdef[nr:cardinal]:Tprocdef read getprocdef; property procdef[nr:cardinal]:Tprocdef read getprocdef;
constructor create(const n : string); constructor create(const n : string);
@ -604,9 +601,6 @@ implementation
pdlistfirst:=nil; pdlistfirst:=nil;
pdlistlast:=nil; pdlistlast:=nil;
owner:=nil; owner:=nil;
{$ifdef GDB}
is_global:=false;
{$endif GDB}
{ the tprocdef have their own symoptions, make the procsym { the tprocdef have their own symoptions, make the procsym
always visible } always visible }
symoptions:=[sp_public]; symoptions:=[sp_public];
@ -631,9 +625,6 @@ implementation
ppufile.getderef(pdderef); ppufile.getderef(pdderef);
addprocdef_deref(pdderef); addprocdef_deref(pdderef);
end; end;
{$ifdef GDB}
is_global:=false;
{$endif GDB}
overloadchecked:=false; overloadchecked:=false;
end; end;
@ -1510,9 +1501,6 @@ implementation
if (sp_static in symoptions) then if (sp_static in symoptions) then
begin begin
st:=tstoreddef(vartype.def).numberstring; st:=tstoreddef(vartype.def).numberstring;
if (cs_gdb_gsym in aktglobalswitches) then
st:='G'+st
else
st:='S'+st; st:='S'+st;
stabstring:=stabstr_evaluate('"${ownername}__${name}:$1",${N_LCSYM},0,${line},${mangledname}',[st]); stabstring:=stabstr_evaluate('"${ownername}__${name}:$1",${N_LCSYM},0,${line},${mangledname}',[st]);
end; end;
@ -1683,9 +1671,6 @@ implementation
because with G GDB doesn't look at the address field because with G GDB doesn't look at the address field
but searches the same name or with a leading underscore but searches the same name or with a leading underscore
but these names don't exist in pascal !} but these names don't exist in pascal !}
if (cs_gdb_gsym in aktglobalswitches) then
st:='G'+st
else
st:='S'+st; st:='S'+st;
stabstring:=stabstr_evaluate('"${name}:$1",${N_LCSYM},0,${line},${mangledname}$2',[st,threadvaroffset]); stabstring:=stabstr_evaluate('"${name}:$1",${N_LCSYM},0,${line},${mangledname}$2',[st,threadvaroffset]);
end; end;
@ -2101,9 +2086,6 @@ implementation
var st:char; var st:char;
begin begin
if (cs_gdb_gsym in aktglobalswitches) and (owner.symtabletype=globalsymtable) then
st:='G'
else
st:='S'; st:='S';
stabstring:=stabstr_evaluate('"${name}:$1$2",${N_STSYM},0,${line},${mangledname}', stabstring:=stabstr_evaluate('"${name}:$1$2",${N_STSYM},0,${line},${mangledname}',
[st,Tstoreddef(typedconsttype.def).numberstring]); [st,Tstoreddef(typedconsttype.def).numberstring]);

View File

@ -132,11 +132,6 @@ interface
tabstractunitsymtable = class(tstoredsymtable) tabstractunitsymtable = class(tstoredsymtable)
public public
{$ifdef GDB}
dbx_count : longint;
prev_dbx_counter : plongint;
dbx_count_ok : boolean;
{$endif GDB}
constructor create(const n : string;id:word); constructor create(const n : string;id:word);
{$ifdef GDB} {$ifdef GDB}
procedure concattypestabto(asmlist : taasmoutput); procedure concattypestabto(asmlist : taasmoutput);
@ -1347,12 +1342,6 @@ implementation
inherited create(n); inherited create(n);
moduleid:=id; moduleid:=id;
symsearch.usehash; symsearch.usehash;
{$ifdef GDB}
{ reset GDB things }
prev_dbx_counter := dbx_counter;
dbx_counter := nil;
dbx_count := -1;
{$endif GDB}
end; end;
@ -1395,51 +1384,14 @@ implementation
var var
old_writing_def_stabs : boolean; old_writing_def_stabs : boolean;
prev_dbx_count : plongint;
begin begin
if not assigned(name) then if not assigned(name) then
name := stringdup('Main_program'); name := stringdup('Main_program');
asmList.concat(tai_comment.Create(strpnew('Begin unit '+name^+' has index '+tostr(moduleid)))); asmList.concat(tai_comment.Create(strpnew('Begin unit '+name^+' has index '+tostr(moduleid))));
if cs_gdb_dbx in aktglobalswitches then
begin
if dbx_count_ok then
begin
asmList.concat(tai_comment.Create(strpnew('"repeated" unit '+name^
+' has index '+tostr(moduleid)+' dbx count = '+tostr(dbx_count))));
asmList.concat(Tai_stab.create(stab_stabs,strpnew('"'+name^+'",'
+tostr(N_EXCL)+',0,0,'+tostr(dbx_count))));
exit;
end
else if not iscurrentunit then
begin
prev_dbx_count := dbx_counter;
dbx_counter := nil;
do_count_dbx:=false;
if (symtabletype = globalsymtable) then
asmList.concat(Tai_stab.create(stab_stabs,strpnew('"'+name^+'",'+tostr(N_BINCL)+',0,0,0')));
dbx_counter := @dbx_count;
dbx_count:=0;
do_count_dbx:=assigned(dbx_counter);
end;
end;
old_writing_def_stabs:=writing_def_stabs; old_writing_def_stabs:=writing_def_stabs;
writing_def_stabs:=true; writing_def_stabs:=true;
dowritestabs(asmlist,self); dowritestabs(asmlist,self);
writing_def_stabs:=old_writing_def_stabs; writing_def_stabs:=old_writing_def_stabs;
if cs_gdb_dbx in aktglobalswitches then
begin
if not iscurrentunit then
begin
dbx_counter := prev_dbx_count;
do_count_dbx:=false;
asmList.concat(Tai_stab.create(stab_stabs,strpnew('"'+name^+'",'
+tostr(N_EINCL)+',0,0,0')));
do_count_dbx:=assigned(dbx_counter);
dbx_count_ok := {true}false;
end;
end;
asmList.concat(tai_comment.Create(strpnew('End unit '+name^+' has index '+tostr(moduleid)))); asmList.concat(tai_comment.Create(strpnew('End unit '+name^+' has index '+tostr(moduleid))));
end; end;
{$endif GDB} {$endif GDB}
@ -1526,40 +1478,11 @@ implementation
inherited create(n,id); inherited create(n,id);
symtabletype:=globalsymtable; symtabletype:=globalsymtable;
symtablelevel:=main_program_level; symtablelevel:=main_program_level;
{$ifdef GDB}
if cs_gdb_dbx in aktglobalswitches then
begin
dbx_count := 0;
unittypecount:=1;
pglobaltypecount := @unittypecount;
{moduleid:=current_module.unitcount;}
{al_debugtypes.concat(tai_comment.Create(strpnew('Global '+name^+' has index '+tostr(moduleid))));
al_debugtypes.concat(Tai_stab.create(stab_stabs,strpnew('"'+name^+'",'+tostr(N_BINCL)+',0,0,0')));}
{inc(current_module.unitcount);}
{ we can't use dbx_vcount, because we don't know
if the object file will be loaded before or afeter PM }
dbx_count_ok:=false;
dbx_counter:=@dbx_count;
do_count_dbx:=true;
end;
{$endif GDB}
end; end;
procedure tglobalsymtable.ppuload(ppufile:tcompilerppufile); procedure tglobalsymtable.ppuload(ppufile:tcompilerppufile);
{$ifdef GDB}
var
b : byte;
{$endif GDB}
begin begin
{$ifdef GDB}
if cs_gdb_dbx in aktglobalswitches then
begin
UnitTypeCount:=1;
PglobalTypeCount:=@UnitTypeCount;
end;
{$endif GDB}
next:=symtablestack; next:=symtablestack;
symtablestack:=self; symtablestack:=self;
@ -1570,29 +1493,6 @@ implementation
{ restore symtablestack } { restore symtablestack }
symtablestack:=next; symtablestack:=next;
{ read dbx count }
{$ifdef GDB}
if (current_module.flags and uf_has_dbx)<>0 then
begin
b:=ppufile.readentry;
if b<>ibdbxcount then
Message(unit_f_ppu_dbx_count_problem)
else
dbx_count:=ppufile.getlongint;
{$IfDef EXTDEBUG}
writeln('Read dbx_count ',dbx_count,' in unit ',name^,'.ppu');
{$ENDIF EXTDEBUG}
{ we can't use dbx_vcount, because we don't know
if the object file will be loaded before or afeter PM }
dbx_count_ok := {true}false;
end
else
begin
dbx_count:=-1;
dbx_count_ok:=false;
end;
{$endif GDB}
end; end;
@ -1600,20 +1500,6 @@ implementation
begin begin
{ write the symtable entries } { write the symtable entries }
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
{ write dbx count }
{$ifdef GDB}
if cs_gdb_dbx in aktglobalswitches then
begin
{$IfDef EXTDEBUG}
writeln('Writing dbx_count ',dbx_count,' in unit ',name^,'.ppu');
{$ENDIF EXTDEBUG}
ppufile.do_crc:=false;
ppufile.putlongint(dbx_count);
ppufile.writeentry(ibdbxcount);
ppufile.do_crc:=true;
end;
{$endif GDB}
end; end;
@ -1653,13 +1539,7 @@ implementation
{$ifdef GDB} {$ifdef GDB}
function tglobalsymtable.getnewtypecount : word; function tglobalsymtable.getnewtypecount : word;
begin begin
if not (cs_gdb_dbx in aktglobalswitches) then
getnewtypecount:=inherited getnewtypecount getnewtypecount:=inherited getnewtypecount
else
begin
getnewtypecount:=unittypecount;
inc(unittypecount);
end;
end; end;
{$endif} {$endif}

View File

@ -352,9 +352,9 @@ interface
function set_target_res(t:tres):boolean; function set_target_res(t:tres):boolean;
function set_target_dbg(t:tdbg):boolean; function set_target_dbg(t:tdbg):boolean;
function set_target_by_string(const s : string) : boolean; function find_system_by_string(const s : string) : tsystem;
function set_target_asm_by_string(const s : string) : boolean; function find_asm_by_string(const s : string) : tasm;
function set_target_dbg_by_string(const s : string) : boolean; function find_dbg_by_string(const s : string) : tdbg;
procedure set_source_info(const ti : tsysteminfo); procedure set_source_info(const ti : tsysteminfo);
@ -497,52 +497,52 @@ begin
end; end;
function set_target_by_string(const s : string) : boolean; function find_system_by_string(const s : string) : tsystem;
var var
hs : string; hs : string;
t : tsystem; t : tsystem;
begin begin
result:=false; result:=system_none;
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
result:=set_target(t); result:=t;
exit; exit;
end; end;
end; end;
function set_target_asm_by_string(const s : string) : boolean; function find_asm_by_string(const s : string) : tasm;
var var
hs : string; hs : string;
t : tasm; t : tasm;
begin begin
result:=false; result:=as_none;
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
result:=set_target_asm(t); result:=t;
exit; exit;
end; end;
end; end;
function set_target_dbg_by_string(const s : string) : boolean; function find_dbg_by_string(const s : string) : tdbg;
var var
hs : string; hs : string;
t : tdbg; t : tdbg;
begin begin
result:=false; result:=dbg_none;
hs:=upper(s); hs:=upper(s);
for t:=low(tdbg) to high(tdbg) do for t:=low(tdbg) to high(tdbg) do
if assigned(dbginfos[t]) and if assigned(dbginfos[t]) and
(dbginfos[t]^.idtxt=hs) then (dbginfos[t]^.idtxt=hs) then
begin begin
result:=set_target_dbg(t); result:=t;
exit; exit;
end; end;
end; end;

View File

@ -31,9 +31,6 @@ interface
implementation implementation
uses uses
{$ifdef gdb}
gdb,
{$endif gdb}
cutils,cclasses, cutils,cclasses,
verbose,systems,globtype,globals, verbose,systems,globtype,globals,
symconst,script, symconst,script,

View File

@ -263,7 +263,7 @@ implementation
lidata4,lidata5 : tasmlabel; lidata4,lidata5 : tasmlabel;
href : treference; href : treference;
begin begin
if (aktoutputformat in [as_i386_masm,as_i386_tasm,as_i386_nasmwin32]) then if (target_asm.id in [as_i386_masm,as_i386_tasm,as_i386_nasmwin32]) then
begin begin
generatenasmlib; generatenasmlib;
exit; exit;
@ -421,7 +421,7 @@ implementation
{$endif GDB} {$endif GDB}
href : treference; href : treference;
begin begin
if (aktoutputformat in [as_i386_masm,as_i386_tasm,as_i386_nasmwin32]) then if (target_asm.id in [as_i386_masm,as_i386_tasm,as_i386_nasmwin32]) then
begin begin
generatenasmlib; generatenasmlib;
exit; exit;
@ -700,7 +700,7 @@ implementation
exportfromlist(texported_item(EList_indexed.Items[i])); exportfromlist(texported_item(EList_indexed.Items[i]));
EList_indexed.Free; EList_indexed.Free;
if (aktoutputformat in [as_i386_masm,as_i386_tasm,as_i386_nasmwin32]) then if (target_asm.id in [as_i386_masm,as_i386_tasm,as_i386_nasmwin32]) then
begin begin
generatenasmlib; generatenasmlib;
exit; exit;

View File

@ -174,7 +174,7 @@ implementation
AsmWrite('['); AsmWrite('[');
if assigned(symbol) then if assigned(symbol) then
begin begin
if (aktoutputformat = as_i386_tasm) then if (target_asm.id = as_i386_tasm) then
AsmWrite('dword ptr '); AsmWrite('dword ptr ');
AsmWrite(symbol.name); AsmWrite(symbol.name);
first:=false; first:=false;
@ -306,7 +306,7 @@ implementation
begin begin
if o.ref^.refaddr=addr_no then if o.ref^.refaddr=addr_no then
begin begin
if (aktoutputformat <> as_i386_tasm) then if (target_asm.id <> as_i386_tasm) then
begin begin
if s=S_FAR then if s=S_FAR then
AsmWrite('far ptr ') AsmWrite('far ptr ')
@ -476,7 +476,7 @@ implementation
begin begin
if tai_section(hp).sectype<>sec_none then if tai_section(hp).sectype<>sec_none then
begin begin
if aktoutputformat=as_x86_64_masm then if target_asm.id=as_x86_64_masm then
begin begin
if LasTSecType<>sec_none then if LasTSecType<>sec_none then
AsmWriteLn(secnamesml64[LasTSecType]+#9#9'ENDS'); AsmWriteLn(secnamesml64[LasTSecType]+#9#9'ENDS');
@ -698,7 +698,7 @@ implementation
{ nasm prefers prefix on a line alone { nasm prefers prefix on a line alone
AsmWriteln(#9#9+prefix); but not masm PM AsmWriteln(#9#9+prefix); but not masm PM
prefix:=''; } prefix:=''; }
if aktoutputformat in [as_i386_nasmcoff,as_i386_nasmwin32,as_i386_nasmwdosx, if target_asm.id in [as_i386_nasmcoff,as_i386_nasmwin32,as_i386_nasmwdosx,
as_i386_nasmelf,as_i386_nasmobj,as_i386_nasmbeos] then as_i386_nasmelf,as_i386_nasmobj,as_i386_nasmbeos] then
begin begin
AsmWriteln(prefix); AsmWriteln(prefix);
@ -707,7 +707,7 @@ implementation
end end
else else
prefix:= ''; prefix:= '';
if (aktoutputformat = as_i386_wasm) and if (target_asm.id = as_i386_wasm) and
(taicpu(hp).opsize=S_W) and (taicpu(hp).opsize=S_W) and
(taicpu(hp).opcode=A_PUSH) and (taicpu(hp).opcode=A_PUSH) and
(taicpu(hp).oper[0]^.typ=top_const) then (taicpu(hp).oper[0]^.typ=top_const) then
@ -715,7 +715,7 @@ implementation
AsmWriteln(#9#9'DB 66h,68h ; pushw imm16'); AsmWriteln(#9#9'DB 66h,68h ; pushw imm16');
AsmWrite(#9#9'DW'); AsmWrite(#9#9'DW');
end end
else if (aktoutputformat=as_x86_64_masm) and else if (target_asm.id=as_x86_64_masm) and
(taicpu(hp).opcode=A_MOVQ) then (taicpu(hp).opcode=A_MOVQ) then
AsmWrite(#9#9'mov') AsmWrite(#9#9'mov')
else else
@ -817,7 +817,7 @@ implementation
begin begin
if tasmsymbol(p).defbind=AB_EXTERNAL then if tasmsymbol(p).defbind=AB_EXTERNAL then
begin begin
case aktoutputformat of case target_asm.id of
as_i386_masm,as_i386_wasm: as_i386_masm,as_i386_wasm:
currentasmlist.AsmWriteln(#9'EXTRN'#9+p.name currentasmlist.AsmWriteln(#9'EXTRN'#9+p.name
+': NEAR'); +': NEAR');
@ -842,7 +842,7 @@ implementation
begin begin
DoAssemble:=Inherited DoAssemble; DoAssemble:=Inherited DoAssemble;
{ masm does not seem to recognize specific extensions and uses .obj allways PM } { masm does not seem to recognize specific extensions and uses .obj allways PM }
if (aktoutputformat in [as_i386_masm,as_i386_wasm]) then if (target_asm.id in [as_i386_masm,as_i386_wasm]) then
begin begin
if not(cs_asm_extern in aktglobalswitches) then if not(cs_asm_extern in aktglobalswitches) then
begin begin
@ -868,11 +868,11 @@ implementation
comment(v_info,'Start writing intel-styled assembler output for '+current_module.mainsource^); comment(v_info,'Start writing intel-styled assembler output for '+current_module.mainsource^);
{$endif} {$endif}
LasTSecType:=sec_none; LasTSecType:=sec_none;
if aktoutputformat<>as_x86_64_masm then if target_asm.id<>as_x86_64_masm then
begin begin
AsmWriteLn(#9'.386p'); AsmWriteLn(#9'.386p');
{ masm 6.11 does not seem to like LOCALS PM } { masm 6.11 does not seem to like LOCALS PM }
if (aktoutputformat = as_i386_tasm) then if (target_asm.id = as_i386_tasm) then
begin begin
AsmWriteLn(#9'LOCALS '+target_asm.labelprefix); AsmWriteLn(#9'LOCALS '+target_asm.labelprefix);
end; end;