symsym.inc 65 KB

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