symsym.inc 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285
  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. inherited initname(n);
  24. typ:=abstractsym;
  25. symoptions:=current_object_option;
  26. {$ifdef GDB}
  27. isstabwritten := false;
  28. {$endif GDB}
  29. fileinfo:=tokenpos;
  30. defref:=nil;
  31. refs:=0;
  32. lastwritten:=nil;
  33. refcount:=0;
  34. if (cs_browser in aktmoduleswitches) and make_ref then
  35. begin
  36. defref:=new(pref,init(defref,@tokenpos));
  37. inc(refcount);
  38. end;
  39. lastref:=defref;
  40. end;
  41. constructor tsym.load;
  42. begin
  43. inherited init;
  44. indexnr:=readword;
  45. setname(readstring);
  46. typ:=abstractsym;
  47. readsmallset(symoptions);
  48. readposinfo(fileinfo);
  49. lastref:=nil;
  50. defref:=nil;
  51. refs:=0;
  52. lastwritten:=nil;
  53. refcount:=0;
  54. {$ifdef GDB}
  55. isstabwritten := false;
  56. {$endif GDB}
  57. end;
  58. procedure tsym.load_references;
  59. var
  60. pos : tfileposinfo;
  61. move_last : boolean;
  62. begin
  63. move_last:=lastwritten=lastref;
  64. while (not current_ppu^.endofentry) do
  65. begin
  66. readposinfo(pos);
  67. inc(refcount);
  68. lastref:=new(pref,init(lastref,@pos));
  69. lastref^.is_written:=true;
  70. if refcount=1 then
  71. defref:=lastref;
  72. end;
  73. if move_last then
  74. lastwritten:=lastref;
  75. end;
  76. { big problem here :
  77. wrong refs were written because of
  78. interface parsing of other units PM
  79. moduleindex must be checked !! }
  80. function tsym.write_references : boolean;
  81. var
  82. ref : pref;
  83. symref_written,move_last : boolean;
  84. begin
  85. write_references:=false;
  86. if lastwritten=lastref then
  87. exit;
  88. { should we update lastref }
  89. move_last:=true;
  90. symref_written:=false;
  91. { write symbol refs }
  92. if assigned(lastwritten) then
  93. ref:=lastwritten
  94. else
  95. ref:=defref;
  96. while assigned(ref) do
  97. begin
  98. if ref^.moduleindex=current_module^.unit_index then
  99. begin
  100. { write address to this symbol }
  101. if not symref_written then
  102. begin
  103. writesymref(@self);
  104. symref_written:=true;
  105. end;
  106. writeposinfo(ref^.posinfo);
  107. ref^.is_written:=true;
  108. if move_last then
  109. lastwritten:=ref;
  110. end
  111. else if not ref^.is_written then
  112. move_last:=false
  113. else if move_last then
  114. lastwritten:=ref;
  115. ref:=ref^.nextref;
  116. end;
  117. if symref_written then
  118. current_ppu^.writeentry(ibsymref);
  119. write_references:=symref_written;
  120. end;
  121. {$ifdef BrowserLog}
  122. procedure tsym.add_to_browserlog;
  123. begin
  124. if assigned(defref) then
  125. begin
  126. browserlog.AddLog('***'+name+'***');
  127. browserlog.AddLogRefs(defref);
  128. end;
  129. end;
  130. {$endif BrowserLog}
  131. destructor tsym.done;
  132. begin
  133. if assigned(defref) then
  134. dispose(defref,done);
  135. inherited done;
  136. end;
  137. procedure tsym.write;
  138. begin
  139. writeword(indexnr);
  140. writestring(name);
  141. writesmallset(symoptions);
  142. writeposinfo(fileinfo);
  143. end;
  144. procedure tsym.deref;
  145. begin
  146. end;
  147. function tsym.mangledname : string;
  148. begin
  149. mangledname:=name;
  150. end;
  151. { for most symbol types there is nothing to do at all }
  152. procedure tsym.insert_in_data;
  153. begin
  154. end;
  155. {$ifdef GDB}
  156. function tsym.stabstring : pchar;
  157. begin
  158. stabstring:=strpnew('"'+name+'",'+tostr(N_LSYM)+',0,'+
  159. tostr(fileinfo.line)+',0');
  160. end;
  161. procedure tsym.concatstabto(asmlist : paasmoutput);
  162. var stab_str : pchar;
  163. begin
  164. if not isstabwritten then
  165. begin
  166. stab_str := stabstring;
  167. { count_dbx(stab_str); moved to GDB.PAS }
  168. asmlist^.concat(new(pai_stabs,init(stab_str)));
  169. isstabwritten:=true;
  170. end;
  171. end;
  172. {$endif GDB}
  173. {****************************************************************************
  174. TLABELSYM
  175. ****************************************************************************}
  176. constructor tlabelsym.init(const n : string; l : pasmlabel);
  177. begin
  178. inherited init(n);
  179. typ:=labelsym;
  180. lab:=l;
  181. used:=false;
  182. defined:=false;
  183. end;
  184. constructor tlabelsym.load;
  185. begin
  186. tsym.load;
  187. typ:=labelsym;
  188. { this is all dummy
  189. it is only used for local browsing }
  190. lab:=nil;
  191. used:=false;
  192. defined:=true;
  193. end;
  194. destructor tlabelsym.done;
  195. begin
  196. inherited done;
  197. end;
  198. function tlabelsym.mangledname : string;
  199. begin
  200. mangledname:=lab^.name;
  201. end;
  202. procedure tlabelsym.write;
  203. begin
  204. if owner^.symtabletype in [unitsymtable,globalsymtable] then
  205. Message(sym_e_ill_label_decl)
  206. else
  207. begin
  208. tsym.write;
  209. current_ppu^.writeentry(iblabelsym);
  210. end;
  211. end;
  212. {****************************************************************************
  213. TUNITSYM
  214. ****************************************************************************}
  215. constructor tunitsym.init(const n : string;ref : punitsymtable);
  216. var
  217. old_make_ref : boolean;
  218. begin
  219. old_make_ref:=make_ref;
  220. make_ref:=false;
  221. inherited init(n);
  222. make_ref:=old_make_ref;
  223. typ:=unitsym;
  224. unitsymtable:=ref;
  225. prevsym:=ref^.unitsym;
  226. ref^.unitsym:=@self;
  227. refs:=0;
  228. end;
  229. constructor tunitsym.load;
  230. begin
  231. tsym.load;
  232. typ:=unitsym;
  233. unitsymtable:=punitsymtable(current_module^.globalsymtable);
  234. prevsym:=nil;
  235. end;
  236. { we need to remove it from the prevsym chain ! }
  237. destructor tunitsym.done;
  238. var pus,ppus : punitsym;
  239. begin
  240. if assigned(unitsymtable) then
  241. begin
  242. ppus:=nil;
  243. pus:=unitsymtable^.unitsym;
  244. if pus=@self then
  245. unitsymtable^.unitsym:=prevsym
  246. else while assigned(pus) do
  247. begin
  248. if pus=@self then
  249. begin
  250. ppus^.prevsym:=prevsym;
  251. break;
  252. end
  253. else
  254. begin
  255. ppus:=pus;
  256. pus:=ppus^.prevsym;
  257. end;
  258. end;
  259. end;
  260. prevsym:=nil;
  261. unitsymtable:=nil;
  262. inherited done;
  263. end;
  264. procedure tunitsym.write;
  265. begin
  266. tsym.write;
  267. current_ppu^.writeentry(ibunitsym);
  268. end;
  269. {$ifdef GDB}
  270. procedure tunitsym.concatstabto(asmlist : paasmoutput);
  271. begin
  272. {Nothing to write to stabs !}
  273. end;
  274. {$endif GDB}
  275. {****************************************************************************
  276. TPROCSYM
  277. ****************************************************************************}
  278. constructor tprocsym.init(const n : string);
  279. begin
  280. tsym.init(n);
  281. typ:=procsym;
  282. definition:=nil;
  283. owner:=nil;
  284. {$ifdef GDB}
  285. is_global := false;
  286. {$endif GDB}
  287. end;
  288. constructor tprocsym.load;
  289. begin
  290. tsym.load;
  291. typ:=procsym;
  292. definition:=pprocdef(readdefref);
  293. {$ifdef GDB}
  294. is_global := false;
  295. {$endif GDB}
  296. end;
  297. destructor tprocsym.done;
  298. begin
  299. { don't check if errors !! }
  300. if Errorcount=0 then
  301. check_forward;
  302. tsym.done;
  303. end;
  304. function tprocsym.mangledname : string;
  305. begin
  306. mangledname:=definition^.mangledname;
  307. end;
  308. function tprocsym.demangledname:string;
  309. begin
  310. demangledname:=name+definition^.demangled_paras;
  311. end;
  312. procedure tprocsym.write_parameter_lists;
  313. var
  314. p : pprocdef;
  315. begin
  316. p:=definition;
  317. while assigned(p) do
  318. begin
  319. { force the error to be printed }
  320. Verbose.Message1(sym_b_param_list,name+p^.demangled_paras);
  321. p:=p^.nextoverloaded;
  322. end;
  323. end;
  324. procedure tprocsym.check_forward;
  325. var
  326. pd : pprocdef;
  327. begin
  328. pd:=definition;
  329. while assigned(pd) do
  330. begin
  331. if pd^.forwarddef then
  332. begin
  333. if assigned(pd^._class) then
  334. MessagePos1(fileinfo,sym_e_forward_not_resolved,pd^._class^.objname^+'.'+demangledname)
  335. else
  336. MessagePos1(fileinfo,sym_e_forward_not_resolved,demangledname);
  337. { Turn futher error messages off }
  338. pd^.forwarddef:=false;
  339. end;
  340. pd:=pd^.nextoverloaded;
  341. end;
  342. end;
  343. procedure tprocsym.deref;
  344. var
  345. t : ttoken;
  346. last : pprocdef;
  347. begin
  348. resolvedef(pdef(definition));
  349. if (definition^.proctypeoption=potype_operator) then
  350. begin
  351. last:=definition;
  352. while assigned(last^.nextoverloaded) do
  353. last:=last^.nextoverloaded;
  354. for t:=first_overloaded to last_overloaded do
  355. if (name=overloaded_names[t]) then
  356. begin
  357. if assigned(overloaded_operators[t]) then
  358. last^.nextoverloaded:=overloaded_operators[t]^.definition;
  359. overloaded_operators[t]:=@self;
  360. end;
  361. end;
  362. end;
  363. procedure tprocsym.order_overloaded;
  364. var firstdef,currdef,lastdef : pprocdef;
  365. begin
  366. firstdef:=definition;
  367. currdef:=definition;
  368. while assigned(currdef) do
  369. begin
  370. currdef^.count:=false;
  371. currdef:=currdef^.nextoverloaded;
  372. end;
  373. definition:=definition^.nextoverloaded;
  374. firstdef^.nextoverloaded:=nil;
  375. while assigned(definition) do
  376. begin
  377. currdef:=firstdef;
  378. lastdef:=definition;
  379. definition:=definition^.nextoverloaded;
  380. if lastdef^.mangledname>currdef^.mangledname then
  381. begin
  382. lastdef^.nextoverloaded:=firstdef;
  383. firstdef:=lastdef;
  384. end
  385. else
  386. begin
  387. while assigned(currdef^.nextoverloaded) and
  388. (currdef^.mangledname>lastdef^.mangledname) do
  389. currdef:=currdef^.nextoverloaded;
  390. lastdef^.nextoverloaded:=currdef^.nextoverloaded;
  391. currdef^.nextoverloaded:=lastdef;
  392. end;
  393. end;
  394. definition:=firstdef;
  395. currdef:=definition;
  396. while assigned(currdef) do
  397. begin
  398. currdef^.count:=true;
  399. currdef:=currdef^.nextoverloaded;
  400. end;
  401. end;
  402. procedure tprocsym.write;
  403. begin
  404. tsym.write;
  405. writedefref(pdef(definition));
  406. current_ppu^.writeentry(ibprocsym);
  407. end;
  408. procedure tprocsym.load_references;
  409. (*var
  410. prdef,prdef2 : pprocdef;
  411. b : byte; *)
  412. begin
  413. inherited load_references;
  414. (*prdef:=definition;
  415. done in tsymtable.load_browser (PM)
  416. { take care about operators !! }
  417. if (current_module^.flags and uf_has_browser) <>0 then
  418. while assigned(prdef) and (prdef^.owner=definition^.owner) do
  419. begin
  420. b:=current_ppu^.readentry;
  421. if b<>ibdefref then
  422. Message(unit_f_ppu_read_error);
  423. prdef2:=pprocdef(readdefref);
  424. resolvedef(prdef2);
  425. if prdef<>prdef2 then
  426. Message(unit_f_ppu_read_error);
  427. prdef^.load_references;
  428. prdef:=prdef^.nextoverloaded;
  429. end; *)
  430. end;
  431. function tprocsym.write_references : boolean;
  432. var
  433. prdef : pprocdef;
  434. begin
  435. write_references:=false;
  436. if not inherited write_references then
  437. exit;
  438. write_references:=true;
  439. prdef:=definition;
  440. while assigned(prdef) and (prdef^.owner=definition^.owner) do
  441. begin
  442. prdef^.write_references;
  443. prdef:=prdef^.nextoverloaded;
  444. end;
  445. end;
  446. {$ifdef BrowserLog}
  447. procedure tprocsym.add_to_browserlog;
  448. var
  449. prdef : pprocdef;
  450. begin
  451. inherited add_to_browserlog;
  452. prdef:=definition;
  453. while assigned(prdef) do
  454. begin
  455. pprocdef(prdef)^.add_to_browserlog;
  456. prdef:=pprocdef(prdef)^.nextoverloaded;
  457. end;
  458. end;
  459. {$endif BrowserLog}
  460. {$ifdef GDB}
  461. function tprocsym.stabstring : pchar;
  462. Var RetType : Char;
  463. Obj,Info : String;
  464. stabsstr : string;
  465. p : pchar;
  466. begin
  467. obj := name;
  468. info := '';
  469. if is_global then
  470. RetType := 'F'
  471. else
  472. RetType := 'f';
  473. if assigned(owner) then
  474. begin
  475. if (owner^.symtabletype = objectsymtable) then
  476. obj := owner^.name^+'__'+name;
  477. { this code was correct only as long as the local symboltable
  478. of the parent had the same name as the function
  479. but this is no true anymore !! PM
  480. if (owner^.symtabletype=localsymtable) and assigned(owner^.name) then
  481. info := ','+name+','+owner^.name^; }
  482. if (owner^.symtabletype=localsymtable) and assigned(owner^.defowner) and
  483. assigned(pprocdef(owner^.defowner)^.procsym) then
  484. info := ','+name+','+pprocdef(owner^.defowner)^.procsym^.name;
  485. end;
  486. stabsstr:=definition^.mangledname;
  487. getmem(p,length(stabsstr)+255);
  488. strpcopy(p,'"'+obj+':'+RetType
  489. +definition^.retdef^.numberstring+info+'",'+tostr(n_function)
  490. +',0,'+
  491. tostr(aktfilepos.line)
  492. +',');
  493. strpcopy(strend(p),stabsstr);
  494. stabstring:=strnew(p);
  495. freemem(p,length(stabsstr)+255);
  496. end;
  497. procedure tprocsym.concatstabto(asmlist : paasmoutput);
  498. begin
  499. if (pocall_internproc in definition^.proccalloptions) then exit;
  500. if not isstabwritten then
  501. asmlist^.concat(new(pai_stabs,init(stabstring)));
  502. isstabwritten := true;
  503. if assigned(definition^.parast) then
  504. definition^.parast^.concatstabto(asmlist);
  505. if assigned(definition^.localst) then
  506. definition^.localst^.concatstabto(asmlist);
  507. definition^.is_def_stab_written := true;
  508. end;
  509. {$endif GDB}
  510. {****************************************************************************
  511. TPROGRAMSYM
  512. ****************************************************************************}
  513. constructor tprogramsym.init(const n : string);
  514. begin
  515. inherited init(n);
  516. typ:=programsym;
  517. end;
  518. {****************************************************************************
  519. TERRORSYM
  520. ****************************************************************************}
  521. constructor terrorsym.init;
  522. begin
  523. inherited init('');
  524. typ:=errorsym;
  525. end;
  526. {****************************************************************************
  527. TPROPERTYSYM
  528. ****************************************************************************}
  529. constructor tpropertysym.init(const n : string);
  530. begin
  531. inherited init(n);
  532. typ:=propertysym;
  533. propoptions:=[];
  534. proptype:=nil;
  535. readaccessdef:=nil;
  536. writeaccessdef:=nil;
  537. readaccesssym:=nil;
  538. writeaccesssym:=nil;
  539. storedsym:=nil;
  540. storeddef:=nil;
  541. indexdef:=nil;
  542. index:=0;
  543. default:=0;
  544. end;
  545. destructor tpropertysym.done;
  546. procedure disposepropsymlist(p:ppropsymlist);
  547. var
  548. hp : ppropsymlist;
  549. begin
  550. while assigned(p) do
  551. begin
  552. hp:=p;
  553. p:=p^.next;
  554. dispose(hp);
  555. end;
  556. end;
  557. begin
  558. disposepropsymlist(readaccesssym);
  559. disposepropsymlist(writeaccesssym);
  560. disposepropsymlist(storedsym);
  561. inherited done;
  562. end;
  563. constructor tpropertysym.load;
  564. function readpropsymlist:ppropsymlist;
  565. var
  566. root,last,p : ppropsymlist;
  567. sym : psym;
  568. begin
  569. root:=nil;
  570. last:=nil;
  571. repeat
  572. sym:=readsymref;
  573. if sym=nil then
  574. break;
  575. new(p);
  576. p^.sym:=sym;
  577. p^.next:=nil;
  578. if assigned(last) then
  579. last^.next:=p
  580. else
  581. root:=p;
  582. last:=p;
  583. until false;
  584. readpropsymlist:=root;
  585. end;
  586. begin
  587. inherited load;
  588. typ:=propertysym;
  589. proptype:=readdefref;
  590. readsmallset(propoptions);
  591. index:=readlong;
  592. default:=readlong;
  593. { the syms }
  594. readaccesssym:=readpropsymlist;
  595. writeaccesssym:=readpropsymlist;
  596. storedsym:=readpropsymlist;
  597. { now the defs }
  598. readaccessdef:=readdefref;
  599. writeaccessdef:=readdefref;
  600. storeddef:=readdefref;
  601. indexdef:=readdefref;
  602. end;
  603. procedure tpropertysym.deref;
  604. procedure resolvepropsymlist(p:ppropsymlist);
  605. begin
  606. while assigned(p) do
  607. begin
  608. resolvesym(p^.sym);
  609. p:=p^.next;
  610. end;
  611. end;
  612. begin
  613. resolvedef(proptype);
  614. resolvedef(readaccessdef);
  615. resolvedef(writeaccessdef);
  616. resolvedef(storeddef);
  617. resolvedef(indexdef);
  618. resolvepropsymlist(readaccesssym);
  619. resolvepropsymlist(writeaccesssym);
  620. resolvepropsymlist(storedsym);
  621. end;
  622. function tpropertysym.getsize : longint;
  623. begin
  624. getsize:=0;
  625. end;
  626. procedure tpropertysym.write;
  627. procedure writepropsymlist(p:ppropsymlist);
  628. begin
  629. while assigned(p) do
  630. begin
  631. writesymref(p^.sym);
  632. p:=p^.next;
  633. end;
  634. writesymref(nil);
  635. end;
  636. begin
  637. tsym.write;
  638. writedefref(proptype);
  639. writesmallset(propoptions);
  640. writelong(index);
  641. writelong(default);
  642. writepropsymlist(readaccesssym);
  643. writepropsymlist(writeaccesssym);
  644. writepropsymlist(storedsym);
  645. writedefref(readaccessdef);
  646. writedefref(writeaccessdef);
  647. writedefref(storeddef);
  648. writedefref(indexdef);
  649. current_ppu^.writeentry(ibpropertysym);
  650. end;
  651. {$ifdef GDB}
  652. function tpropertysym.stabstring : pchar;
  653. begin
  654. { !!!! don't know how to handle }
  655. stabstring:=strpnew('');
  656. end;
  657. procedure tpropertysym.concatstabto(asmlist : paasmoutput);
  658. begin
  659. { !!!! don't know how to handle }
  660. end;
  661. {$endif GDB}
  662. {****************************************************************************
  663. TFUNCRETSYM
  664. ****************************************************************************}
  665. constructor tfuncretsym.init(const n : string;approcinfo : pointer{pprocinfo});
  666. begin
  667. tsym.init(n);
  668. typ:=funcretsym;
  669. funcretprocinfo:=approcinfo;
  670. funcretdef:=pprocinfo(approcinfo)^.retdef;
  671. { address valid for ret in param only }
  672. { otherwise set by insert }
  673. address:=pprocinfo(approcinfo)^.retoffset;
  674. end;
  675. constructor tfuncretsym.load;
  676. begin
  677. tsym.load;
  678. funcretdef:=readdefref;
  679. address:=readlong;
  680. funcretprocinfo:=nil;
  681. typ:=funcretsym;
  682. end;
  683. procedure tfuncretsym.write;
  684. begin
  685. tsym.write;
  686. writedefref(funcretdef);
  687. writelong(address);
  688. current_ppu^.writeentry(ibfuncretsym);
  689. end;
  690. procedure tfuncretsym.deref;
  691. begin
  692. resolvedef(funcretdef);
  693. end;
  694. {$ifdef GDB}
  695. procedure tfuncretsym.concatstabto(asmlist : paasmoutput);
  696. begin
  697. { Nothing to do here, it is done in genexitcode }
  698. end;
  699. {$endif GDB}
  700. procedure tfuncretsym.insert_in_data;
  701. var
  702. l : longint;
  703. begin
  704. { if retoffset is already set then reuse it, this is needed
  705. when inserting the result variable }
  706. if procinfo^.retoffset<>0 then
  707. address:=procinfo^.retoffset
  708. else
  709. begin
  710. { allocate space in local if ret in acc or in fpu }
  711. if ret_in_acc(procinfo^.retdef) or (procinfo^.retdef^.deftype=floatdef) then
  712. begin
  713. l:=funcretdef^.size;
  714. inc(owner^.datasize,l);
  715. {$ifdef m68k}
  716. { word alignment required for motorola }
  717. if (l=1) then
  718. inc(owner^.datasize,1)
  719. else
  720. {$endif}
  721. if (l>=4) and ((owner^.datasize and 3)<>0) then
  722. inc(owner^.datasize,4-(owner^.datasize and 3))
  723. else if (l>=2) and ((owner^.datasize and 1)<>0) then
  724. inc(owner^.datasize,2-(owner^.datasize and 1));
  725. address:=owner^.datasize;
  726. procinfo^.retoffset:=-owner^.datasize;
  727. end;
  728. end;
  729. end;
  730. {****************************************************************************
  731. TABSOLUTESYM
  732. ****************************************************************************}
  733. constructor tabsolutesym.init(const n : string;p : pdef);
  734. begin
  735. inherited init(n,p);
  736. typ:=absolutesym;
  737. end;
  738. constructor tabsolutesym.load;
  739. begin
  740. tvarsym.load;
  741. typ:=absolutesym;
  742. ref:=nil;
  743. address:=0;
  744. asmname:=nil;
  745. abstyp:=absolutetyp(readbyte);
  746. absseg:=false;
  747. case abstyp of
  748. tovar :
  749. begin
  750. asmname:=stringdup(readstring);
  751. ref:=srsym;
  752. end;
  753. toasm :
  754. asmname:=stringdup(readstring);
  755. toaddr :
  756. begin
  757. address:=readlong;
  758. absseg:=boolean(readbyte);
  759. end;
  760. end;
  761. end;
  762. procedure tabsolutesym.write;
  763. var
  764. hvo : tvaroptions;
  765. begin
  766. { Note: This needs to write everything of tvarsym.write }
  767. tsym.write;
  768. writebyte(byte(varspez));
  769. if read_member then
  770. writelong(address);
  771. { write only definition or definitionsym }
  772. if assigned(definitionsym) then
  773. begin
  774. writedefref(nil);
  775. writesymref(definitionsym);
  776. end
  777. else
  778. begin
  779. writedefref(definition);
  780. writesymref(nil);
  781. end;
  782. hvo:=varoptions-[vo_regable];
  783. writesmallset(hvo);
  784. writebyte(byte(abstyp));
  785. case abstyp of
  786. tovar :
  787. writestring(ref^.name);
  788. toasm :
  789. writestring(asmname^);
  790. toaddr :
  791. begin
  792. writelong(address);
  793. writebyte(byte(absseg));
  794. end;
  795. end;
  796. current_ppu^.writeentry(ibabsolutesym);
  797. end;
  798. procedure tabsolutesym.deref;
  799. begin
  800. tvarsym.deref;
  801. if (abstyp=tovar) and (asmname<>nil) then
  802. begin
  803. { search previous loaded symtables }
  804. getsym(asmname^,false);
  805. if not(assigned(srsym)) then
  806. getsymonlyin(owner,asmname^);
  807. if not(assigned(srsym)) then
  808. srsym:=generrorsym;
  809. ref:=srsym;
  810. stringdispose(asmname);
  811. end;
  812. end;
  813. function tabsolutesym.mangledname : string;
  814. begin
  815. case abstyp of
  816. tovar :
  817. mangledname:=ref^.mangledname;
  818. toasm :
  819. mangledname:=asmname^;
  820. toaddr :
  821. mangledname:='$'+tostr(address);
  822. else
  823. internalerror(10002);
  824. end;
  825. end;
  826. procedure tabsolutesym.insert_in_data;
  827. begin
  828. end;
  829. {$ifdef GDB}
  830. procedure tabsolutesym.concatstabto(asmlist : paasmoutput);
  831. begin
  832. { I don't know how to handle this !! }
  833. end;
  834. {$endif GDB}
  835. {****************************************************************************
  836. TVARSYM
  837. ****************************************************************************}
  838. constructor tvarsym.init(const n : string;p : pdef);
  839. begin
  840. tsym.init(n);
  841. typ:=varsym;
  842. definition:=p;
  843. definitionsym:=nil;
  844. _mangledname:=nil;
  845. varspez:=vs_value;
  846. address:=0;
  847. islocalcopy:=false;
  848. localvarsym:=nil;
  849. refs:=0;
  850. varstate:=vs_used;
  851. varoptions:=[];
  852. { can we load the value into a register ? }
  853. if p^.is_intregable then
  854. {$ifdef INCLUDEOK}
  855. include(varoptions,vo_regable)
  856. {$else}
  857. varoptions:=varoptions+[vo_regable]
  858. {$endif}
  859. else
  860. {$ifdef INCLUDEOK}
  861. exclude(varoptions,vo_regable);
  862. {$else}
  863. varoptions:=varoptions-[vo_regable];
  864. {$endif}
  865. if p^.is_fpuregable then
  866. {$ifdef INCLUDEOK}
  867. include(varoptions,vo_fpuregable)
  868. {$else}
  869. varoptions:=varoptions+[vo_fpuregable]
  870. {$endif}
  871. else
  872. {$ifdef INCLUDEOK}
  873. exclude(varoptions,vo_regable);
  874. {$else}
  875. varoptions:=varoptions-[vo_fpuregable];
  876. {$endif}
  877. reg:=R_NO;
  878. end;
  879. constructor tvarsym.init_dll(const n : string;p : pdef);
  880. begin
  881. { The tvarsym is necessary for 0.99.5 (PFV) }
  882. tvarsym.init(n,p);
  883. {$ifdef INCLUDEOK}
  884. include(varoptions,vo_is_dll_var);
  885. {$else}
  886. varoptions:=varoptions+[vo_is_dll_var];
  887. {$endif}
  888. end;
  889. constructor tvarsym.init_C(const n,mangled : string;p : pdef);
  890. begin
  891. { The tvarsym is necessary for 0.99.5 (PFV) }
  892. tvarsym.init(n,p);
  893. {$ifdef INCLUDEOK}
  894. include(varoptions,vo_is_C_var);
  895. {$else}
  896. varoptions:=varoptions+[vo_is_C_var];
  897. {$endif}
  898. setmangledname(mangled);
  899. end;
  900. constructor tvarsym.initsym(const n : string;p : ptypesym);
  901. begin
  902. tvarsym.init(n,p^.definition);
  903. definitionsym:=p;
  904. end;
  905. constructor tvarsym.initsym_dll(const n : string;p : ptypesym);
  906. begin
  907. tvarsym.init_dll(n,p^.definition);
  908. definitionsym:=p;
  909. end;
  910. constructor tvarsym.initsym_C(const n,mangled : string;p : ptypesym);
  911. begin
  912. tvarsym.init_C(n,mangled,p^.definition);
  913. definitionsym:=p;
  914. end;
  915. constructor tvarsym.load;
  916. begin
  917. tsym.load;
  918. typ:=varsym;
  919. _mangledname:=nil;
  920. reg:=R_NO;
  921. refs := 0;
  922. varstate:=vs_used;
  923. varspez:=tvarspez(readbyte);
  924. if read_member then
  925. address:=readlong
  926. else
  927. address:=0;
  928. islocalcopy:=false;
  929. localvarsym:=nil;
  930. definition:=readdefref;
  931. definitionsym:=ptypesym(readsymref);
  932. readsmallset(varoptions);
  933. if (vo_is_C_var in varoptions) then
  934. setmangledname(readstring);
  935. end;
  936. destructor tvarsym.done;
  937. begin
  938. strdispose(_mangledname);
  939. inherited done;
  940. end;
  941. procedure tvarsym.deref;
  942. begin
  943. if assigned(definitionsym) then
  944. begin
  945. resolvesym(psym(definitionsym));
  946. definition:=definitionsym^.definition;
  947. end
  948. else
  949. resolvedef(definition);
  950. end;
  951. procedure tvarsym.write;
  952. var
  953. hvo : tvaroptions;
  954. begin
  955. tsym.write;
  956. writebyte(byte(varspez));
  957. if read_member then
  958. writelong(address);
  959. { write only definition or definitionsym }
  960. if assigned(definitionsym) then
  961. begin
  962. writedefref(nil);
  963. writesymref(definitionsym);
  964. end
  965. else
  966. begin
  967. writedefref(definition);
  968. writesymref(nil);
  969. end;
  970. { symbols which are load are never candidates for a register,
  971. turn off the regable }
  972. hvo:=varoptions-[vo_regable];
  973. writesmallset(hvo);
  974. if (vo_is_C_var in varoptions) then
  975. writestring(mangledname);
  976. current_ppu^.writeentry(ibvarsym);
  977. end;
  978. procedure tvarsym.setmangledname(const s : string);
  979. begin
  980. _mangledname:=strpnew(s);
  981. end;
  982. function tvarsym.mangledname : string;
  983. var
  984. prefix : string;
  985. begin
  986. if assigned(_mangledname) then
  987. begin
  988. mangledname:=strpas(_mangledname);
  989. exit;
  990. end;
  991. case owner^.symtabletype of
  992. staticsymtable :
  993. if (cs_create_smart in aktmoduleswitches) then
  994. prefix:='_'+owner^.name^+'$$$_'
  995. else
  996. prefix:='_';
  997. unitsymtable,
  998. globalsymtable :
  999. prefix:='U_'+owner^.name^+'_';
  1000. else
  1001. Message(sym_e_invalid_call_tvarsymmangledname);
  1002. end;
  1003. mangledname:=prefix+name;
  1004. end;
  1005. function tvarsym.getsize : longint;
  1006. begin
  1007. if assigned(definition) and (varspez=vs_value) and
  1008. ((definition^.deftype<>arraydef) or (Parraydef(definition)^.highrange>=
  1009. Parraydef(definition)^.lowrange)) then
  1010. getsize:=definition^.size
  1011. else
  1012. getsize:=0;
  1013. end;
  1014. function tvarsym.getpushsize : longint;
  1015. begin
  1016. if assigned(definition) then
  1017. begin
  1018. case varspez of
  1019. vs_var :
  1020. getpushsize:=target_os.size_of_pointer;
  1021. vs_value,
  1022. vs_const :
  1023. begin
  1024. if push_addr_param(definition) then
  1025. getpushsize:=target_os.size_of_pointer
  1026. else
  1027. getpushsize:=definition^.size;
  1028. end;
  1029. end;
  1030. end
  1031. else
  1032. getpushsize:=0;
  1033. end;
  1034. function data_align(length : longint) : longint;
  1035. begin
  1036. (* this is useless under go32v2 at least
  1037. because the section are only align to dword
  1038. if length>8 then
  1039. data_align:=16
  1040. else if length>4 then
  1041. data_align:=8
  1042. else *)
  1043. if length>2 then
  1044. data_align:=4
  1045. else
  1046. if length>1 then
  1047. data_align:=2
  1048. else
  1049. data_align:=1;
  1050. end;
  1051. procedure tvarsym.insert_in_data;
  1052. var
  1053. varalign,
  1054. l,ali,modulo : longint;
  1055. storefilepos : tfileposinfo;
  1056. begin
  1057. if (vo_is_external in varoptions) then
  1058. exit;
  1059. { handle static variables of objects especially }
  1060. if read_member and (owner^.symtabletype=objectsymtable) and
  1061. (sp_static in symoptions) then
  1062. begin
  1063. { the data filed is generated in parser.pas
  1064. with a tobject_FIELDNAME variable }
  1065. { this symbol can't be loaded to a register }
  1066. {$ifdef INCLUDEOK}
  1067. exclude(varoptions,vo_regable);
  1068. exclude(varoptions,vo_fpuregable);
  1069. {$else}
  1070. varoptions:=varoptions-[vo_regable,vo_fpuregable];
  1071. {$endif}
  1072. end
  1073. else
  1074. if not(read_member) then
  1075. begin
  1076. { made problems with parameters etc. ! (FK) }
  1077. { check for instance of an abstract object or class }
  1078. {
  1079. if (pvarsym(sym)^.definition^.deftype=objectdef) and
  1080. ((pobjectdef(pvarsym(sym)^.definition)^.options and oo_is_abstract)<>0) then
  1081. Message(sym_e_no_instance_of_abstract_object);
  1082. }
  1083. storefilepos:=aktfilepos;
  1084. aktfilepos:=tokenpos;
  1085. if (vo_is_thread_var in varoptions) then
  1086. l:=4
  1087. else
  1088. l:=getsize;
  1089. case owner^.symtabletype of
  1090. stt_exceptsymtable:
  1091. { can contain only one symbol, address calculated later }
  1092. ;
  1093. localsymtable :
  1094. begin
  1095. varstate:=vs_declared;
  1096. modulo:=owner^.datasize and 3;
  1097. {$ifdef m68k}
  1098. { word alignment required for motorola }
  1099. if (l=1) then
  1100. l:=2
  1101. else
  1102. {$endif}
  1103. {
  1104. if (cs_optimize in aktglobalswitches) and
  1105. (aktoptprocessor in [classp5,classp6]) and
  1106. (l>=8) and ((owner^.datasize and 7)<>0) then
  1107. inc(owner^.datasize,8-(owner^.datasize and 7))
  1108. else
  1109. }
  1110. begin
  1111. if (l>=4) and (modulo<>0) then
  1112. inc(l,4-modulo)
  1113. else
  1114. if (l>=2) and ((modulo and 1)<>0) then
  1115. inc(l,2-(modulo and 1));
  1116. end;
  1117. inc(owner^.datasize,l);
  1118. address:=owner^.datasize;
  1119. end;
  1120. staticsymtable :
  1121. begin
  1122. { enable unitialized warning for local symbols }
  1123. varstate:=vs_declared;
  1124. if (cs_create_smart in aktmoduleswitches) then
  1125. bsssegment^.concat(new(pai_cut,init));
  1126. ali:=data_align(l);
  1127. if ali>1 then
  1128. begin
  1129. modulo:=owner^.datasize mod ali;
  1130. if modulo>0 then
  1131. inc(owner^.datasize,ali-modulo);
  1132. end;
  1133. {$ifdef GDB}
  1134. if cs_debuginfo in aktmoduleswitches then
  1135. concatstabto(bsssegment);
  1136. {$endif GDB}
  1137. if (cs_create_smart in aktmoduleswitches) or
  1138. DLLSource or
  1139. (vo_is_C_var in varoptions) then
  1140. bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)))
  1141. else
  1142. bsssegment^.concat(new(pai_datablock,init(mangledname,l)));
  1143. { increase datasize }
  1144. inc(owner^.datasize,l);
  1145. { this symbol can't be loaded to a register }
  1146. {$ifdef INCLUDEOK}
  1147. exclude(varoptions,vo_regable);
  1148. exclude(varoptions,vo_fpuregable);
  1149. {$else}
  1150. varoptions:=varoptions-[vo_regable,vo_fpuregable];
  1151. {$endif}
  1152. end;
  1153. globalsymtable :
  1154. begin
  1155. if (cs_create_smart in aktmoduleswitches) then
  1156. bsssegment^.concat(new(pai_cut,init));
  1157. ali:=data_align(l);
  1158. if ali>1 then
  1159. begin
  1160. modulo:=owner^.datasize mod ali;
  1161. if modulo>0 then
  1162. inc(owner^.datasize,ali-modulo);
  1163. end;
  1164. {$ifdef GDB}
  1165. if cs_debuginfo in aktmoduleswitches then
  1166. concatstabto(bsssegment);
  1167. {$endif GDB}
  1168. bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)));
  1169. inc(owner^.datasize,l);
  1170. { this symbol can't be loaded to a register }
  1171. {$ifdef INCLUDEOK}
  1172. exclude(varoptions,vo_regable);
  1173. exclude(varoptions,vo_fpuregable);
  1174. {$else}
  1175. varoptions:=varoptions-[vo_regable,vo_fpuregable];
  1176. {$endif}
  1177. end;
  1178. recordsymtable,
  1179. objectsymtable :
  1180. begin
  1181. { this symbol can't be loaded to a register }
  1182. {$ifdef INCLUDEOK}
  1183. exclude(varoptions,vo_regable);
  1184. exclude(varoptions,vo_fpuregable);
  1185. {$else}
  1186. varoptions:=varoptions-[vo_regable,vo_fpuregable];
  1187. {$endif}
  1188. { get the alignment size }
  1189. if (aktpackrecords=packrecord_C) then
  1190. begin
  1191. varalign:=definition^.alignment;
  1192. if varalign=0 then
  1193. begin
  1194. if (owner^.dataalignment<4) then
  1195. begin
  1196. if (l>=4) then
  1197. owner^.dataalignment:=4
  1198. else
  1199. if (owner^.dataalignment<2) and (l>=2) then
  1200. owner^.dataalignment:=2;
  1201. end;
  1202. end;
  1203. end
  1204. else
  1205. varalign:=0;
  1206. { align record and object fields }
  1207. if (l=1) or (varalign=1) or (owner^.dataalignment=1) then
  1208. begin
  1209. address:=owner^.datasize;
  1210. inc(owner^.datasize,l)
  1211. end
  1212. else
  1213. if (l=2) or (varalign=2) or (owner^.dataalignment=2) then
  1214. begin
  1215. owner^.datasize:=(owner^.datasize+1) and (not 1);
  1216. address:=owner^.datasize;
  1217. inc(owner^.datasize,l)
  1218. end
  1219. else
  1220. if (l<=4) or (varalign=4) or (owner^.dataalignment=4) then
  1221. begin
  1222. owner^.datasize:=(owner^.datasize+3) and (not 3);
  1223. address:=owner^.datasize;
  1224. inc(owner^.datasize,l);
  1225. end
  1226. else
  1227. if (l<=8) or (owner^.dataalignment=8) then
  1228. begin
  1229. owner^.datasize:=(owner^.datasize+7) and (not 7);
  1230. address:=owner^.datasize;
  1231. inc(owner^.datasize,l);
  1232. end
  1233. else
  1234. if (l<=16) or (owner^.dataalignment=16) then
  1235. begin
  1236. owner^.datasize:=(owner^.datasize+15) and (not 15);
  1237. address:=owner^.datasize;
  1238. inc(owner^.datasize,l);
  1239. end
  1240. else
  1241. if (l<=32) or (owner^.dataalignment=32) then
  1242. begin
  1243. owner^.datasize:=(owner^.datasize+31) and (not 31);
  1244. address:=owner^.datasize;
  1245. inc(owner^.datasize,l);
  1246. end;
  1247. end;
  1248. parasymtable :
  1249. begin
  1250. { here we need the size of a push instead of the
  1251. size of the data }
  1252. l:=getpushsize;
  1253. varstate:=vs_assigned;
  1254. address:=owner^.datasize;
  1255. owner^.datasize:=align(owner^.datasize+l,target_os.stackalignment);
  1256. end
  1257. else
  1258. begin
  1259. modulo:=owner^.datasize and 3;
  1260. if (l>=4) and (modulo<>0) then
  1261. inc(owner^.datasize,4-modulo)
  1262. else
  1263. if (l>=2) and ((modulo and 1)<>0) then
  1264. inc(owner^.datasize);
  1265. address:=owner^.datasize;
  1266. inc(owner^.datasize,l);
  1267. end;
  1268. end;
  1269. aktfilepos:=storefilepos;
  1270. end;
  1271. end;
  1272. {$ifdef GDB}
  1273. function tvarsym.stabstring : pchar;
  1274. var
  1275. st : string[2];
  1276. begin
  1277. if (definition^.deftype=objectdef) and
  1278. pobjectdef(definition)^.is_class then
  1279. st:='*'
  1280. else
  1281. st:='';
  1282. if (owner^.symtabletype = objectsymtable) and
  1283. (sp_static in symoptions) then
  1284. begin
  1285. if (cs_gdb_gsym in aktglobalswitches) then st := 'G'+st else st := 'S'+st;
  1286. {$ifndef Delphi}
  1287. stabstring := strpnew('"'+owner^.name^+'__'+name+':'+st+
  1288. +definition^.numberstring+'",'+
  1289. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1290. {$endif}
  1291. end
  1292. else if (owner^.symtabletype = globalsymtable) or
  1293. (owner^.symtabletype = unitsymtable) then
  1294. begin
  1295. { Here we used S instead of
  1296. because with G GDB doesn't look at the address field
  1297. but searches the same name or with a leading underscore
  1298. but these names don't exist in pascal !}
  1299. if (cs_gdb_gsym in aktglobalswitches) then st := 'G'+st else st := 'S'+st;
  1300. stabstring := strpnew('"'+name+':'+st
  1301. +definition^.numberstring+'",'+
  1302. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1303. end
  1304. else if owner^.symtabletype = staticsymtable then
  1305. begin
  1306. stabstring := strpnew('"'+name+':S'+st
  1307. +definition^.numberstring+'",'+
  1308. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1309. end
  1310. else if (owner^.symtabletype=parasymtable) then
  1311. begin
  1312. case varspez of
  1313. vs_var : st := 'v'+st;
  1314. vs_value,
  1315. vs_const : if push_addr_param(definition) then
  1316. st := 'v'+st { should be 'i' but 'i' doesn't work }
  1317. else
  1318. st := 'p'+st;
  1319. end;
  1320. stabstring := strpnew('"'+name+':'+st
  1321. +definition^.numberstring+'",'+
  1322. tostr(N_PSYM)+',0,'+tostr(fileinfo.line)+','+
  1323. tostr(address+owner^.address_fixup));
  1324. {offset to ebp => will not work if the framepointer is esp
  1325. so some optimizing will make things harder to debug }
  1326. end
  1327. else if (owner^.symtabletype=localsymtable) then
  1328. {$ifdef i386}
  1329. if reg<>R_NO then
  1330. begin
  1331. { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
  1332. { this is the register order for GDB}
  1333. stabstring:=strpnew('"'+name+':r'+st
  1334. +definition^.numberstring+'",'+
  1335. tostr(N_RSYM)+',0,'+
  1336. tostr(fileinfo.line)+','+tostr(GDB_i386index[reg]));
  1337. end
  1338. else
  1339. {$endif i386}
  1340. { I don't know if this will work (PM) }
  1341. if (vo_is_C_var in varoptions) then
  1342. stabstring := strpnew('"'+name+':S'+st
  1343. +definition^.numberstring+'",'+
  1344. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname)
  1345. else
  1346. stabstring := strpnew('"'+name+':'+st
  1347. +definition^.numberstring+'",'+
  1348. tostr(N_LSYM)+',0,'+tostr(fileinfo.line)+',-'+tostr(address))
  1349. else
  1350. stabstring := inherited stabstring;
  1351. end;
  1352. procedure tvarsym.concatstabto(asmlist : paasmoutput);
  1353. {$ifdef i386}
  1354. var stab_str : pchar;
  1355. {$endif i386}
  1356. begin
  1357. inherited concatstabto(asmlist);
  1358. {$ifdef i386}
  1359. if (owner^.symtabletype=parasymtable) and
  1360. (reg<>R_NO) then
  1361. begin
  1362. { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
  1363. { this is the register order for GDB}
  1364. stab_str:=strpnew('"'+name+':r'
  1365. +definition^.numberstring+'",'+
  1366. tostr(N_RSYM)+',0,'+
  1367. tostr(fileinfo.line)+','+tostr(GDB_i386index[reg]));
  1368. asmlist^.concat(new(pai_stabs,init(stab_str)));
  1369. end;
  1370. {$endif i386}
  1371. end;
  1372. {$endif GDB}
  1373. {****************************************************************************
  1374. TTYPEDCONSTSYM
  1375. *****************************************************************************}
  1376. constructor ttypedconstsym.init(const n : string;p : pdef;really_const : boolean);
  1377. begin
  1378. tsym.init(n);
  1379. typ:=typedconstsym;
  1380. definition:=p;
  1381. definitionsym:=nil;
  1382. is_really_const:=really_const;
  1383. prefix:=stringdup(procprefix);
  1384. end;
  1385. constructor ttypedconstsym.initsym(const n : string;p : ptypesym;really_const : boolean);
  1386. begin
  1387. ttypedconstsym.init(n,p^.definition,really_const);
  1388. definitionsym:=p;
  1389. end;
  1390. constructor ttypedconstsym.load;
  1391. begin
  1392. tsym.load;
  1393. typ:=typedconstsym;
  1394. definition:=readdefref;
  1395. definitionsym:=ptypesym(readsymref);
  1396. prefix:=stringdup(readstring);
  1397. is_really_const:=boolean(readbyte);
  1398. end;
  1399. destructor ttypedconstsym.done;
  1400. begin
  1401. stringdispose(prefix);
  1402. tsym.done;
  1403. end;
  1404. function ttypedconstsym.mangledname : string;
  1405. begin
  1406. mangledname:='TC_'+prefix^+'_'+name;
  1407. end;
  1408. function ttypedconstsym.getsize : longint;
  1409. begin
  1410. if assigned(definition) then
  1411. getsize:=definition^.size
  1412. else
  1413. getsize:=0;
  1414. end;
  1415. procedure ttypedconstsym.deref;
  1416. begin
  1417. if assigned(definitionsym) then
  1418. begin
  1419. resolvesym(psym(definitionsym));
  1420. definition:=definitionsym^.definition;
  1421. end
  1422. else
  1423. resolvedef(definition);
  1424. end;
  1425. procedure ttypedconstsym.write;
  1426. begin
  1427. tsym.write;
  1428. { write only definition or definitionsym }
  1429. if assigned(definitionsym) then
  1430. begin
  1431. writedefref(nil);
  1432. writesymref(definitionsym);
  1433. end
  1434. else
  1435. begin
  1436. writedefref(definition);
  1437. writesymref(nil);
  1438. end;
  1439. writestring(prefix^);
  1440. writebyte(byte(is_really_const));
  1441. current_ppu^.writeentry(ibtypedconstsym);
  1442. end;
  1443. procedure ttypedconstsym.insert_in_data;
  1444. var
  1445. curconstsegment : paasmoutput;
  1446. l,ali,modulo : longint;
  1447. storefilepos : tfileposinfo;
  1448. begin
  1449. storefilepos:=aktfilepos;
  1450. aktfilepos:=tokenpos;
  1451. if is_really_const then
  1452. curconstsegment:=consts
  1453. else
  1454. curconstsegment:=datasegment;
  1455. if (cs_create_smart in aktmoduleswitches) then
  1456. curconstsegment^.concat(new(pai_cut,init));
  1457. l:=getsize;
  1458. ali:=data_align(l);
  1459. if ali>1 then
  1460. begin
  1461. curconstsegment^.concat(new(pai_align,init(ali)));
  1462. modulo:=owner^.datasize mod ali;
  1463. if modulo>0 then
  1464. inc(owner^.datasize,ali-modulo);
  1465. end;
  1466. { Why was there no owner size update here ??? }
  1467. inc(owner^.datasize,l);
  1468. {$ifdef GDB}
  1469. if cs_debuginfo in aktmoduleswitches then
  1470. concatstabto(curconstsegment);
  1471. {$endif GDB}
  1472. if owner^.symtabletype=globalsymtable then
  1473. begin
  1474. curconstsegment^.concat(new(pai_symbol,initname_global(mangledname,getsize)));
  1475. end
  1476. else
  1477. if owner^.symtabletype<>unitsymtable then
  1478. begin
  1479. if (cs_create_smart in aktmoduleswitches) or
  1480. DLLSource then
  1481. curconstsegment^.concat(new(pai_symbol,initname_global(mangledname,getsize)))
  1482. else
  1483. curconstsegment^.concat(new(pai_symbol,initname(mangledname,getsize)));
  1484. end;
  1485. aktfilepos:=storefilepos;
  1486. end;
  1487. {$ifdef GDB}
  1488. function ttypedconstsym.stabstring : pchar;
  1489. var
  1490. st : char;
  1491. begin
  1492. if (cs_gdb_gsym in aktglobalswitches) and (owner^.symtabletype in [unitsymtable,globalsymtable]) then
  1493. st := 'G'
  1494. else
  1495. st := 'S';
  1496. stabstring := strpnew('"'+name+':'+st+
  1497. definition^.numberstring+'",'+tostr(n_STSYM)+',0,'+
  1498. tostr(fileinfo.line)+','+mangledname);
  1499. end;
  1500. {$endif GDB}
  1501. {****************************************************************************
  1502. TCONSTSYM
  1503. ****************************************************************************}
  1504. constructor tconstsym.init(const n : string;t : tconsttype;v : longint);
  1505. begin
  1506. inherited init(n);
  1507. typ:=constsym;
  1508. consttype:=t;
  1509. value:=v;
  1510. ResStrIndex:=0;
  1511. definition:=nil;
  1512. len:=0;
  1513. end;
  1514. constructor tconstsym.init_def(const n : string;t : tconsttype;v : longint;def : pdef);
  1515. begin
  1516. inherited init(n);
  1517. typ:=constsym;
  1518. consttype:=t;
  1519. value:=v;
  1520. definition:=def;
  1521. len:=0;
  1522. end;
  1523. constructor tconstsym.init_string(const n : string;t : tconsttype;str:pchar;l:longint);
  1524. begin
  1525. inherited init(n);
  1526. typ:=constsym;
  1527. consttype:=t;
  1528. value:=longint(str);
  1529. definition:=nil;
  1530. len:=l;
  1531. if t=constresourcestring then
  1532. ResStrIndex:=registerresourcestring(name,pchar(value),len);
  1533. end;
  1534. constructor tconstsym.load;
  1535. var
  1536. pd : pbestreal;
  1537. ps : pnormalset;
  1538. begin
  1539. tsym.load;
  1540. typ:=constsym;
  1541. consttype:=tconsttype(readbyte);
  1542. case consttype of
  1543. constint,
  1544. constbool,
  1545. constchar :
  1546. value:=readlong;
  1547. constpointer,
  1548. constord :
  1549. begin
  1550. definition:=readdefref;
  1551. value:=readlong;
  1552. end;
  1553. conststring,constresourcestring :
  1554. begin
  1555. len:=readlong;
  1556. getmem(pchar(value),len+1);
  1557. current_ppu^.getdata(pchar(value)^,len);
  1558. if consttype=constresourcestring then
  1559. ResStrIndex:=readlong;
  1560. end;
  1561. constreal :
  1562. begin
  1563. new(pd);
  1564. pd^:=readreal;
  1565. value:=longint(pd);
  1566. end;
  1567. constset :
  1568. begin
  1569. definition:=readdefref;
  1570. new(ps);
  1571. readnormalset(ps^);
  1572. value:=longint(ps);
  1573. end;
  1574. constnil : ;
  1575. else
  1576. Message1(unit_f_ppu_invalid_entry,tostr(ord(consttype)));
  1577. end;
  1578. end;
  1579. destructor tconstsym.done;
  1580. begin
  1581. case consttype of
  1582. conststring :
  1583. freemem(pchar(value),len+1);
  1584. constreal :
  1585. dispose(pbestreal(value));
  1586. constset :
  1587. dispose(pnormalset(value));
  1588. end;
  1589. inherited done;
  1590. end;
  1591. function tconstsym.mangledname : string;
  1592. begin
  1593. mangledname:=name;
  1594. end;
  1595. procedure tconstsym.deref;
  1596. begin
  1597. if consttype in [constord,constpointer,constset] then
  1598. resolvedef(pdef(definition));
  1599. end;
  1600. procedure tconstsym.write;
  1601. begin
  1602. tsym.write;
  1603. writebyte(byte(consttype));
  1604. case consttype of
  1605. constnil : ;
  1606. constint,
  1607. constbool,
  1608. constchar :
  1609. writelong(value);
  1610. constpointer,
  1611. constord :
  1612. begin
  1613. writedefref(definition);
  1614. writelong(value);
  1615. end;
  1616. conststring,constresourcestring :
  1617. begin
  1618. writelong(len);
  1619. current_ppu^.putdata(pchar(value)^,len);
  1620. if consttype=constresourcestring then
  1621. writelong(ResStrIndex);
  1622. end;
  1623. constreal :
  1624. writereal(pbestreal(value)^);
  1625. constset :
  1626. begin
  1627. writedefref(definition);
  1628. writenormalset(pointer(value)^);
  1629. end;
  1630. else
  1631. internalerror(13);
  1632. end;
  1633. current_ppu^.writeentry(ibconstsym);
  1634. end;
  1635. {$ifdef GDB}
  1636. function tconstsym.stabstring : pchar;
  1637. var st : string;
  1638. begin
  1639. {even GDB v4.16 only now 'i' 'r' and 'e' !!!}
  1640. case consttype of
  1641. conststring : begin
  1642. { I had to remove ibm2ascii !! }
  1643. st := pstring(value)^;
  1644. {st := ibm2ascii(pstring(value)^);}
  1645. st := 's'''+st+'''';
  1646. end;
  1647. constbool,
  1648. constint,
  1649. constpointer,
  1650. constord,
  1651. constchar : st := 'i'+tostr(value);
  1652. constreal : begin
  1653. system.str(pbestreal(value)^,st);
  1654. st := 'r'+st;
  1655. end;
  1656. { if we don't know just put zero !! }
  1657. else st:='i0';
  1658. {***SETCONST}
  1659. {constset:;} {*** I don't know what to do with a set.}
  1660. { sets are not recognized by GDB}
  1661. {***}
  1662. end;
  1663. stabstring := strpnew('"'+name+':c='+st+'",'+tostr(N_function)+',0,'+
  1664. tostr(fileinfo.line)+',0');
  1665. end;
  1666. procedure tconstsym.concatstabto(asmlist : paasmoutput);
  1667. begin
  1668. if consttype <> conststring then
  1669. inherited concatstabto(asmlist);
  1670. end;
  1671. {$endif GDB}
  1672. {****************************************************************************
  1673. TENUMSYM
  1674. ****************************************************************************}
  1675. constructor tenumsym.init(const n : string;def : penumdef;v : longint);
  1676. begin
  1677. tsym.init(n);
  1678. typ:=enumsym;
  1679. definition:=def;
  1680. value:=v;
  1681. if def^.min>v then
  1682. def^.setmin(v);
  1683. if def^.max<v then
  1684. def^.setmax(v);
  1685. order;
  1686. end;
  1687. constructor tenumsym.load;
  1688. begin
  1689. tsym.load;
  1690. typ:=enumsym;
  1691. definition:=penumdef(readdefref);
  1692. value:=readlong;
  1693. nextenum := Nil;
  1694. end;
  1695. procedure tenumsym.deref;
  1696. begin
  1697. resolvedef(pdef(definition));
  1698. order;
  1699. end;
  1700. procedure tenumsym.order;
  1701. var
  1702. sym : penumsym;
  1703. begin
  1704. sym := definition^.firstenum;
  1705. if sym = nil then
  1706. begin
  1707. definition^.firstenum := @self;
  1708. nextenum := nil;
  1709. exit;
  1710. end;
  1711. { reorder the symbols in increasing value }
  1712. if value < sym^.value then
  1713. begin
  1714. nextenum := sym;
  1715. definition^.firstenum := @self;
  1716. end
  1717. else
  1718. begin
  1719. while (sym^.value <= value) and assigned(sym^.nextenum) do
  1720. sym := sym^.nextenum;
  1721. nextenum := sym^.nextenum;
  1722. sym^.nextenum := @self;
  1723. end;
  1724. end;
  1725. procedure tenumsym.write;
  1726. begin
  1727. tsym.write;
  1728. writedefref(definition);
  1729. writelong(value);
  1730. current_ppu^.writeentry(ibenumsym);
  1731. end;
  1732. {$ifdef GDB}
  1733. procedure tenumsym.concatstabto(asmlist : paasmoutput);
  1734. begin
  1735. {enum elements have no stab !}
  1736. end;
  1737. {$EndIf GDB}
  1738. {****************************************************************************
  1739. TTYPESYM
  1740. ****************************************************************************}
  1741. constructor ttypesym.init(const n : string;d : pdef);
  1742. begin
  1743. tsym.init(n);
  1744. typ:=typesym;
  1745. definition:=d;
  1746. {$ifdef GDB}
  1747. isusedinstab := false;
  1748. {$endif GDB}
  1749. if assigned(definition) then
  1750. begin
  1751. if not(assigned(definition^.sym)) then
  1752. begin
  1753. definition^.sym:=@self;
  1754. synonym:=nil;
  1755. {$ifdef INCLUDEOK}
  1756. include(symoptions,sp_primary_typesym);
  1757. {$else}
  1758. symoptions:=symoptions+[sp_primary_typesym];
  1759. {$endif}
  1760. end
  1761. else
  1762. begin
  1763. synonym:=definition^.sym^.synonym;
  1764. definition^.sym^.synonym:=@self;
  1765. end;
  1766. end;
  1767. end;
  1768. constructor ttypesym.load;
  1769. begin
  1770. tsym.load;
  1771. typ:=typesym;
  1772. synonym:=nil;
  1773. {$ifdef GDB}
  1774. isusedinstab := false;
  1775. {$endif GDB}
  1776. definition:=readdefref;
  1777. end;
  1778. destructor ttypesym.done;
  1779. var prevsym : ptypesym;
  1780. begin
  1781. if assigned(definition) then
  1782. begin
  1783. prevsym:=definition^.sym;
  1784. if prevsym=@self then
  1785. definition^.sym:=synonym;
  1786. while assigned(prevsym) do
  1787. begin
  1788. if (prevsym^.synonym=@self) then
  1789. begin
  1790. prevsym^.synonym:=synonym;
  1791. break;
  1792. end;
  1793. prevsym:=prevsym^.synonym;
  1794. end;
  1795. end;
  1796. synonym:=nil;
  1797. definition:=nil;
  1798. inherited done;
  1799. end;
  1800. procedure ttypesym.deref;
  1801. begin
  1802. resolvedef(definition);
  1803. if assigned(definition) then
  1804. begin
  1805. if (sp_primary_typesym in symoptions) then
  1806. begin
  1807. if definition^.sym<>@self then
  1808. synonym:=definition^.sym;
  1809. definition^.sym:=@self;
  1810. end
  1811. else
  1812. begin
  1813. if assigned(definition^.sym) then
  1814. begin
  1815. synonym:=definition^.sym^.synonym;
  1816. if definition^.sym<>@self then
  1817. definition^.sym^.synonym:=@self;
  1818. end
  1819. else
  1820. definition^.sym:=@self;
  1821. end;
  1822. if (definition^.deftype=recorddef) and assigned(precorddef(definition)^.symtable) and
  1823. (definition^.sym=@self) then
  1824. precorddef(definition)^.symtable^.name:=stringdup('record '+name);
  1825. end;
  1826. end;
  1827. procedure ttypesym.write;
  1828. begin
  1829. tsym.write;
  1830. writedefref(definition);
  1831. current_ppu^.writeentry(ibtypesym);
  1832. end;
  1833. procedure ttypesym.load_references;
  1834. begin
  1835. inherited load_references;
  1836. if (definition^.deftype=recorddef) then
  1837. precorddef(definition)^.symtable^.load_browser;
  1838. if (definition^.deftype=objectdef) then
  1839. pobjectdef(definition)^.symtable^.load_browser;
  1840. end;
  1841. function ttypesym.write_references : boolean;
  1842. begin
  1843. if not inherited write_references then
  1844. { write address of this symbol if record or object
  1845. even if no real refs are there
  1846. because we need it for the symtable }
  1847. if (definition^.deftype=recorddef) or
  1848. (definition^.deftype=objectdef) then
  1849. begin
  1850. writesymref(@self);
  1851. current_ppu^.writeentry(ibsymref);
  1852. end;
  1853. write_references:=true;
  1854. if (definition^.deftype=recorddef) then
  1855. precorddef(definition)^.symtable^.write_browser;
  1856. if (definition^.deftype=objectdef) then
  1857. pobjectdef(definition)^.symtable^.write_browser;
  1858. end;
  1859. {$ifdef BrowserLog}
  1860. procedure ttypesym.add_to_browserlog;
  1861. begin
  1862. inherited add_to_browserlog;
  1863. if (definition^.deftype=recorddef) then
  1864. precorddef(definition)^.symtable^.writebrowserlog;
  1865. if (definition^.deftype=objectdef) then
  1866. pobjectdef(definition)^.symtable^.writebrowserlog;
  1867. end;
  1868. {$endif BrowserLog}
  1869. {$ifdef GDB}
  1870. function ttypesym.stabstring : pchar;
  1871. var stabchar : string[2];
  1872. short : string;
  1873. begin
  1874. if definition^.deftype in tagtypes then
  1875. stabchar := 'Tt'
  1876. else
  1877. stabchar := 't';
  1878. short := '"'+name+':'+stabchar+definition^.numberstring
  1879. +'",'+tostr(N_LSYM)+',0,'+tostr(fileinfo.line)+',0';
  1880. stabstring := strpnew(short);
  1881. end;
  1882. procedure ttypesym.concatstabto(asmlist : paasmoutput);
  1883. begin
  1884. {not stabs for forward defs }
  1885. if assigned(definition) then
  1886. if (definition^.sym = @self) then
  1887. definition^.concatstabto(asmlist)
  1888. else
  1889. inherited concatstabto(asmlist);
  1890. end;
  1891. {$endif GDB}
  1892. {****************************************************************************
  1893. TSYSSYM
  1894. ****************************************************************************}
  1895. constructor tsyssym.init(const n : string;l : longint);
  1896. begin
  1897. inherited init(n);
  1898. typ:=syssym;
  1899. number:=l;
  1900. end;
  1901. constructor tsyssym.load;
  1902. begin
  1903. tsym.load;
  1904. typ:=syssym;
  1905. number:=readlong;
  1906. end;
  1907. destructor tsyssym.done;
  1908. begin
  1909. inherited done;
  1910. end;
  1911. procedure tsyssym.write;
  1912. begin
  1913. tsym.write;
  1914. writelong(number);
  1915. current_ppu^.writeentry(ibsyssym);
  1916. end;
  1917. {$ifdef GDB}
  1918. procedure tsyssym.concatstabto(asmlist : paasmoutput);
  1919. begin
  1920. end;
  1921. {$endif GDB}
  1922. {****************************************************************************
  1923. TMACROSYM
  1924. ****************************************************************************}
  1925. constructor tmacrosym.init(const n : string);
  1926. begin
  1927. inherited init(n);
  1928. typ:=macrosym;
  1929. defined:=true;
  1930. defined_at_startup:=false;
  1931. is_used:=false;
  1932. buftext:=nil;
  1933. buflen:=0;
  1934. end;
  1935. destructor tmacrosym.done;
  1936. begin
  1937. if assigned(buftext) then
  1938. freemem(buftext,buflen);
  1939. inherited done;
  1940. end;
  1941. {
  1942. $Log$
  1943. Revision 1.127 1999-11-17 17:05:04 pierre
  1944. * Notes/hints changes
  1945. Revision 1.126 1999/11/15 22:00:48 peter
  1946. * labels used but not defined give error instead of warning, the warning
  1947. is now only with declared but not defined and not used.
  1948. Revision 1.125 1999/11/08 14:02:17 florian
  1949. * problem with "index X"-properties solved
  1950. * typed constants of class references are now allowed
  1951. Revision 1.124 1999/11/06 14:34:27 peter
  1952. * truncated log to 20 revs
  1953. Revision 1.123 1999/11/05 17:18:03 pierre
  1954. * local browsing works at first level
  1955. ie for function defined in interface or implementation
  1956. not yet for functions inside other functions
  1957. Revision 1.122 1999/10/21 16:41:41 florian
  1958. * problems with readln fixed: esi wasn't restored correctly when
  1959. reading ordinal fields of objects futher the register allocation
  1960. didn't take care of the extra register when reading ordinal values
  1961. * enumerations can now be used in constant indexes of properties
  1962. Revision 1.121 1999/10/01 08:02:48 peter
  1963. * forward type declaration rewritten
  1964. Revision 1.120 1999/09/27 23:44:58 peter
  1965. * procinfo is now a pointer
  1966. * support for result setting in sub procedure
  1967. Revision 1.119 1999/09/26 21:30:22 peter
  1968. + constant pointer support which can happend with typecasting like
  1969. const p=pointer(1)
  1970. * better procvar parsing in typed consts
  1971. Revision 1.118 1999/09/20 16:39:03 peter
  1972. * cs_create_smart instead of cs_smartlink
  1973. * -CX is create smartlink
  1974. * -CD is create dynamic, but does nothing atm.
  1975. Revision 1.117 1999/08/31 15:42:24 pierre
  1976. + tmacrosym is_used and defined_at_startup boolean fields added
  1977. Revision 1.116 1999/08/24 22:38:55 michael
  1978. * more resourcestring changes
  1979. Revision 1.115 1999/08/23 11:45:42 michael
  1980. * Hopefully final attempt at resourcestrings
  1981. Revision 1.114 1999/08/15 21:57:58 michael
  1982. Changes for resource strings
  1983. Revision 1.113 1999/08/14 00:39:00 peter
  1984. * hack to support property with record fields
  1985. Revision 1.112 1999/08/13 14:24:20 pierre
  1986. + stabs for classes and classref working,
  1987. a class still needs an ^ to get that content of it,
  1988. but the class fields inside a class don't result into an
  1989. infinite loop anymore!
  1990. Revision 1.111 1999/08/10 12:36:31 pierre
  1991. * use of procsym field for correct gdb info in local procedures
  1992. * exported DLL vars made global to be able to use DLLTOOL with themz
  1993. Revision 1.110 1999/08/07 14:21:03 florian
  1994. * some small problems fixed
  1995. Revision 1.109 1999/08/07 13:24:34 daniel
  1996. * Fixed open arrays
  1997. Revision 1.108 1999/08/05 16:53:17 peter
  1998. * V_Fatal=1, all other V_ are also increased
  1999. * Check for local procedure when assigning procvar
  2000. * fixed comment parsing because directives
  2001. * oldtp mode directives better supported
  2002. * added some messages to errore.msg
  2003. Revision 1.107 1999/08/04 13:45:30 florian
  2004. + floating point register variables !!
  2005. * pairegalloc is now generated for register variables
  2006. Revision 1.106 1999/08/03 22:03:19 peter
  2007. * moved bitmask constants to sets
  2008. * some other type/const renamings
  2009. Revision 1.105 1999/07/29 20:54:10 peter
  2010. * write .size also
  2011. Revision 1.104 1999/07/27 23:42:21 peter
  2012. * indirect type referencing is now allowed
  2013. }