symsym.inc 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl, Pierre Muller
  4. Implementation for the symbols types of the symtable
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. {****************************************************************************
  19. TSYM (base for all symtypes)
  20. ****************************************************************************}
  21. constructor tsym.init(const n : string);
  22. begin
  23. {$ifdef STORENUMBER}
  24. inherited init;
  25. {$else}
  26. indexnb:=0;
  27. {$endif}
  28. left:=nil;
  29. right:=nil;
  30. {$ifdef nextfield}
  31. nextsym:=nil;
  32. {$endif nextfield}
  33. setname(n);
  34. typ:=abstractsym;
  35. properties:=current_object_option;
  36. {$ifdef GDB}
  37. isstabwritten := false;
  38. {$endif GDB}
  39. fileinfo:=tokenpos;
  40. defref:=nil;
  41. lastwritten:=nil;
  42. refcount:=0;
  43. if (cs_browser in aktmoduleswitches) and make_ref then
  44. begin
  45. defref:=new(pref,init(defref,@tokenpos));
  46. inc(refcount);
  47. end;
  48. lastref:=defref;
  49. end;
  50. constructor tsym.load;
  51. begin
  52. {$ifdef STORENUMBER}
  53. inherited init;
  54. indexnr:=readlong;
  55. {$endif}
  56. left:=nil;
  57. right:=nil;
  58. setname(readstring);
  59. typ:=abstractsym;
  60. fillchar(fileinfo,sizeof(fileinfo),0);
  61. if object_options then
  62. properties:=symprop(readbyte)
  63. else
  64. properties:=sp_public;
  65. lastref:=nil;
  66. defref:=nil;
  67. lastwritten:=nil;
  68. refcount:=0;
  69. {$ifdef GDB}
  70. isstabwritten := false;
  71. {$endif GDB}
  72. end;
  73. procedure tsym.load_references;
  74. var
  75. pos : tfileposinfo;
  76. move_last : boolean;
  77. begin
  78. move_last:=lastwritten=lastref;
  79. while (not current_ppu^.endofentry) do
  80. begin
  81. readposinfo(pos);
  82. inc(refcount);
  83. lastref:=new(pref,init(lastref,@pos));
  84. lastref^.is_written:=true;
  85. if refcount=1 then
  86. defref:=lastref;
  87. end;
  88. if move_last then
  89. lastwritten:=lastref;
  90. end;
  91. { big problem here :
  92. wrong refs were written because of
  93. interface parsing of other units PM
  94. moduleindex must be checked !! }
  95. function tsym.write_references : boolean;
  96. var
  97. ref : pref;
  98. symref_written,move_last : boolean;
  99. begin
  100. write_references:=false;
  101. if lastwritten=lastref then
  102. exit;
  103. { should we update lastref }
  104. move_last:=true;
  105. symref_written:=false;
  106. { write symbol refs }
  107. if assigned(lastwritten) then
  108. ref:=lastwritten
  109. else
  110. ref:=defref;
  111. while assigned(ref) do
  112. begin
  113. if ref^.moduleindex=current_module^.unit_index then
  114. begin
  115. { write address to this symbol }
  116. if not symref_written then
  117. begin
  118. writesymref(@self);
  119. symref_written:=true;
  120. end;
  121. writeposinfo(ref^.posinfo);
  122. ref^.is_written:=true;
  123. if move_last then
  124. lastwritten:=ref;
  125. end
  126. else if not ref^.is_written then
  127. move_last:=false
  128. else if move_last then
  129. lastwritten:=ref;
  130. ref:=ref^.nextref;
  131. end;
  132. if symref_written then
  133. current_ppu^.writeentry(ibsymref);
  134. write_references:=symref_written;
  135. end;
  136. {$ifdef BrowserLog}
  137. procedure tsym.add_to_browserlog;
  138. begin
  139. if assigned(defref) then
  140. begin
  141. browserlog.AddLog('***'+name+'***');
  142. browserlog.AddLogRefs(defref);
  143. end;
  144. end;
  145. {$endif BrowserLog}
  146. destructor tsym.done;
  147. begin
  148. {$ifdef tp}
  149. if not(use_big) then
  150. {$endif tp}
  151. strdispose(_name);
  152. if assigned(defref) then
  153. dispose(defref,done);
  154. {$ifndef STORENUMBER}
  155. if assigned(left) then
  156. dispose(left,done);
  157. if assigned(right) then
  158. dispose(right,done);
  159. {$endif}
  160. end;
  161. procedure tsym.write;
  162. begin
  163. {$ifdef STORENUMBER}
  164. writelong(indexnr);
  165. {$endif}
  166. writestring(name);
  167. if object_options then
  168. writebyte(byte(properties));
  169. end;
  170. procedure tsym.deref;
  171. begin
  172. end;
  173. function tsym.name : string;
  174. {$ifdef tp}
  175. var
  176. s : string;
  177. b : byte;
  178. {$endif}
  179. begin
  180. {$ifdef tp}
  181. if use_big then
  182. begin
  183. symbolstream.seek(longint(_name));
  184. symbolstream.read(b,1);
  185. symbolstream.read(s[1],b);
  186. s[0]:=chr(b);
  187. name:=s;
  188. end
  189. else
  190. {$endif}
  191. if assigned(_name) then
  192. name:=strpas(_name)
  193. else
  194. name:='';
  195. end;
  196. function tsym.mangledname : string;
  197. begin
  198. mangledname:=name;
  199. end;
  200. procedure tsym.setname(const s : string);
  201. begin
  202. setstring(_name,s);
  203. end;
  204. { for most symbol types there is nothing to do at all }
  205. procedure tsym.insert_in_data;
  206. begin
  207. end;
  208. {$ifdef GDB}
  209. function tsym.stabstring : pchar;
  210. begin
  211. stabstring:=strpnew('"'+name+'",'+tostr(N_LSYM)+',0,'+
  212. tostr(fileinfo.line)+',0');
  213. end;
  214. procedure tsym.concatstabto(asmlist : paasmoutput);
  215. var stab_str : pchar;
  216. begin
  217. if not isstabwritten then
  218. begin
  219. stab_str := stabstring;
  220. if asmlist = debuglist then do_count_dbx := true;
  221. { count_dbx(stab_str); moved to GDB.PAS }
  222. asmlist^.concat(new(pai_stabs,init(stab_str)));
  223. isstabwritten:=true;
  224. end;
  225. end;
  226. {$endif GDB}
  227. {****************************************************************************
  228. TLABELSYM
  229. ****************************************************************************}
  230. constructor tlabelsym.init(const n : string; l : plabel);
  231. begin
  232. inherited init(n);
  233. typ:=labelsym;
  234. number:=l;
  235. number^.is_used:=false;
  236. number^.is_set:=true;
  237. number^.refcount:=0;
  238. defined:=false;
  239. end;
  240. constructor tlabelsym.load;
  241. begin
  242. tsym.load;
  243. typ:=labelsym;
  244. { this is all dummy
  245. it is only used for local browsing }
  246. number:=nil;
  247. defined:=true;
  248. end;
  249. destructor tlabelsym.done;
  250. begin
  251. inherited done;
  252. end;
  253. function tlabelsym.mangledname : string;
  254. begin
  255. { this also sets the is_used field }
  256. mangledname:=lab2str(number);
  257. end;
  258. procedure tlabelsym.write;
  259. begin
  260. if owner^.symtabletype in [unitsymtable,globalsymtable] then
  261. Message(sym_e_ill_label_decl)
  262. else
  263. begin
  264. tsym.write;
  265. current_ppu^.writeentry(iblabelsym);
  266. end;
  267. end;
  268. {****************************************************************************
  269. TUNITSYM
  270. ****************************************************************************}
  271. constructor tunitsym.init(const n : string;ref : punitsymtable);
  272. var
  273. old_make_ref : boolean;
  274. begin
  275. old_make_ref:=make_ref;
  276. make_ref:=false;
  277. inherited init(n);
  278. make_ref:=old_make_ref;
  279. typ:=unitsym;
  280. unitsymtable:=ref;
  281. prevsym:=ref^.unitsym;
  282. ref^.unitsym:=@self;
  283. refs:=0;
  284. end;
  285. constructor tunitsym.load;
  286. begin
  287. tsym.load;
  288. typ:=unitsym;
  289. unitsymtable:=punitsymtable(current_module^.globalsymtable);
  290. prevsym:=nil;
  291. end;
  292. destructor tunitsym.done;
  293. begin
  294. if assigned(unitsymtable) and (unitsymtable^.unitsym=@self) then
  295. unitsymtable^.unitsym:=prevsym;
  296. inherited done;
  297. end;
  298. procedure tunitsym.write;
  299. begin
  300. tsym.write;
  301. current_ppu^.writeentry(ibunitsym);
  302. end;
  303. {$ifdef GDB}
  304. procedure tunitsym.concatstabto(asmlist : paasmoutput);
  305. begin
  306. {Nothing to write to stabs !}
  307. end;
  308. {$endif GDB}
  309. {****************************************************************************
  310. TPROCSYM
  311. ****************************************************************************}
  312. constructor tprocsym.init(const n : string);
  313. begin
  314. tsym.init(n);
  315. typ:=procsym;
  316. definition:=nil;
  317. owner:=nil;
  318. {$ifdef GDB}
  319. is_global := false;
  320. {$endif GDB}
  321. end;
  322. constructor tprocsym.load;
  323. begin
  324. tsym.load;
  325. typ:=procsym;
  326. definition:=pprocdef(readdefref);
  327. {$ifdef GDB}
  328. is_global := false;
  329. {$endif GDB}
  330. end;
  331. destructor tprocsym.done;
  332. begin
  333. check_forward;
  334. tsym.done;
  335. end;
  336. function tprocsym.mangledname : string;
  337. begin
  338. mangledname:=definition^.mangledname;
  339. end;
  340. function tprocsym.demangledname:string;
  341. begin
  342. demangledname:=name+definition^.demangled_paras;
  343. end;
  344. procedure tprocsym.write_parameter_lists;
  345. var
  346. p : pprocdef;
  347. begin
  348. p:=definition;
  349. while assigned(p) do
  350. begin
  351. { force the error to be printed }
  352. Verbose.Message1(sym_b_param_list,name+p^.demangled_paras);
  353. p:=p^.nextoverloaded;
  354. end;
  355. end;
  356. procedure tprocsym.check_forward;
  357. var
  358. pd : pprocdef;
  359. oldaktfilepos : tfileposinfo;
  360. begin
  361. { don't check if errors !! }
  362. if Errorcount>0 then
  363. exit;
  364. pd:=definition;
  365. while assigned(pd) do
  366. begin
  367. if pd^.forwarddef then
  368. begin
  369. oldaktfilepos:=aktfilepos;
  370. aktfilepos:=fileinfo;
  371. if assigned(pd^._class) then
  372. Message1(sym_e_forward_not_resolved,pd^._class^.name^+'.'+name+demangledparas(pd^.demangled_paras))
  373. else
  374. Message1(sym_e_forward_not_resolved,name+pd^.demangled_paras);
  375. aktfilepos:=oldaktfilepos;
  376. end;
  377. pd:=pd^.nextoverloaded;
  378. end;
  379. end;
  380. procedure tprocsym.deref;
  381. var
  382. t : ttoken;
  383. last : pprocdef;
  384. begin
  385. resolvedef(pdef(definition));
  386. if (definition^.options and pooperator) <> 0 then
  387. begin
  388. last:=definition;
  389. while assigned(last^.nextoverloaded) do
  390. last:=last^.nextoverloaded;
  391. for t:=first_overloaded to last_overloaded do
  392. if (name=overloaded_names[t]) then
  393. begin
  394. if assigned(overloaded_operators[t]) then
  395. last^.nextoverloaded:=overloaded_operators[t]^.definition;
  396. overloaded_operators[t]:=@self;
  397. end;
  398. end;
  399. end;
  400. procedure tprocsym.write;
  401. begin
  402. tsym.write;
  403. writedefref(pdef(definition));
  404. current_ppu^.writeentry(ibprocsym);
  405. end;
  406. procedure tprocsym.load_references;
  407. (* var
  408. prdef,prdef2 : pprocdef;
  409. b : byte; *)
  410. begin
  411. inherited load_references;
  412. (* prdef:=definition;
  413. { take care about operators !! }
  414. if (current_module^.flags and uf_has_browser) <>0 then
  415. while assigned(prdef) and (prdef^.owner=definition^.owner) do
  416. begin
  417. b:=current_ppu^.readentry;
  418. if b<>ibdefref then
  419. Message(unit_f_ppu_read_error);
  420. prdef2:=pprocdef(readdefref);
  421. resolvedef(prdef2);
  422. if prdef<>prdef2 then
  423. Message(unit_f_ppu_read_error);
  424. prdef^.load_references;
  425. prdef:=prdef^.nextoverloaded;
  426. end; *)
  427. end;
  428. function tprocsym.write_references : boolean;
  429. var
  430. prdef : pprocdef;
  431. begin
  432. write_references:=false;
  433. if not inherited write_references then
  434. exit;
  435. write_references:=true;
  436. prdef:=definition;
  437. while assigned(prdef) and (prdef^.owner=definition^.owner) do
  438. begin
  439. prdef^.write_references;
  440. prdef:=prdef^.nextoverloaded;
  441. end;
  442. end;
  443. {$ifdef BrowserLog}
  444. procedure tprocsym.add_to_browserlog;
  445. var
  446. prdef : pprocdef;
  447. begin
  448. inherited add_to_browserlog;
  449. prdef:=definition;
  450. while assigned(prdef) do
  451. begin
  452. pprocdef(prdef)^.add_to_browserlog;
  453. prdef:=pprocdef(prdef)^.nextoverloaded;
  454. end;
  455. end;
  456. {$endif BrowserLog}
  457. {$ifdef GDB}
  458. function tprocsym.stabstring : pchar;
  459. Var RetType : Char;
  460. Obj,Info : String;
  461. stabsstr : string;
  462. p : pchar;
  463. begin
  464. obj := name;
  465. info := '';
  466. if is_global then
  467. RetType := 'F'
  468. else
  469. RetType := 'f';
  470. if assigned(owner) then
  471. begin
  472. if (owner^.symtabletype = objectsymtable) then
  473. obj := owner^.name^+'__'+name;
  474. { this code was correct only as long as the local symboltable
  475. of the parent had the same name as the function
  476. but this is no true anymore !! PM
  477. if (owner^.symtabletype=localsymtable) and assigned(owner^.name) then
  478. info := ','+name+','+owner^.name^; }
  479. if (owner^.symtabletype=localsymtable) and assigned(owner^.defowner) and
  480. assigned(owner^.defowner^.sym) then
  481. info := ','+name+','+owner^.defowner^.sym^.name;
  482. end;
  483. stabsstr:=definition^.mangledname;
  484. getmem(p,length(stabsstr)+255);
  485. strpcopy(p,'"'+obj+':'+RetType
  486. +definition^.retdef^.numberstring+info+'",'+tostr(n_function)
  487. +',0,'+
  488. tostr(aktfilepos.line)
  489. +',');
  490. strpcopy(strend(p),stabsstr);
  491. stabstring:=strnew(p);
  492. freemem(p,length(stabsstr)+255);
  493. end;
  494. procedure tprocsym.concatstabto(asmlist : paasmoutput);
  495. begin
  496. if (definition^.options and pointernproc) <> 0 then exit;
  497. if not isstabwritten then
  498. asmlist^.concat(new(pai_stabs,init(stabstring)));
  499. isstabwritten := true;
  500. if assigned(definition^.parast) then
  501. definition^.parast^.concatstabto(asmlist);
  502. if assigned(definition^.localst) then
  503. definition^.localst^.concatstabto(asmlist);
  504. definition^.is_def_stab_written := true;
  505. end;
  506. {$endif GDB}
  507. {****************************************************************************
  508. TPROGRAMSYM
  509. ****************************************************************************}
  510. constructor tprogramsym.init(const n : string);
  511. begin
  512. inherited init(n);
  513. typ:=programsym;
  514. end;
  515. {****************************************************************************
  516. TERRORSYM
  517. ****************************************************************************}
  518. constructor terrorsym.init;
  519. begin
  520. inherited init('');
  521. typ:=errorsym;
  522. end;
  523. {****************************************************************************
  524. TPROPERTYSYM
  525. ****************************************************************************}
  526. constructor tpropertysym.init(const n : string);
  527. begin
  528. inherited init(n);
  529. typ:=propertysym;
  530. options:=0;
  531. proptype:=nil;
  532. readaccessdef:=nil;
  533. writeaccessdef:=nil;
  534. readaccesssym:=nil;
  535. writeaccesssym:=nil;
  536. storedsym:=nil;
  537. storeddef:=nil;
  538. index:=0;
  539. default:=0;
  540. end;
  541. destructor tpropertysym.done;
  542. begin
  543. inherited done;
  544. end;
  545. constructor tpropertysym.load;
  546. begin
  547. inherited load;
  548. typ:=propertysym;
  549. proptype:=readdefref;
  550. options:=readlong;
  551. index:=readlong;
  552. default:=readlong;
  553. { it's hack ... }
  554. readaccesssym:=psym(stringdup(readstring));
  555. writeaccesssym:=psym(stringdup(readstring));
  556. storedsym:=psym(stringdup(readstring));
  557. { now the defs: }
  558. readaccessdef:=readdefref;
  559. writeaccessdef:=readdefref;
  560. storeddef:=readdefref;
  561. end;
  562. procedure tpropertysym.deref;
  563. begin
  564. resolvedef(proptype);
  565. resolvedef(readaccessdef);
  566. resolvedef(writeaccessdef);
  567. resolvedef(storeddef);
  568. { solve the hack we did in load: }
  569. if pstring(readaccesssym)^<>'' then
  570. begin
  571. srsym:=search_class_member(pobjectdef(owner^.defowner),pstring(readaccesssym)^);
  572. if not(assigned(srsym)) then
  573. srsym:=generrorsym;
  574. end
  575. else
  576. srsym:=nil;
  577. stringdispose(pstring(readaccesssym));
  578. readaccesssym:=srsym;
  579. if pstring(writeaccesssym)^<>'' then
  580. begin
  581. srsym:=search_class_member(pobjectdef(owner^.defowner),pstring(writeaccesssym)^);
  582. if not(assigned(srsym)) then
  583. srsym:=generrorsym;
  584. end
  585. else
  586. srsym:=nil;
  587. stringdispose(pstring(writeaccesssym));
  588. writeaccesssym:=srsym;
  589. if pstring(storedsym)^<>'' then
  590. begin
  591. srsym:=search_class_member(pobjectdef(owner^.defowner),pstring(storedsym)^);
  592. if not(assigned(srsym)) then
  593. srsym:=generrorsym;
  594. end
  595. else
  596. srsym:=nil;
  597. stringdispose(pstring(storedsym));
  598. storedsym:=srsym;
  599. end;
  600. function tpropertysym.getsize : longint;
  601. begin
  602. getsize:=0;
  603. end;
  604. procedure tpropertysym.write;
  605. begin
  606. tsym.write;
  607. writedefref(proptype);
  608. writelong(options);
  609. writelong(index);
  610. writelong(default);
  611. if assigned(readaccesssym) then
  612. writestring(readaccesssym^.name)
  613. else
  614. writestring('');
  615. if assigned(writeaccesssym) then
  616. writestring(writeaccesssym^.name)
  617. else
  618. writestring('');
  619. if assigned(storedsym) then
  620. writestring(storedsym^.name)
  621. else
  622. writestring('');
  623. writedefref(readaccessdef);
  624. writedefref(writeaccessdef);
  625. writedefref(storeddef);
  626. current_ppu^.writeentry(ibpropertysym);
  627. end;
  628. {$ifdef GDB}
  629. function tpropertysym.stabstring : pchar;
  630. begin
  631. { !!!! don't know how to handle }
  632. stabstring:=strpnew('');
  633. end;
  634. procedure tpropertysym.concatstabto(asmlist : paasmoutput);
  635. begin
  636. { !!!! don't know how to handle }
  637. end;
  638. {$endif GDB}
  639. {****************************************************************************
  640. TFUNCRETSYM
  641. ****************************************************************************}
  642. constructor tfuncretsym.init(const n : string;approcinfo : pointer{pprocinfo});
  643. begin
  644. tsym.init(n);
  645. typ:=funcretsym;
  646. funcretprocinfo:=approcinfo;
  647. funcretdef:=pprocinfo(approcinfo)^.retdef;
  648. { address valid for ret in param only }
  649. { otherwise set by insert }
  650. address:=pprocinfo(approcinfo)^.retoffset;
  651. end;
  652. constructor tfuncretsym.load;
  653. begin
  654. tsym.load;
  655. funcretdef:=readdefref;
  656. address:=readlong;
  657. funcretprocinfo:=nil;
  658. typ:=funcretsym;
  659. end;
  660. procedure tfuncretsym.write;
  661. begin
  662. (*
  663. Normally all references are
  664. transfered to the function symbol itself !! PM *)
  665. tsym.write;
  666. writedefref(funcretdef);
  667. writelong(address);
  668. current_ppu^.writeentry(ibfuncretsym);
  669. end;
  670. procedure tfuncretsym.deref;
  671. begin
  672. resolvedef(funcretdef);
  673. end;
  674. {$ifdef GDB}
  675. procedure tfuncretsym.concatstabto(asmlist : paasmoutput);
  676. begin
  677. { Nothing to do here, it is done in genexitcode }
  678. end;
  679. {$endif GDB}
  680. procedure tfuncretsym.insert_in_data;
  681. var
  682. l : longint;
  683. begin
  684. { allocate space in local if ret in acc or in fpu }
  685. if ret_in_acc(procinfo.retdef) or (procinfo.retdef^.deftype=floatdef) then
  686. begin
  687. l:=funcretdef^.size;
  688. inc(owner^.datasize,l);
  689. {$ifdef m68k}
  690. { word alignment required for motorola }
  691. if (l=1) then
  692. inc(owner^.datasize,1)
  693. else
  694. {$endif}
  695. if (l>=4) and ((owner^.datasize and 3)<>0) then
  696. inc(owner^.datasize,4-(owner^.datasize and 3))
  697. else if (l>=2) and ((owner^.datasize and 1)<>0) then
  698. inc(owner^.datasize,2-(owner^.datasize and 1));
  699. address:=owner^.datasize;
  700. procinfo.retoffset:=-owner^.datasize;
  701. end;
  702. end;
  703. {****************************************************************************
  704. TABSOLUTESYM
  705. ****************************************************************************}
  706. constructor tabsolutesym.init(const n : string;p : pdef);
  707. begin
  708. inherited init(n,p);
  709. typ:=absolutesym;
  710. end;
  711. constructor tabsolutesym.load;
  712. begin
  713. tvarsym.load;
  714. typ:=absolutesym;
  715. ref:=nil;
  716. address:=0;
  717. asmname:=nil;
  718. abstyp:=absolutetyp(readbyte);
  719. absseg:=false;
  720. case abstyp of
  721. tovar :
  722. begin
  723. asmname:=stringdup(readstring);
  724. ref:=srsym;
  725. end;
  726. toasm :
  727. asmname:=stringdup(readstring);
  728. toaddr :
  729. begin
  730. address:=readlong;
  731. absseg:=boolean(readbyte);
  732. end;
  733. end;
  734. end;
  735. procedure tabsolutesym.write;
  736. begin
  737. tsym.write;
  738. writebyte(byte(varspez));
  739. if read_member then
  740. writelong(address);
  741. writedefref(definition);
  742. writebyte(var_options and (not vo_regable));
  743. writebyte(byte(abstyp));
  744. case abstyp of
  745. tovar :
  746. writestring(ref^.name);
  747. toasm :
  748. writestring(asmname^);
  749. toaddr :
  750. begin
  751. writelong(address);
  752. writebyte(byte(absseg));
  753. end;
  754. end;
  755. current_ppu^.writeentry(ibabsolutesym);
  756. end;
  757. procedure tabsolutesym.deref;
  758. begin
  759. resolvedef(definition);
  760. if (abstyp=tovar) and (asmname<>nil) then
  761. begin
  762. { search previous loaded symtables }
  763. getsym(asmname^,false);
  764. if not(assigned(srsym)) then
  765. getsymonlyin(owner,asmname^);
  766. if not(assigned(srsym)) then
  767. srsym:=generrorsym;
  768. ref:=srsym;
  769. stringdispose(asmname);
  770. end;
  771. end;
  772. function tabsolutesym.mangledname : string;
  773. begin
  774. case abstyp of
  775. tovar :
  776. mangledname:=ref^.mangledname;
  777. toasm :
  778. mangledname:=asmname^;
  779. toaddr :
  780. mangledname:='$'+tostr(address);
  781. else
  782. internalerror(10002);
  783. end;
  784. end;
  785. procedure tabsolutesym.insert_in_data;
  786. begin
  787. end;
  788. {$ifdef GDB}
  789. procedure tabsolutesym.concatstabto(asmlist : paasmoutput);
  790. begin
  791. { I don't know how to handle this !! }
  792. end;
  793. {$endif GDB}
  794. {****************************************************************************
  795. TVARSYM
  796. ****************************************************************************}
  797. constructor tvarsym.init(const n : string;p : pdef);
  798. begin
  799. tsym.init(n);
  800. typ:=varsym;
  801. definition:=p;
  802. _mangledname:=nil;
  803. varspez:=vs_value;
  804. address:=0;
  805. islocalcopy:=false;
  806. localvarsym:=nil;
  807. refs:=0;
  808. is_valid := 1;
  809. var_options:=0;
  810. { can we load the value into a register ? }
  811. case p^.deftype of
  812. pointerdef,
  813. enumdef,
  814. procvardef :
  815. var_options:=var_options or vo_regable;
  816. orddef :
  817. case porddef(p)^.typ of
  818. bool8bit,bool16bit,bool32bit,
  819. u8bit,u16bit,u32bit,
  820. s8bit,s16bit,s32bit :
  821. var_options:=var_options or vo_regable;
  822. else
  823. var_options:=var_options and not vo_regable;
  824. end;
  825. setdef:
  826. if psetdef(p)^.settype=smallset then
  827. var_options:=var_options or vo_regable;
  828. else
  829. var_options:=var_options and not vo_regable;
  830. end;
  831. reg:=R_NO;
  832. end;
  833. constructor tvarsym.init_dll(const n : string;p : pdef);
  834. begin
  835. { The tvarsym is necessary for 0.99.5 (PFV) }
  836. tvarsym.init(n,p);
  837. var_options:=var_options or vo_is_dll_var;
  838. end;
  839. constructor tvarsym.init_C(const n,mangled : string;p : pdef);
  840. begin
  841. { The tvarsym is necessary for 0.99.5 (PFV) }
  842. tvarsym.init(n,p);
  843. var_options:=var_options or vo_is_C_var;
  844. setmangledname(mangled);
  845. end;
  846. constructor tvarsym.load;
  847. begin
  848. tsym.load;
  849. typ:=varsym;
  850. _mangledname:=nil;
  851. reg:=R_NO;
  852. refs := 0;
  853. is_valid := 1;
  854. varspez:=tvarspez(readbyte);
  855. if read_member then
  856. address:=readlong
  857. else
  858. address:=0;
  859. islocalcopy:=false;
  860. localvarsym:=nil;
  861. definition:=readdefref;
  862. var_options:=readbyte;
  863. if (var_options and vo_is_C_var)<>0 then
  864. setmangledname(readstring);
  865. end;
  866. procedure tvarsym.deref;
  867. begin
  868. resolvedef(definition);
  869. end;
  870. procedure tvarsym.write;
  871. begin
  872. tsym.write;
  873. writebyte(byte(varspez));
  874. if read_member then
  875. writelong(address);
  876. writedefref(definition);
  877. { symbols which are load are never candidates for a register,
  878. turn of the regable }
  879. writebyte(var_options and (not vo_regable));
  880. if (var_options and vo_is_C_var)<>0 then
  881. writestring(mangledname);
  882. current_ppu^.writeentry(ibvarsym);
  883. end;
  884. procedure tvarsym.setmangledname(const s : string);
  885. begin
  886. _mangledname:=strpnew(s);
  887. end;
  888. function tvarsym.mangledname : string;
  889. var
  890. prefix : string;
  891. begin
  892. if assigned(_mangledname) then
  893. begin
  894. mangledname:=strpas(_mangledname);
  895. exit;
  896. end;
  897. case owner^.symtabletype of
  898. staticsymtable :
  899. if (cs_smartlink in aktmoduleswitches) then
  900. prefix:='_'+owner^.name^+'$$$_'
  901. else
  902. prefix:='_';
  903. unitsymtable,
  904. globalsymtable :
  905. prefix:='U_'+owner^.name^+'_';
  906. else
  907. Message(sym_e_invalid_call_tvarsymmangledname);
  908. end;
  909. mangledname:=prefix+name;
  910. end;
  911. function tvarsym.getsize : longint;
  912. begin
  913. if assigned(definition) and (varspez=vs_value) then
  914. getsize:=definition^.size
  915. else
  916. getsize:=0;
  917. end;
  918. function tvarsym.getpushsize : longint;
  919. begin
  920. if assigned(definition) then
  921. begin
  922. case varspez of
  923. vs_var :
  924. getpushsize:=target_os.size_of_pointer;
  925. vs_value,
  926. vs_const :
  927. begin
  928. case definition^.deftype of
  929. arraydef,
  930. setdef,
  931. stringdef,
  932. recorddef,
  933. objectdef :
  934. getpushsize:=target_os.size_of_pointer;
  935. else
  936. getpushsize:=definition^.size;
  937. end;
  938. end;
  939. end;
  940. end
  941. else
  942. getpushsize:=0;
  943. end;
  944. procedure tvarsym.insert_in_data;
  945. var
  946. l,modulo : longint;
  947. begin
  948. if (var_options and vo_is_external)<>0 then
  949. exit;
  950. { handle static variables of objects especially }
  951. if read_member and (owner^.symtabletype=objectsymtable) and
  952. ((properties and sp_static)<>0) then
  953. begin
  954. { the data filed is generated in parser.pas
  955. with a tobject_FIELDNAME variable }
  956. { this symbol can't be loaded to a register }
  957. var_options:=var_options and not vo_regable;
  958. end
  959. else
  960. if not(read_member) then
  961. begin
  962. { made problems with parameters etc. ! (FK) }
  963. { check for instance of an abstract object or class }
  964. {
  965. if (pvarsym(sym)^.definition^.deftype=objectdef) and
  966. ((pobjectdef(pvarsym(sym)^.definition)^.options and oo_is_abstract)<>0) then
  967. Message(sym_e_no_instance_of_abstract_object);
  968. }
  969. l:=getsize;
  970. case owner^.symtabletype of
  971. stt_exceptsymtable:
  972. { can contain only one symbol, address calculated later }
  973. ;
  974. localsymtable :
  975. begin
  976. is_valid := 0;
  977. modulo:=owner^.datasize and 3;
  978. {$ifdef m68k}
  979. { word alignment required for motorola }
  980. if (l=1) then
  981. l:=2
  982. else
  983. {$endif}
  984. if (l>=4) and (modulo<>0) then
  985. inc(l,4-modulo)
  986. else
  987. if (l>=2) and ((modulo and 1)<>0) then
  988. inc(l,2-(modulo and 1));
  989. inc(owner^.datasize,l);
  990. address:=owner^.datasize;
  991. end;
  992. staticsymtable :
  993. begin
  994. { enable unitilized warning for local symbols }
  995. is_valid := 0;
  996. if (cs_smartlink in aktmoduleswitches) then
  997. bsssegment^.concat(new(pai_cut,init));
  998. {$ifdef GDB}
  999. if cs_debuginfo in aktmoduleswitches then
  1000. concatstabto(bsssegment);
  1001. {$endif GDB}
  1002. if (cs_smartlink in aktmoduleswitches) or
  1003. ((var_options and vo_is_c_var)<>0) then
  1004. bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)))
  1005. else
  1006. bsssegment^.concat(new(pai_datablock,init(mangledname,l)));
  1007. { increase datasize }
  1008. inc(owner^.datasize,l);
  1009. { this symbol can't be loaded to a register }
  1010. var_options:=var_options and not vo_regable;
  1011. end;
  1012. globalsymtable :
  1013. begin
  1014. if (cs_smartlink in aktmoduleswitches) then
  1015. bsssegment^.concat(new(pai_cut,init));
  1016. {$ifdef GDB}
  1017. if cs_debuginfo in aktmoduleswitches then
  1018. concatstabto(bsssegment);
  1019. {$endif GDB}
  1020. bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)));
  1021. inc(owner^.datasize,l);
  1022. { this symbol can't be loaded to a register }
  1023. var_options:=var_options and not vo_regable;
  1024. end;
  1025. recordsymtable,
  1026. objectsymtable :
  1027. begin
  1028. { this symbol can't be loaded to a register }
  1029. var_options:=var_options and not vo_regable;
  1030. { align record and object fields }
  1031. if (l=1) or (aktpackrecords=1) then
  1032. begin
  1033. address:=owner^.datasize;
  1034. inc(owner^.datasize,l)
  1035. end
  1036. else
  1037. if (l=2) or (aktpackrecords=2) then
  1038. begin
  1039. owner^.datasize:=(owner^.datasize+1) and (not 1);
  1040. address:=owner^.datasize;
  1041. inc(owner^.datasize,l)
  1042. end
  1043. else
  1044. if (l<=4) or (aktpackrecords=4) then
  1045. begin
  1046. owner^.datasize:=(owner^.datasize+3) and (not 3);
  1047. address:=owner^.datasize;
  1048. inc(owner^.datasize,l);
  1049. end
  1050. else
  1051. if (l<=8) or (aktpackrecords=8) then
  1052. begin
  1053. owner^.datasize:=(owner^.datasize+7) and (not 7);
  1054. address:=owner^.datasize;
  1055. inc(owner^.datasize,l);
  1056. end
  1057. else
  1058. if (l<=16) or (aktpackrecords=16) then
  1059. begin
  1060. owner^.datasize:=(owner^.datasize+15) and (not 15);
  1061. address:=owner^.datasize;
  1062. inc(owner^.datasize,l);
  1063. end
  1064. else
  1065. if (l<=32) or (aktpackrecords=32) then
  1066. begin
  1067. owner^.datasize:=(owner^.datasize+31) and (not 31);
  1068. address:=owner^.datasize;
  1069. inc(owner^.datasize,l);
  1070. end;
  1071. end;
  1072. parasymtable :
  1073. begin
  1074. { here we need the size of a push instead of the
  1075. size of the data }
  1076. l:=getpushsize;
  1077. address:=owner^.datasize;
  1078. owner^.datasize:=align(owner^.datasize+l,target_os.stackalignment);
  1079. end
  1080. else
  1081. begin
  1082. modulo:=owner^.datasize and 3 ;
  1083. if (l>=4) and (modulo<>0) then
  1084. inc(owner^.datasize,4-modulo)
  1085. else
  1086. if (l>=2) and ((modulo and 1)<>0) then
  1087. inc(owner^.datasize);
  1088. address:=owner^.datasize;
  1089. inc(owner^.datasize,l);
  1090. end;
  1091. end;
  1092. end;
  1093. end;
  1094. {$ifdef GDB}
  1095. function tvarsym.stabstring : pchar;
  1096. var
  1097. st : char;
  1098. begin
  1099. if (owner^.symtabletype = objectsymtable) and
  1100. ((properties and sp_static)<>0) then
  1101. begin
  1102. if (cs_gdb_gsym in aktglobalswitches) then st := 'G' else st := 'S';
  1103. stabstring := strpnew('"'+owner^.name^+'__'+name+':'+
  1104. +definition^.numberstring+'",'+
  1105. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1106. end
  1107. else if (owner^.symtabletype = globalsymtable) or
  1108. (owner^.symtabletype = unitsymtable) then
  1109. begin
  1110. { Here we used S instead of
  1111. because with G GDB doesn't look at the address field
  1112. but searches the same name or with a leading underscore
  1113. but these names don't exist in pascal !}
  1114. if (cs_gdb_gsym in aktglobalswitches) then st := 'G' else st := 'S';
  1115. stabstring := strpnew('"'+name+':'+st
  1116. +definition^.numberstring+'",'+
  1117. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1118. end
  1119. else if owner^.symtabletype = staticsymtable then
  1120. begin
  1121. stabstring := strpnew('"'+name+':S'
  1122. +definition^.numberstring+'",'+
  1123. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1124. end
  1125. else if (owner^.symtabletype=parasymtable) then
  1126. begin
  1127. case varspez of
  1128. vs_var : st := 'v';
  1129. vs_value,
  1130. vs_const : if push_addr_param(definition) then
  1131. st := 'v' { should be 'i' but 'i' doesn't work }
  1132. else
  1133. st := 'p';
  1134. end;
  1135. stabstring := strpnew('"'+name+':'+st
  1136. +definition^.numberstring+'",'+
  1137. tostr(N_PSYM)+',0,'+tostr(fileinfo.line)+','+
  1138. tostr(address+owner^.address_fixup));
  1139. {offset to ebp => will not work if the framepointer is esp
  1140. so some optimizing will make things harder to debug }
  1141. end
  1142. else if (owner^.symtabletype=localsymtable) then
  1143. {$ifdef i386}
  1144. if reg<>R_NO then
  1145. begin
  1146. { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
  1147. { this is the register order for GDB}
  1148. stabstring:=strpnew('"'+name+':r'
  1149. +definition^.numberstring+'",'+
  1150. tostr(N_RSYM)+',0,'+
  1151. tostr(fileinfo.line)+','+tostr(GDB_i386index[reg]));
  1152. end
  1153. else
  1154. {$endif i386}
  1155. stabstring := strpnew('"'+name+':'
  1156. +definition^.numberstring+'",'+
  1157. tostr(N_LSYM)+',0,'+tostr(fileinfo.line)+',-'+tostr(address))
  1158. else
  1159. stabstring := inherited stabstring;
  1160. end;
  1161. procedure tvarsym.concatstabto(asmlist : paasmoutput);
  1162. {$ifdef i386}
  1163. var stab_str : pchar;
  1164. {$endif i386}
  1165. begin
  1166. inherited concatstabto(asmlist);
  1167. {$ifdef i386}
  1168. if (owner^.symtabletype=parasymtable) and
  1169. (reg<>R_NO) then
  1170. begin
  1171. { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
  1172. { this is the register order for GDB}
  1173. stab_str:=strpnew('"'+name+':r'
  1174. +definition^.numberstring+'",'+
  1175. tostr(N_RSYM)+',0,'+
  1176. tostr(fileinfo.line)+','+tostr(GDB_i386index[reg]));
  1177. asmlist^.concat(new(pai_stabs,init(stab_str)));
  1178. end;
  1179. {$endif i386}
  1180. end;
  1181. {$endif GDB}
  1182. destructor tvarsym.done;
  1183. begin
  1184. strdispose(_mangledname);
  1185. inherited done;
  1186. end;
  1187. {****************************************************************************
  1188. TTYPEDCONSTSYM
  1189. *****************************************************************************}
  1190. constructor ttypedconstsym.init(const n : string;p : pdef);
  1191. begin
  1192. tsym.init(n);
  1193. typ:=typedconstsym;
  1194. definition:=p;
  1195. prefix:=stringdup(procprefix);
  1196. end;
  1197. constructor ttypedconstsym.load;
  1198. begin
  1199. tsym.load;
  1200. typ:=typedconstsym;
  1201. definition:=readdefref;
  1202. prefix:=stringdup(readstring);
  1203. end;
  1204. destructor ttypedconstsym.done;
  1205. begin
  1206. stringdispose(prefix);
  1207. tsym.done;
  1208. end;
  1209. function ttypedconstsym.mangledname : string;
  1210. begin
  1211. mangledname:='TC_'+prefix^+'_'+name;
  1212. end;
  1213. function ttypedconstsym.getsize : longint;
  1214. begin
  1215. if assigned(definition) then
  1216. getsize:=definition^.size
  1217. else
  1218. getsize:=0;
  1219. end;
  1220. procedure ttypedconstsym.deref;
  1221. begin
  1222. resolvedef(definition);
  1223. end;
  1224. procedure ttypedconstsym.write;
  1225. begin
  1226. tsym.write;
  1227. writedefref(definition);
  1228. writestring(prefix^);
  1229. current_ppu^.writeentry(ibtypedconstsym);
  1230. end;
  1231. { for most symbol types ther is nothing to do at all }
  1232. procedure ttypedconstsym.insert_in_data;
  1233. begin
  1234. { here there is a problem for ansistrings !! }
  1235. { we must write the label only after the 12 header bytes (PM)
  1236. if not is_ansistring(definition) then
  1237. }
  1238. { solved, the ansis string is moved to consts (FK) }
  1239. really_insert_in_data;
  1240. end;
  1241. procedure ttypedconstsym.really_insert_in_data;
  1242. begin
  1243. if owner^.symtabletype=globalsymtable then
  1244. begin
  1245. if (cs_smartlink in aktmoduleswitches) then
  1246. datasegment^.concat(new(pai_cut,init));
  1247. {$ifdef GDB}
  1248. if cs_debuginfo in aktmoduleswitches then
  1249. concatstabto(datasegment);
  1250. {$endif GDB}
  1251. datasegment^.concat(new(pai_symbol,init_global(mangledname)));
  1252. end
  1253. else
  1254. if owner^.symtabletype<>unitsymtable then
  1255. begin
  1256. if (cs_smartlink in aktmoduleswitches) then
  1257. datasegment^.concat(new(pai_cut,init));
  1258. {$ifdef GDB}
  1259. if cs_debuginfo in aktmoduleswitches then
  1260. concatstabto(datasegment);
  1261. {$endif GDB}
  1262. if (cs_smartlink in aktmoduleswitches) then
  1263. datasegment^.concat(new(pai_symbol,init_global(mangledname)))
  1264. else
  1265. datasegment^.concat(new(pai_symbol,init(mangledname)));
  1266. end;
  1267. end;
  1268. {$ifdef GDB}
  1269. function ttypedconstsym.stabstring : pchar;
  1270. var
  1271. st : char;
  1272. begin
  1273. if (cs_gdb_gsym in aktglobalswitches) and (owner^.symtabletype in [unitsymtable,globalsymtable]) then
  1274. st := 'G'
  1275. else
  1276. st := 'S';
  1277. stabstring := strpnew('"'+name+':'+st+
  1278. definition^.numberstring+'",'+tostr(n_STSYM)+',0,'+
  1279. tostr(fileinfo.line)+','+mangledname);
  1280. end;
  1281. {$endif GDB}
  1282. {****************************************************************************
  1283. TCONSTSYM
  1284. ****************************************************************************}
  1285. constructor tconstsym.init(const n : string;t : tconsttype;v : longint);
  1286. begin
  1287. inherited init(n);
  1288. typ:=constsym;
  1289. consttype:=t;
  1290. value:=v;
  1291. definition:=nil;
  1292. len:=0;
  1293. end;
  1294. constructor tconstsym.init_def(const n : string;t : tconsttype;v : longint;def : pdef);
  1295. begin
  1296. inherited init(n);
  1297. typ:=constsym;
  1298. consttype:=t;
  1299. value:=v;
  1300. definition:=def;
  1301. len:=0;
  1302. end;
  1303. constructor tconstsym.init_string(const n : string;t : tconsttype;str:pchar;l:longint);
  1304. begin
  1305. inherited init(n);
  1306. typ:=constsym;
  1307. consttype:=t;
  1308. value:=longint(str);
  1309. definition:=nil;
  1310. len:=l;
  1311. end;
  1312. constructor tconstsym.load;
  1313. var
  1314. pd : pbestreal;
  1315. ps : pnormalset;
  1316. begin
  1317. tsym.load;
  1318. typ:=constsym;
  1319. consttype:=tconsttype(readbyte);
  1320. case consttype of
  1321. constint,
  1322. constbool,
  1323. constchar : value:=readlong;
  1324. constord :
  1325. begin
  1326. definition:=readdefref;
  1327. value:=readlong;
  1328. end;
  1329. conststring :
  1330. begin
  1331. len:=readlong;
  1332. getmem(pchar(value),len+1);
  1333. current_ppu^.getdata(pchar(value)^,len);
  1334. end;
  1335. constreal :
  1336. begin
  1337. new(pd);
  1338. pd^:=readreal;
  1339. value:=longint(pd);
  1340. end;
  1341. constset :
  1342. begin
  1343. definition:=readdefref;
  1344. new(ps);
  1345. readnormalset(ps^);
  1346. value:=longint(ps);
  1347. end;
  1348. constnil : ;
  1349. else
  1350. Message1(unit_f_ppu_invalid_entry,tostr(ord(consttype)));
  1351. end;
  1352. end;
  1353. destructor tconstsym.done;
  1354. begin
  1355. case consttype of
  1356. conststring :
  1357. freemem(pchar(value),len+1);
  1358. constreal :
  1359. dispose(pbestreal(value));
  1360. constset :
  1361. dispose(pnormalset(value));
  1362. end;
  1363. inherited done;
  1364. end;
  1365. function tconstsym.mangledname : string;
  1366. begin
  1367. mangledname:=name;
  1368. end;
  1369. procedure tconstsym.deref;
  1370. begin
  1371. if consttype in [constord,constset] then
  1372. resolvedef(pdef(definition));
  1373. end;
  1374. procedure tconstsym.write;
  1375. begin
  1376. tsym.write;
  1377. writebyte(byte(consttype));
  1378. case consttype of
  1379. constnil : ;
  1380. constint,
  1381. constbool,
  1382. constchar :
  1383. writelong(value);
  1384. constord :
  1385. begin
  1386. writedefref(definition);
  1387. writelong(value);
  1388. end;
  1389. conststring :
  1390. begin
  1391. writelong(len);
  1392. current_ppu^.putdata(pchar(value)^,len);
  1393. end;
  1394. constreal :
  1395. writereal(pbestreal(value)^);
  1396. constset :
  1397. begin
  1398. writedefref(definition);
  1399. writenormalset(pointer(value)^);
  1400. end;
  1401. else
  1402. internalerror(13);
  1403. end;
  1404. current_ppu^.writeentry(ibconstsym);
  1405. end;
  1406. {$ifdef GDB}
  1407. function tconstsym.stabstring : pchar;
  1408. var st : string;
  1409. begin
  1410. {even GDB v4.16 only now 'i' 'r' and 'e' !!!}
  1411. case consttype of
  1412. conststring : begin
  1413. { I had to remove ibm2ascii !! }
  1414. st := pstring(value)^;
  1415. {st := ibm2ascii(pstring(value)^);}
  1416. st := 's'''+st+'''';
  1417. end;
  1418. constbool, constint, constord, constchar : st := 'i'+tostr(value);
  1419. constreal : begin
  1420. system.str(pbestreal(value)^,st);
  1421. st := 'r'+st;
  1422. end;
  1423. { if we don't know just put zero !! }
  1424. else st:='i0';
  1425. {***SETCONST}
  1426. {constset:;} {*** I don't know what to do with a set.}
  1427. { sets are not recognized by GDB}
  1428. {***}
  1429. end;
  1430. stabstring := strpnew('"'+name+':c='+st+'",'+tostr(N_function)+',0,'+
  1431. tostr(fileinfo.line)+',0');
  1432. end;
  1433. procedure tconstsym.concatstabto(asmlist : paasmoutput);
  1434. begin
  1435. if consttype <> conststring then
  1436. inherited concatstabto(asmlist);
  1437. end;
  1438. {$endif GDB}
  1439. {****************************************************************************
  1440. TENUMSYM
  1441. ****************************************************************************}
  1442. constructor tenumsym.init(const n : string;def : penumdef;v : longint);
  1443. begin
  1444. tsym.init(n);
  1445. typ:=enumsym;
  1446. definition:=def;
  1447. value:=v;
  1448. if def^.min>v then
  1449. def^.setmin(v);
  1450. if def^.max<v then
  1451. def^.setmax(v);
  1452. order;
  1453. end;
  1454. constructor tenumsym.load;
  1455. begin
  1456. tsym.load;
  1457. typ:=enumsym;
  1458. definition:=penumdef(readdefref);
  1459. value:=readlong;
  1460. nextenum := Nil;
  1461. end;
  1462. procedure tenumsym.deref;
  1463. begin
  1464. resolvedef(pdef(definition));
  1465. order;
  1466. end;
  1467. procedure tenumsym.order;
  1468. var
  1469. sym : penumsym;
  1470. begin
  1471. sym := definition^.firstenum;
  1472. if sym = nil then
  1473. begin
  1474. definition^.firstenum := @self;
  1475. nextenum := nil;
  1476. exit;
  1477. end;
  1478. { reorder the symbols in increasing value }
  1479. if value < sym^.value then
  1480. begin
  1481. nextenum := sym;
  1482. definition^.firstenum := @self;
  1483. end
  1484. else
  1485. begin
  1486. while (sym^.value <= value) and assigned(sym^.nextenum) do
  1487. sym := sym^.nextenum;
  1488. nextenum := sym^.nextenum;
  1489. sym^.nextenum := @self;
  1490. end;
  1491. end;
  1492. procedure tenumsym.write;
  1493. begin
  1494. tsym.write;
  1495. writedefref(definition);
  1496. writelong(value);
  1497. current_ppu^.writeentry(ibenumsym);
  1498. end;
  1499. {$ifdef GDB}
  1500. procedure tenumsym.concatstabto(asmlist : paasmoutput);
  1501. begin
  1502. {enum elements have no stab !}
  1503. end;
  1504. {$EndIf GDB}
  1505. {****************************************************************************
  1506. TTYPESYM
  1507. ****************************************************************************}
  1508. constructor ttypesym.init(const n : string;d : pdef);
  1509. begin
  1510. tsym.init(n);
  1511. typ:=typesym;
  1512. definition:=d;
  1513. {$ifdef GDB}
  1514. isusedinstab := false;
  1515. {$endif GDB}
  1516. forwardpointer:=nil;
  1517. { this allows to link definitions with the type with declares }
  1518. { them }
  1519. if assigned(definition) then
  1520. if definition^.sym=nil then
  1521. definition^.sym:=@self;
  1522. end;
  1523. constructor ttypesym.load;
  1524. begin
  1525. tsym.load;
  1526. typ:=typesym;
  1527. forwardpointer:=nil;
  1528. {$ifdef GDB}
  1529. isusedinstab := false;
  1530. {$endif GDB}
  1531. definition:=readdefref;
  1532. end;
  1533. destructor ttypesym.done;
  1534. begin
  1535. if assigned(definition) then
  1536. if definition^.sym=@self then
  1537. definition^.sym:=nil;
  1538. inherited done;
  1539. end;
  1540. procedure ttypesym.deref;
  1541. begin
  1542. resolvedef(definition);
  1543. if assigned(definition) then
  1544. begin
  1545. if definition^.sym=nil then
  1546. definition^.sym:=@self;
  1547. if (definition^.deftype=recorddef) and assigned(precdef(definition)^.symtable) and
  1548. (definition^.sym=@self) then
  1549. precdef(definition)^.symtable^.name:=stringdup('record '+name);
  1550. end;
  1551. end;
  1552. procedure ttypesym.write;
  1553. begin
  1554. tsym.write;
  1555. writedefref(definition);
  1556. current_ppu^.writeentry(ibtypesym);
  1557. end;
  1558. procedure ttypesym.load_references;
  1559. begin
  1560. inherited load_references;
  1561. if (definition^.deftype=recorddef) then
  1562. precdef(definition)^.symtable^.load_browser;
  1563. if (definition^.deftype=objectdef) then
  1564. pobjectdef(definition)^.publicsyms^.load_browser;
  1565. end;
  1566. function ttypesym.write_references : boolean;
  1567. begin
  1568. if not inherited write_references then
  1569. { write address of this symbol if record or object
  1570. even if no real refs are there
  1571. because we need it for the symtable }
  1572. if (definition^.deftype=recorddef) or
  1573. (definition^.deftype=objectdef) then
  1574. begin
  1575. writesymref(@self);
  1576. current_ppu^.writeentry(ibsymref);
  1577. end;
  1578. write_references:=true;
  1579. if (definition^.deftype=recorddef) then
  1580. precdef(definition)^.symtable^.write_browser;
  1581. if (definition^.deftype=objectdef) then
  1582. pobjectdef(definition)^.publicsyms^.write_browser;
  1583. end;
  1584. {$ifdef BrowserLog}
  1585. procedure ttypesym.add_to_browserlog;
  1586. begin
  1587. inherited add_to_browserlog;
  1588. if (definition^.deftype=recorddef) then
  1589. precdef(definition)^.symtable^.writebrowserlog;
  1590. if (definition^.deftype=objectdef) then
  1591. pobjectdef(definition)^.publicsyms^.writebrowserlog;
  1592. end;
  1593. {$endif BrowserLog}
  1594. {$ifdef GDB}
  1595. function ttypesym.stabstring : pchar;
  1596. var stabchar : string[2];
  1597. short : string;
  1598. begin
  1599. if definition^.deftype in tagtypes then
  1600. stabchar := 'Tt'
  1601. else
  1602. stabchar := 't';
  1603. short := '"'+name+':'+stabchar+definition^.numberstring
  1604. +'",'+tostr(N_LSYM)+',0,'+tostr(fileinfo.line)+',0';
  1605. stabstring := strpnew(short);
  1606. end;
  1607. procedure ttypesym.concatstabto(asmlist : paasmoutput);
  1608. begin
  1609. {not stabs for forward defs }
  1610. if assigned(definition) then
  1611. if (definition^.sym = @self) then
  1612. definition^.concatstabto(asmlist)
  1613. else
  1614. inherited concatstabto(asmlist);
  1615. end;
  1616. {$endif GDB}
  1617. {****************************************************************************
  1618. TSYSSYM
  1619. ****************************************************************************}
  1620. constructor tsyssym.init(const n : string;l : longint);
  1621. begin
  1622. inherited init(n);
  1623. typ:=syssym;
  1624. number:=l;
  1625. end;
  1626. procedure tsyssym.write;
  1627. begin
  1628. end;
  1629. {$ifdef GDB}
  1630. procedure tsyssym.concatstabto(asmlist : paasmoutput);
  1631. begin
  1632. end;
  1633. {$endif GDB}
  1634. {****************************************************************************
  1635. TMACROSYM
  1636. ****************************************************************************}
  1637. constructor tmacrosym.init(const n : string);
  1638. begin
  1639. inherited init(n);
  1640. typ:=macrosym;
  1641. defined:=true;
  1642. buftext:=nil;
  1643. buflen:=0;
  1644. end;
  1645. destructor tmacrosym.done;
  1646. begin
  1647. if assigned(buftext) then
  1648. freemem(buftext,buflen);
  1649. inherited done;
  1650. end;
  1651. {
  1652. $Log$
  1653. Revision 1.78 1999-04-14 09:15:02 peter
  1654. * first things to store the symbol/def number in the ppu
  1655. Revision 1.77 1999/04/08 10:11:32 pierre
  1656. + enable uninitilized warnings for static symbols
  1657. Revision 1.76 1999/03/31 13:55:21 peter
  1658. * assembler inlining working for ag386bin
  1659. Revision 1.75 1999/03/24 23:17:27 peter
  1660. * fixed bugs 212,222,225,227,229,231,233
  1661. Revision 1.74 1999/02/23 18:29:27 pierre
  1662. * win32 compilation error fix
  1663. + some work for local browser (not cl=omplete yet)
  1664. Revision 1.73 1999/02/22 13:07:09 pierre
  1665. + -b and -bl options work !
  1666. + cs_local_browser ($L+) is disabled if cs_browser ($Y+)
  1667. is not enabled when quitting global section
  1668. * local vars and procedures are not yet stored into PPU
  1669. Revision 1.72 1999/02/08 09:51:22 pierre
  1670. * gdb info for local functions was wrong
  1671. Revision 1.71 1999/01/23 23:29:41 florian
  1672. * first running version of the new code generator
  1673. * when compiling exceptions under Linux fixed
  1674. Revision 1.70 1999/01/21 22:10:48 peter
  1675. * fixed array of const
  1676. * generic platform independent high() support
  1677. Revision 1.69 1999/01/20 10:20:20 peter
  1678. * don't make localvar copies for assembler procedures
  1679. Revision 1.68 1999/01/12 14:25:36 peter
  1680. + BrowserLog for browser.log generation
  1681. + BrowserCol for browser info in TCollections
  1682. * released all other UseBrowser
  1683. Revision 1.67 1998/12/30 22:15:54 peter
  1684. + farpointer type
  1685. * absolutesym now also stores if its far
  1686. Revision 1.66 1998/12/30 13:41:14 peter
  1687. * released valuepara
  1688. Revision 1.65 1998/12/26 15:35:44 peter
  1689. + read/write of constnil
  1690. Revision 1.64 1998/12/08 10:18:15 peter
  1691. + -gh for heaptrc unit
  1692. Revision 1.63 1998/11/28 16:20:56 peter
  1693. + support for dll variables
  1694. Revision 1.62 1998/11/27 14:50:48 peter
  1695. + open strings, $P switch support
  1696. Revision 1.61 1998/11/18 15:44:18 peter
  1697. * VALUEPARA for tp7 compatible value parameters
  1698. Revision 1.60 1998/11/16 10:13:51 peter
  1699. * label defines are checked at the end of the proc
  1700. Revision 1.59 1998/11/13 12:09:11 peter
  1701. * unused label is now a warning
  1702. Revision 1.58 1998/11/10 10:50:57 pierre
  1703. * temporary fix for long mangled procsym names
  1704. Revision 1.57 1998/11/05 23:39:31 peter
  1705. + typedconst.getsize
  1706. Revision 1.56 1998/10/28 18:26:18 pierre
  1707. * removed some erros after other errors (introduced by useexcept)
  1708. * stabs works again correctly (for how long !)
  1709. Revision 1.55 1998/10/20 08:07:00 pierre
  1710. * several memory corruptions due to double freemem solved
  1711. => never use p^.loc.location:=p^.left^.loc.location;
  1712. + finally I added now by default
  1713. that ra386dir translates global and unit symbols
  1714. + added a first field in tsymtable and
  1715. a nextsym field in tsym
  1716. (this allows to obtain ordered type info for
  1717. records and objects in gdb !)
  1718. Revision 1.54 1998/10/19 08:55:07 pierre
  1719. * wrong stabs info corrected once again !!
  1720. + variable vmt offset with vmt field only if required
  1721. implemented now !!!
  1722. Revision 1.53 1998/10/16 08:51:53 peter
  1723. + target_os.stackalignment
  1724. + stack can be aligned at 2 or 4 byte boundaries
  1725. Revision 1.52 1998/10/08 17:17:32 pierre
  1726. * current_module old scanner tagged as invalid if unit is recompiled
  1727. + added ppheap for better info on tracegetmem of heaptrc
  1728. (adds line column and file index)
  1729. * several memory leaks removed ith help of heaptrc !!
  1730. Revision 1.51 1998/10/08 13:48:50 peter
  1731. * fixed memory leaks for do nothing source
  1732. * fixed unit interdependency
  1733. Revision 1.50 1998/10/06 17:16:56 pierre
  1734. * some memory leaks fixed (thanks to Peter for heaptrc !)
  1735. Revision 1.49 1998/10/01 09:22:55 peter
  1736. * fixed value openarray
  1737. * ungettemp of arrayconstruct
  1738. Revision 1.48 1998/09/26 17:45:44 peter
  1739. + idtoken and only one token table
  1740. Revision 1.47 1998/09/24 15:11:17 peter
  1741. * fixed enum for not GDB
  1742. Revision 1.46 1998/09/23 15:39:13 pierre
  1743. * browser bugfixes
  1744. was adding a reference when looking for the symbol
  1745. if -bSYM_NAME was used
  1746. Revision 1.45 1998/09/21 08:45:24 pierre
  1747. + added vmt_offset in tobjectdef.write for fututre use
  1748. (first steps to have objects without vmt if no virtual !!)
  1749. + added fpu_used field for tabstractprocdef :
  1750. sets this level to 2 if the functions return with value in FPU
  1751. (is then set to correct value at parsing of implementation)
  1752. THIS MIGHT refuse some code with FPU expression too complex
  1753. that were accepted before and even in some cases
  1754. that don't overflow in fact
  1755. ( like if f : float; is a forward that finally in implementation
  1756. only uses one fpu register !!)
  1757. Nevertheless I think that it will improve security on
  1758. FPU operations !!
  1759. * most other changes only for UseBrowser code
  1760. (added symtable references for record and objects)
  1761. local switch for refs to args and local of each function
  1762. (static symtable still missing)
  1763. UseBrowser still not stable and probably broken by
  1764. the definition hash array !!
  1765. Revision 1.44 1998/09/18 16:03:47 florian
  1766. * some changes to compile with Delphi
  1767. Revision 1.43 1998/09/18 08:01:38 pierre
  1768. + improvement on the usebrowser part
  1769. (does not work correctly for now)
  1770. Revision 1.42 1998/09/07 19:33:25 florian
  1771. + some stuff for property rtti added:
  1772. - NameIndex of the TPropInfo record is now written correctly
  1773. - the DEFAULT/NODEFAULT keyword is supported now
  1774. - the default value and the storedsym/def are now written to
  1775. the PPU fiel
  1776. Revision 1.41 1998/09/07 18:46:12 peter
  1777. * update smartlinking, uses getdatalabel
  1778. * renamed ptree.value vars to value_str,value_real,value_set
  1779. Revision 1.40 1998/09/07 17:37:04 florian
  1780. * first fixes for published properties
  1781. Revision 1.39 1998/09/05 22:11:02 florian
  1782. + switch -vb
  1783. * while/repeat loops accept now also word/longbool conditions
  1784. * makebooltojump did an invalid ungetregister32, fixed
  1785. Revision 1.38 1998/09/01 12:53:26 peter
  1786. + aktpackenum
  1787. Revision 1.37 1998/09/01 07:54:25 pierre
  1788. * UseBrowser a little updated (might still be buggy !!)
  1789. * bug in psub.pas in function specifier removed
  1790. * stdcall allowed in interface and in implementation
  1791. (FPC will not yet complain if it is missing in either part
  1792. because stdcall is only a dummy !!)
  1793. Revision 1.36 1998/08/25 13:09:26 pierre
  1794. * corrected mangling sheme :
  1795. cvar add Cprefix to the mixed case name whereas
  1796. export or public use direct name
  1797. Revision 1.35 1998/08/25 12:42:46 pierre
  1798. * CDECL changed to CVAR for variables
  1799. specifications are read in structures also
  1800. + started adding GPC compatibility mode ( option -Sp)
  1801. * names changed to lowercase
  1802. Revision 1.34 1998/08/21 14:08:53 pierre
  1803. + TEST_FUNCRET now default (old code removed)
  1804. works also for m68k (at least compiles)
  1805. Revision 1.33 1998/08/20 12:53:27 peter
  1806. * object_options are always written for object syms
  1807. Revision 1.32 1998/08/20 09:26:46 pierre
  1808. + funcret setting in underproc testing
  1809. compile with _dTEST_FUNCRET
  1810. Revision 1.31 1998/08/17 10:10:12 peter
  1811. - removed OLDPPU
  1812. Revision 1.30 1998/08/13 10:57:29 peter
  1813. * constant sets are now written correctly to the ppufile
  1814. Revision 1.29 1998/08/11 15:31:42 peter
  1815. * write extended to ppu file
  1816. * new version 0.99.7
  1817. Revision 1.28 1998/08/11 14:07:27 peter
  1818. * fixed pushing of high value for openarray
  1819. Revision 1.27 1998/08/10 14:50:31 peter
  1820. + localswitches, moduleswitches, globalswitches splitting
  1821. Revision 1.26 1998/08/10 10:18:35 peter
  1822. + Compiler,Comphook unit which are the new interface units to the
  1823. compiler
  1824. Revision 1.25 1998/07/30 11:18:19 florian
  1825. + first implementation of try ... except on .. do end;
  1826. * limitiation of 65535 bytes parameters for cdecl removed
  1827. Revision 1.24 1998/07/20 18:40:16 florian
  1828. * handling of ansi string constants should now work
  1829. Revision 1.23 1998/07/14 21:37:24 peter
  1830. * fixed packrecords as discussed at the alias
  1831. Revision 1.22 1998/07/14 14:47:08 peter
  1832. * released NEWINPUT
  1833. Revision 1.21 1998/07/13 21:17:38 florian
  1834. * changed to compile with TP
  1835. Revision 1.20 1998/07/10 00:00:05 peter
  1836. * fixed ttypesym bug finally
  1837. * fileinfo in the symtable and better using for unused vars
  1838. Revision 1.19 1998/07/07 17:40:39 peter
  1839. * packrecords 4 works
  1840. * word aligning of parameters
  1841. Revision 1.18 1998/07/07 11:20:15 peter
  1842. + NEWINPUT for a better inputfile and scanner object
  1843. Revision 1.17 1998/06/24 14:48:40 peter
  1844. * ifdef newppu -> ifndef oldppu
  1845. Revision 1.16 1998/06/19 15:40:42 peter
  1846. * removed cosntructor/constructor warning and 0.99.5 recompiles it again
  1847. Revision 1.15 1998/06/17 14:10:18 peter
  1848. * small os2 fixes
  1849. * fixed interdependent units with newppu (remake3 under linux works now)
  1850. Revision 1.14 1998/06/16 08:56:34 peter
  1851. + targetcpu
  1852. * cleaner pmodules for newppu
  1853. Revision 1.13 1998/06/15 15:38:10 pierre
  1854. * small bug in systems.pas corrected
  1855. + operators in different units better hanlded
  1856. Revision 1.12 1998/06/15 14:23:44 daniel
  1857. * Reverted my changes.
  1858. Revision 1.10 1998/06/13 00:10:18 peter
  1859. * working browser and newppu
  1860. * some small fixes against crashes which occured in bp7 (but not in
  1861. fpc?!)
  1862. Revision 1.9 1998/06/12 16:15:35 pierre
  1863. * external name 'C_var';
  1864. export name 'intern_C_var';
  1865. cdecl;
  1866. cdecl;external;
  1867. are now supported only with -Sv switch
  1868. Revision 1.8 1998/06/11 10:11:59 peter
  1869. * -gb works again
  1870. Revision 1.7 1998/06/09 16:01:51 pierre
  1871. + added procedure directive parsing for procvars
  1872. (accepted are popstack cdecl and pascal)
  1873. + added C vars with the following syntax
  1874. var C calias 'true_c_name';(can be followed by external)
  1875. reason is that you must add the Cprefix
  1876. which is target dependent
  1877. Revision 1.6 1998/06/08 22:59:53 peter
  1878. * smartlinking works for win32
  1879. * some defines to exclude some compiler parts
  1880. Revision 1.5 1998/06/04 23:52:02 peter
  1881. * m68k compiles
  1882. + .def file creation moved to gendef.pas so it could also be used
  1883. for win32
  1884. Revision 1.4 1998/06/04 09:55:46 pierre
  1885. * demangled name of procsym reworked to become independant of the mangling scheme
  1886. Revision 1.3 1998/06/03 22:14:20 florian
  1887. * problem with sizes of classes fixed (if the anchestor was declared
  1888. forward, the compiler doesn't update the child classes size)
  1889. Revision 1.2 1998/05/28 14:40:29 peter
  1890. * fixes for newppu, remake3 works now with it
  1891. Revision 1.1 1998/05/27 19:45:09 peter
  1892. * symtable.pas splitted into includefiles
  1893. * symtable adapted for $ifndef OLDPPU
  1894. }