symsym.inc 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245
  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. code:=nil;
  184. end;
  185. constructor tlabelsym.load;
  186. begin
  187. tsym.load;
  188. typ:=labelsym;
  189. { this is all dummy
  190. it is only used for local browsing }
  191. lab:=nil;
  192. code:=nil;
  193. used:=false;
  194. defined:=true;
  195. end;
  196. destructor tlabelsym.done;
  197. begin
  198. inherited done;
  199. end;
  200. function tlabelsym.mangledname : string;
  201. begin
  202. mangledname:=lab^.name;
  203. end;
  204. procedure tlabelsym.write;
  205. begin
  206. if owner^.symtabletype in [unitsymtable,globalsymtable] then
  207. Message(sym_e_ill_label_decl)
  208. else
  209. begin
  210. tsym.write;
  211. current_ppu^.writeentry(iblabelsym);
  212. end;
  213. end;
  214. {****************************************************************************
  215. TUNITSYM
  216. ****************************************************************************}
  217. constructor tunitsym.init(const n : string;ref : punitsymtable);
  218. var
  219. old_make_ref : boolean;
  220. begin
  221. old_make_ref:=make_ref;
  222. make_ref:=false;
  223. inherited init(n);
  224. make_ref:=old_make_ref;
  225. typ:=unitsym;
  226. unitsymtable:=ref;
  227. prevsym:=ref^.unitsym;
  228. ref^.unitsym:=@self;
  229. refs:=0;
  230. end;
  231. constructor tunitsym.load;
  232. begin
  233. tsym.load;
  234. typ:=unitsym;
  235. unitsymtable:=punitsymtable(current_module^.globalsymtable);
  236. prevsym:=nil;
  237. end;
  238. { we need to remove it from the prevsym chain ! }
  239. destructor tunitsym.done;
  240. var pus,ppus : punitsym;
  241. begin
  242. if assigned(unitsymtable) then
  243. begin
  244. ppus:=nil;
  245. pus:=unitsymtable^.unitsym;
  246. if pus=@self then
  247. unitsymtable^.unitsym:=prevsym
  248. else while assigned(pus) do
  249. begin
  250. if pus=@self then
  251. begin
  252. ppus^.prevsym:=prevsym;
  253. break;
  254. end
  255. else
  256. begin
  257. ppus:=pus;
  258. pus:=ppus^.prevsym;
  259. end;
  260. end;
  261. end;
  262. prevsym:=nil;
  263. unitsymtable:=nil;
  264. inherited done;
  265. end;
  266. procedure tunitsym.write;
  267. begin
  268. tsym.write;
  269. current_ppu^.writeentry(ibunitsym);
  270. end;
  271. {$ifdef GDB}
  272. procedure tunitsym.concatstabto(asmlist : paasmoutput);
  273. begin
  274. {Nothing to write to stabs !}
  275. end;
  276. {$endif GDB}
  277. {****************************************************************************
  278. TPROCSYM
  279. ****************************************************************************}
  280. constructor tprocsym.init(const n : string);
  281. begin
  282. tsym.init(n);
  283. typ:=procsym;
  284. definition:=nil;
  285. owner:=nil;
  286. is_global := false;
  287. end;
  288. constructor tprocsym.load;
  289. begin
  290. tsym.load;
  291. typ:=procsym;
  292. definition:=pprocdef(readdefref);
  293. is_global := false;
  294. end;
  295. destructor tprocsym.done;
  296. begin
  297. { don't check if errors !! }
  298. if Errorcount=0 then
  299. check_forward;
  300. tsym.done;
  301. end;
  302. function tprocsym.mangledname : string;
  303. begin
  304. mangledname:=definition^.mangledname;
  305. end;
  306. function tprocsym.demangledname:string;
  307. begin
  308. demangledname:=name+definition^.demangled_paras;
  309. end;
  310. procedure tprocsym.write_parameter_lists;
  311. var
  312. p : pprocdef;
  313. begin
  314. p:=definition;
  315. while assigned(p) do
  316. begin
  317. { force the error to be printed }
  318. Verbose.Message1(sym_b_param_list,name+p^.demangled_paras);
  319. p:=p^.nextoverloaded;
  320. end;
  321. end;
  322. procedure tprocsym.check_forward;
  323. var
  324. pd : pprocdef;
  325. begin
  326. pd:=definition;
  327. while assigned(pd) do
  328. begin
  329. if pd^.forwarddef then
  330. begin
  331. if assigned(pd^._class) then
  332. MessagePos1(fileinfo,sym_e_forward_not_resolved,pd^._class^.objname^+'.'+demangledname)
  333. else
  334. MessagePos1(fileinfo,sym_e_forward_not_resolved,demangledname);
  335. { Turn futher error messages off }
  336. pd^.forwarddef:=false;
  337. end;
  338. pd:=pd^.nextoverloaded;
  339. end;
  340. end;
  341. procedure tprocsym.deref;
  342. var
  343. t : ttoken;
  344. last : pprocdef;
  345. begin
  346. resolvedef(pdef(definition));
  347. if (definition^.proctypeoption=potype_operator) then
  348. begin
  349. last:=definition;
  350. while assigned(last^.nextoverloaded) do
  351. last:=last^.nextoverloaded;
  352. for t:=first_overloaded to last_overloaded do
  353. if (name=overloaded_names[t]) then
  354. begin
  355. if assigned(overloaded_operators[t]) then
  356. last^.nextoverloaded:=overloaded_operators[t]^.definition;
  357. overloaded_operators[t]:=@self;
  358. end;
  359. end;
  360. end;
  361. procedure tprocsym.order_overloaded;
  362. var firstdef,currdef,lastdef : pprocdef;
  363. begin
  364. firstdef:=definition;
  365. currdef:=definition;
  366. while assigned(currdef) do
  367. begin
  368. currdef^.count:=false;
  369. currdef:=currdef^.nextoverloaded;
  370. end;
  371. definition:=definition^.nextoverloaded;
  372. firstdef^.nextoverloaded:=nil;
  373. while assigned(definition) do
  374. begin
  375. currdef:=firstdef;
  376. lastdef:=definition;
  377. definition:=definition^.nextoverloaded;
  378. if lastdef^.mangledname<firstdef^.mangledname then
  379. begin
  380. lastdef^.nextoverloaded:=firstdef;
  381. firstdef:=lastdef;
  382. end
  383. else
  384. begin
  385. while assigned(currdef^.nextoverloaded) and
  386. (lastdef^.mangledname>currdef^.nextoverloaded^.mangledname) do
  387. currdef:=currdef^.nextoverloaded;
  388. lastdef^.nextoverloaded:=currdef^.nextoverloaded;
  389. currdef^.nextoverloaded:=lastdef;
  390. end;
  391. end;
  392. definition:=firstdef;
  393. currdef:=definition;
  394. while assigned(currdef) do
  395. begin
  396. currdef^.count:=true;
  397. currdef:=currdef^.nextoverloaded;
  398. end;
  399. end;
  400. procedure tprocsym.write;
  401. begin
  402. tsym.write;
  403. writedefref(pdef(definition));
  404. current_ppu^.writeentry(ibprocsym);
  405. end;
  406. procedure tprocsym.load_references;
  407. (*var
  408. prdef,prdef2 : pprocdef;
  409. b : byte; *)
  410. begin
  411. inherited load_references;
  412. (*prdef:=definition;
  413. done in tsymtable.load_browser (PM)
  414. { take care about operators !! }
  415. if (current_module^.flags and uf_has_browser) <>0 then
  416. while assigned(prdef) and (prdef^.owner=definition^.owner) do
  417. begin
  418. b:=current_ppu^.readentry;
  419. if b<>ibdefref then
  420. Message(unit_f_ppu_read_error);
  421. prdef2:=pprocdef(readdefref);
  422. resolvedef(prdef2);
  423. if prdef<>prdef2 then
  424. Message(unit_f_ppu_read_error);
  425. prdef^.load_references;
  426. prdef:=prdef^.nextoverloaded;
  427. end; *)
  428. end;
  429. function tprocsym.write_references : boolean;
  430. var
  431. prdef : pprocdef;
  432. begin
  433. write_references:=false;
  434. if not inherited write_references then
  435. exit;
  436. write_references:=true;
  437. prdef:=definition;
  438. while assigned(prdef) and (prdef^.owner=definition^.owner) do
  439. begin
  440. prdef^.write_references;
  441. prdef:=prdef^.nextoverloaded;
  442. end;
  443. end;
  444. {$ifdef BrowserLog}
  445. procedure tprocsym.add_to_browserlog;
  446. var
  447. prdef : pprocdef;
  448. begin
  449. inherited add_to_browserlog;
  450. prdef:=definition;
  451. while assigned(prdef) do
  452. begin
  453. pprocdef(prdef)^.add_to_browserlog;
  454. prdef:=pprocdef(prdef)^.nextoverloaded;
  455. end;
  456. end;
  457. {$endif BrowserLog}
  458. {$ifdef GDB}
  459. function tprocsym.stabstring : pchar;
  460. Var RetType : Char;
  461. Obj,Info : String;
  462. stabsstr : string;
  463. p : pchar;
  464. begin
  465. obj := name;
  466. info := '';
  467. if is_global then
  468. RetType := 'F'
  469. else
  470. RetType := 'f';
  471. if assigned(owner) then
  472. begin
  473. if (owner^.symtabletype = objectsymtable) then
  474. obj := owner^.name^+'__'+name;
  475. { this code was correct only as long as the local symboltable
  476. of the parent had the same name as the function
  477. but this is no true anymore !! PM
  478. if (owner^.symtabletype=localsymtable) and assigned(owner^.name) then
  479. info := ','+name+','+owner^.name^; }
  480. if (owner^.symtabletype=localsymtable) and assigned(owner^.defowner) and
  481. assigned(pprocdef(owner^.defowner)^.procsym) then
  482. info := ','+name+','+pprocdef(owner^.defowner)^.procsym^.name;
  483. end;
  484. stabsstr:=definition^.mangledname;
  485. getmem(p,length(stabsstr)+255);
  486. strpcopy(p,'"'+obj+':'+RetType
  487. +definition^.rettype.def^.numberstring+info+'",'+tostr(n_function)
  488. +',0,'+
  489. tostr(aktfilepos.line)
  490. +',');
  491. strpcopy(strend(p),stabsstr);
  492. stabstring:=strnew(p);
  493. freemem(p,length(stabsstr)+255);
  494. end;
  495. procedure tprocsym.concatstabto(asmlist : paasmoutput);
  496. begin
  497. if (pocall_internproc in definition^.proccalloptions) then exit;
  498. if not isstabwritten then
  499. asmlist^.concat(new(pai_stabs,init(stabstring)));
  500. isstabwritten := true;
  501. if assigned(definition^.parast) then
  502. definition^.parast^.concatstabto(asmlist);
  503. if assigned(definition^.localst) then
  504. definition^.localst^.concatstabto(asmlist);
  505. definition^.is_def_stab_written := true;
  506. end;
  507. {$endif GDB}
  508. {****************************************************************************
  509. TPROGRAMSYM
  510. ****************************************************************************}
  511. constructor tprogramsym.init(const n : string);
  512. begin
  513. inherited init(n);
  514. typ:=programsym;
  515. end;
  516. {****************************************************************************
  517. TERRORSYM
  518. ****************************************************************************}
  519. constructor terrorsym.init;
  520. begin
  521. inherited init('');
  522. typ:=errorsym;
  523. end;
  524. {****************************************************************************
  525. TPROPERTYSYM
  526. ****************************************************************************}
  527. constructor tpropertysym.init(const n : string);
  528. begin
  529. inherited init(n);
  530. typ:=propertysym;
  531. propoptions:=[];
  532. index:=0;
  533. default:=0;
  534. proptype.reset;
  535. indextype.reset;
  536. new(readaccess,init);
  537. new(writeaccess,init);
  538. new(storedaccess,init);
  539. end;
  540. constructor tpropertysym.load;
  541. begin
  542. inherited load;
  543. typ:=propertysym;
  544. readsmallset(propoptions);
  545. if (ppo_is_override in propoptions) then
  546. begin
  547. propoverriden:=ppropertysym(readsymref);
  548. { we need to have these objects initialized }
  549. new(readaccess,init);
  550. new(writeaccess,init);
  551. new(storedaccess,init);
  552. end
  553. else
  554. begin
  555. proptype.load;
  556. index:=readlong;
  557. default:=readlong;
  558. indextype.load;
  559. new(readaccess,load);
  560. new(writeaccess,load);
  561. new(storedaccess,load);
  562. end;
  563. end;
  564. destructor tpropertysym.done;
  565. begin
  566. dispose(readaccess,done);
  567. dispose(writeaccess,done);
  568. dispose(storedaccess,done);
  569. inherited done;
  570. end;
  571. procedure tpropertysym.deref;
  572. begin
  573. if (ppo_is_override in propoptions) then
  574. begin
  575. resolvesym(psym(propoverriden));
  576. dooverride(propoverriden);
  577. end
  578. else
  579. begin
  580. proptype.resolve;
  581. indextype.resolve;
  582. readaccess^.resolve;
  583. writeaccess^.resolve;
  584. storedaccess^.resolve;
  585. end;
  586. end;
  587. function tpropertysym.getsize : longint;
  588. begin
  589. getsize:=0;
  590. end;
  591. procedure tpropertysym.write;
  592. begin
  593. tsym.write;
  594. writesmallset(propoptions);
  595. if (ppo_is_override in propoptions) then
  596. writesymref(propoverriden)
  597. else
  598. begin
  599. proptype.write;
  600. writelong(index);
  601. writelong(default);
  602. indextype.write;
  603. readaccess^.write;
  604. writeaccess^.write;
  605. storedaccess^.write;
  606. end;
  607. current_ppu^.writeentry(ibpropertysym);
  608. end;
  609. procedure tpropertysym.dooverride(overriden:ppropertysym);
  610. begin
  611. propoverriden:=overriden;
  612. proptype:=overriden^.proptype;
  613. propoptions:=overriden^.propoptions+[ppo_is_override];
  614. index:=overriden^.index;
  615. default:=overriden^.default;
  616. indextype:=overriden^.indextype;
  617. readaccess^.clear;
  618. readaccess:=overriden^.readaccess^.getcopy;
  619. writeaccess^.clear;
  620. writeaccess:=overriden^.writeaccess^.getcopy;
  621. storedaccess^.clear;
  622. storedaccess:=overriden^.storedaccess^.getcopy;
  623. end;
  624. {$ifdef GDB}
  625. function tpropertysym.stabstring : pchar;
  626. begin
  627. { !!!! don't know how to handle }
  628. stabstring:=strpnew('');
  629. end;
  630. procedure tpropertysym.concatstabto(asmlist : paasmoutput);
  631. begin
  632. { !!!! don't know how to handle }
  633. end;
  634. {$endif GDB}
  635. {****************************************************************************
  636. TFUNCRETSYM
  637. ****************************************************************************}
  638. constructor tfuncretsym.init(const n : string;approcinfo : pointer{pprocinfo});
  639. begin
  640. tsym.init(n);
  641. typ:=funcretsym;
  642. funcretprocinfo:=approcinfo;
  643. rettype:=pprocinfo(approcinfo)^.returntype;
  644. { address valid for ret in param only }
  645. { otherwise set by insert }
  646. address:=pprocinfo(approcinfo)^.return_offset;
  647. end;
  648. constructor tfuncretsym.load;
  649. begin
  650. tsym.load;
  651. rettype.load;
  652. address:=readlong;
  653. funcretprocinfo:=nil;
  654. typ:=funcretsym;
  655. end;
  656. destructor tfuncretsym.done;
  657. begin
  658. inherited done;
  659. end;
  660. procedure tfuncretsym.write;
  661. begin
  662. tsym.write;
  663. rettype.write;
  664. writelong(address);
  665. current_ppu^.writeentry(ibfuncretsym);
  666. end;
  667. procedure tfuncretsym.deref;
  668. begin
  669. rettype.resolve;
  670. end;
  671. {$ifdef GDB}
  672. procedure tfuncretsym.concatstabto(asmlist : paasmoutput);
  673. begin
  674. { Nothing to do here, it is done in genexitcode }
  675. end;
  676. {$endif GDB}
  677. procedure tfuncretsym.insert_in_data;
  678. var
  679. l : longint;
  680. begin
  681. { if retoffset is already set then reuse it, this is needed
  682. when inserting the result variable }
  683. if procinfo^.return_offset<>0 then
  684. address:=procinfo^.return_offset
  685. else
  686. begin
  687. { allocate space in local if ret in acc or in fpu }
  688. if ret_in_acc(procinfo^.returntype.def) or (procinfo^.returntype.def^.deftype=floatdef) then
  689. begin
  690. l:=rettype.def^.size;
  691. inc(owner^.datasize,l);
  692. {$ifdef m68k}
  693. { word alignment required for motorola }
  694. if (l=1) then
  695. inc(owner^.datasize,1)
  696. else
  697. {$endif}
  698. if (l>=4) and ((owner^.datasize and 3)<>0) then
  699. inc(owner^.datasize,4-(owner^.datasize and 3))
  700. else if (l>=2) and ((owner^.datasize and 1)<>0) then
  701. inc(owner^.datasize,2-(owner^.datasize and 1));
  702. address:=owner^.datasize;
  703. procinfo^.return_offset:=-owner^.datasize;
  704. end;
  705. end;
  706. end;
  707. {****************************************************************************
  708. TABSOLUTESYM
  709. ****************************************************************************}
  710. constructor tabsolutesym.init(const n : string;const tt : ttype);
  711. begin
  712. inherited init(n,tt);
  713. typ:=absolutesym;
  714. end;
  715. constructor tabsolutesym.initdef(const n : string;p : pdef);
  716. var
  717. t : ttype;
  718. begin
  719. t.setdef(p);
  720. tabsolutesym.init(n,t);
  721. end;
  722. constructor tabsolutesym.load;
  723. begin
  724. tvarsym.load;
  725. typ:=absolutesym;
  726. ref:=nil;
  727. address:=0;
  728. asmname:=nil;
  729. abstyp:=absolutetyp(readbyte);
  730. absseg:=false;
  731. case abstyp of
  732. tovar :
  733. begin
  734. asmname:=stringdup(readstring);
  735. ref:=srsym;
  736. end;
  737. toasm :
  738. asmname:=stringdup(readstring);
  739. toaddr :
  740. begin
  741. address:=readlong;
  742. absseg:=boolean(readbyte);
  743. end;
  744. end;
  745. end;
  746. procedure tabsolutesym.write;
  747. var
  748. hvo : tvaroptions;
  749. begin
  750. { Note: This needs to write everything of tvarsym.write }
  751. tsym.write;
  752. writebyte(byte(varspez));
  753. if read_member then
  754. writelong(address);
  755. { write only definition or definitionsym }
  756. vartype.write;
  757. hvo:=varoptions-[vo_regable];
  758. writesmallset(hvo);
  759. writebyte(byte(abstyp));
  760. case abstyp of
  761. tovar :
  762. writestring(ref^.name);
  763. toasm :
  764. writestring(asmname^);
  765. toaddr :
  766. begin
  767. writelong(address);
  768. writebyte(byte(absseg));
  769. end;
  770. end;
  771. current_ppu^.writeentry(ibabsolutesym);
  772. end;
  773. procedure tabsolutesym.deref;
  774. begin
  775. tvarsym.deref;
  776. if (abstyp=tovar) and (asmname<>nil) then
  777. begin
  778. { search previous loaded symtables }
  779. getsym(asmname^,false);
  780. if not(assigned(srsym)) then
  781. getsymonlyin(owner,asmname^);
  782. if not(assigned(srsym)) then
  783. srsym:=generrorsym;
  784. ref:=srsym;
  785. stringdispose(asmname);
  786. end;
  787. end;
  788. function tabsolutesym.mangledname : string;
  789. begin
  790. case abstyp of
  791. tovar :
  792. mangledname:=ref^.mangledname;
  793. toasm :
  794. mangledname:=asmname^;
  795. toaddr :
  796. mangledname:='$'+tostr(address);
  797. else
  798. internalerror(10002);
  799. end;
  800. end;
  801. procedure tabsolutesym.insert_in_data;
  802. begin
  803. end;
  804. {$ifdef GDB}
  805. procedure tabsolutesym.concatstabto(asmlist : paasmoutput);
  806. begin
  807. { I don't know how to handle this !! }
  808. end;
  809. {$endif GDB}
  810. {****************************************************************************
  811. TVARSYM
  812. ****************************************************************************}
  813. constructor tvarsym.init(const n : string;const tt : ttype);
  814. begin
  815. tsym.init(n);
  816. typ:=varsym;
  817. vartype:=tt;
  818. _mangledname:=nil;
  819. varspez:=vs_value;
  820. address:=0;
  821. localvarsym:=nil;
  822. refs:=0;
  823. varstate:=vs_used;
  824. varoptions:=[];
  825. { can we load the value into a register ? }
  826. if tt.def^.is_intregable then
  827. {$ifdef INCLUDEOK}
  828. include(varoptions,vo_regable)
  829. {$else}
  830. varoptions:=varoptions+[vo_regable]
  831. {$endif}
  832. else
  833. {$ifdef INCLUDEOK}
  834. exclude(varoptions,vo_regable);
  835. {$else}
  836. varoptions:=varoptions-[vo_regable];
  837. {$endif}
  838. if tt.def^.is_fpuregable then
  839. {$ifdef INCLUDEOK}
  840. include(varoptions,vo_fpuregable)
  841. {$else}
  842. varoptions:=varoptions+[vo_fpuregable]
  843. {$endif}
  844. else
  845. {$ifdef INCLUDEOK}
  846. exclude(varoptions,vo_regable);
  847. {$else}
  848. varoptions:=varoptions-[vo_fpuregable];
  849. {$endif}
  850. reg:=R_NO;
  851. end;
  852. constructor tvarsym.init_dll(const n : string;const tt : ttype);
  853. begin
  854. tvarsym.init(n,tt);
  855. {$ifdef INCLUDEOK}
  856. include(varoptions,vo_is_dll_var);
  857. {$else}
  858. varoptions:=varoptions+[vo_is_dll_var];
  859. {$endif}
  860. end;
  861. constructor tvarsym.init_C(const n,mangled : string;const tt : ttype);
  862. begin
  863. tvarsym.init(n,tt);
  864. {$ifdef INCLUDEOK}
  865. include(varoptions,vo_is_C_var);
  866. {$else}
  867. varoptions:=varoptions+[vo_is_C_var];
  868. {$endif}
  869. setmangledname(mangled);
  870. end;
  871. constructor tvarsym.initdef(const n : string;p : pdef);
  872. var
  873. t : ttype;
  874. begin
  875. t.setdef(p);
  876. tvarsym.init(n,t);
  877. end;
  878. constructor tvarsym.load;
  879. begin
  880. tsym.load;
  881. typ:=varsym;
  882. _mangledname:=nil;
  883. reg:=R_NO;
  884. refs := 0;
  885. varstate:=vs_used;
  886. varspez:=tvarspez(readbyte);
  887. if read_member then
  888. address:=readlong
  889. else
  890. address:=0;
  891. localvarsym:=nil;
  892. vartype.load;
  893. readsmallset(varoptions);
  894. if (vo_is_C_var in varoptions) then
  895. setmangledname(readstring);
  896. end;
  897. destructor tvarsym.done;
  898. begin
  899. strdispose(_mangledname);
  900. inherited done;
  901. end;
  902. procedure tvarsym.deref;
  903. begin
  904. vartype.resolve;
  905. end;
  906. procedure tvarsym.write;
  907. var
  908. hvo : tvaroptions;
  909. begin
  910. tsym.write;
  911. writebyte(byte(varspez));
  912. if read_member then
  913. writelong(address);
  914. vartype.write;
  915. { symbols which are load are never candidates for a register,
  916. turn off the regable }
  917. hvo:=varoptions-[vo_regable];
  918. writesmallset(hvo);
  919. if (vo_is_C_var in varoptions) then
  920. writestring(mangledname);
  921. current_ppu^.writeentry(ibvarsym);
  922. end;
  923. procedure tvarsym.setmangledname(const s : string);
  924. begin
  925. _mangledname:=strpnew(s);
  926. end;
  927. function tvarsym.mangledname : string;
  928. var
  929. prefix : string;
  930. begin
  931. if assigned(_mangledname) then
  932. begin
  933. mangledname:=strpas(_mangledname);
  934. exit;
  935. end;
  936. case owner^.symtabletype of
  937. staticsymtable :
  938. if (cs_create_smart in aktmoduleswitches) then
  939. prefix:='_'+owner^.name^+'$$$_'
  940. else
  941. prefix:='_';
  942. unitsymtable,
  943. globalsymtable :
  944. prefix:=
  945. {$ifdef FPC_USE_CPREFIX}
  946. target_os.Cprefix+
  947. {$endif FPC_USE_CPREFIX}
  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. if assigned(restype.def) then
  1683. begin
  1684. if not(assigned(restype.def^.typesym)) then
  1685. begin
  1686. restype.def^.typesym:=@self;
  1687. synonym:=nil;
  1688. {$ifdef INCLUDEOK}
  1689. include(symoptions,sp_primary_typesym);
  1690. {$else}
  1691. symoptions:=symoptions+[sp_primary_typesym];
  1692. {$endif}
  1693. end
  1694. else
  1695. begin
  1696. synonym:=restype.def^.typesym^.synonym;
  1697. restype.def^.typesym^.synonym:=@self;
  1698. end;
  1699. end;
  1700. end;
  1701. constructor ttypesym.initdef(const n : string;d : pdef);
  1702. var
  1703. t : ttype;
  1704. begin
  1705. t.setdef(d);
  1706. ttypesym.init(n,t);
  1707. end;
  1708. constructor ttypesym.load;
  1709. begin
  1710. tsym.load;
  1711. typ:=typesym;
  1712. synonym:=nil;
  1713. {$ifdef GDB}
  1714. isusedinstab := false;
  1715. {$endif GDB}
  1716. restype.load;
  1717. end;
  1718. destructor ttypesym.done;
  1719. var
  1720. prevsym : ptypesym;
  1721. begin
  1722. if assigned(restype.def) then
  1723. begin
  1724. prevsym:=restype.def^.typesym;
  1725. if prevsym=@self then
  1726. restype.def^.typesym:=synonym;
  1727. while assigned(prevsym) do
  1728. begin
  1729. if (prevsym^.synonym=@self) then
  1730. begin
  1731. prevsym^.synonym:=synonym;
  1732. break;
  1733. end;
  1734. prevsym:=prevsym^.synonym;
  1735. end;
  1736. end;
  1737. synonym:=nil;
  1738. inherited done;
  1739. end;
  1740. procedure ttypesym.deref;
  1741. begin
  1742. restype.resolve;
  1743. if assigned(restype.def) then
  1744. begin
  1745. if (sp_primary_typesym in symoptions) then
  1746. begin
  1747. if restype.def^.typesym<>@self then
  1748. synonym:=restype.def^.typesym;
  1749. restype.def^.typesym:=@self;
  1750. end
  1751. else
  1752. begin
  1753. if assigned(restype.def^.typesym) then
  1754. begin
  1755. synonym:=restype.def^.typesym^.synonym;
  1756. if restype.def^.typesym<>@self then
  1757. restype.def^.typesym^.synonym:=@self;
  1758. end
  1759. else
  1760. restype.def^.typesym:=@self;
  1761. end;
  1762. if (restype.def^.deftype=recorddef) and assigned(precorddef(restype.def)^.symtable) and
  1763. (restype.def^.typesym=@self) then
  1764. precorddef(restype.def)^.symtable^.name:=stringdup('record '+name);
  1765. end;
  1766. end;
  1767. procedure ttypesym.write;
  1768. begin
  1769. tsym.write;
  1770. restype.write;
  1771. current_ppu^.writeentry(ibtypesym);
  1772. end;
  1773. procedure ttypesym.load_references;
  1774. begin
  1775. inherited load_references;
  1776. if (restype.def^.deftype=recorddef) then
  1777. precorddef(restype.def)^.symtable^.load_browser;
  1778. if (restype.def^.deftype=objectdef) then
  1779. pobjectdef(restype.def)^.symtable^.load_browser;
  1780. end;
  1781. function ttypesym.write_references : boolean;
  1782. begin
  1783. if not inherited write_references then
  1784. { write address of this symbol if record or object
  1785. even if no real refs are there
  1786. because we need it for the symtable }
  1787. if (restype.def^.deftype=recorddef) or
  1788. (restype.def^.deftype=objectdef) then
  1789. begin
  1790. writesymref(@self);
  1791. current_ppu^.writeentry(ibsymref);
  1792. end;
  1793. write_references:=true;
  1794. if (restype.def^.deftype=recorddef) then
  1795. precorddef(restype.def)^.symtable^.write_browser;
  1796. if (restype.def^.deftype=objectdef) then
  1797. pobjectdef(restype.def)^.symtable^.write_browser;
  1798. end;
  1799. {$ifdef BrowserLog}
  1800. procedure ttypesym.add_to_browserlog;
  1801. begin
  1802. inherited add_to_browserlog;
  1803. if (restype.def^.deftype=recorddef) then
  1804. precorddef(restype.def)^.symtable^.writebrowserlog;
  1805. if (restype.def^.deftype=objectdef) then
  1806. pobjectdef(restype.def)^.symtable^.writebrowserlog;
  1807. end;
  1808. {$endif BrowserLog}
  1809. {$ifdef GDB}
  1810. function ttypesym.stabstring : pchar;
  1811. var
  1812. stabchar : string[2];
  1813. short : string;
  1814. begin
  1815. if restype.def^.deftype in tagtypes then
  1816. stabchar := 'Tt'
  1817. else
  1818. stabchar := 't';
  1819. short := '"'+name+':'+stabchar+restype.def^.numberstring
  1820. +'",'+tostr(N_LSYM)+',0,'+tostr(fileinfo.line)+',0';
  1821. stabstring := strpnew(short);
  1822. end;
  1823. procedure ttypesym.concatstabto(asmlist : paasmoutput);
  1824. begin
  1825. {not stabs for forward defs }
  1826. if assigned(restype.def) then
  1827. if (restype.def^.typesym = @self) then
  1828. restype.def^.concatstabto(asmlist)
  1829. else
  1830. inherited concatstabto(asmlist);
  1831. end;
  1832. {$endif GDB}
  1833. {****************************************************************************
  1834. TSYSSYM
  1835. ****************************************************************************}
  1836. constructor tsyssym.init(const n : string;l : longint);
  1837. begin
  1838. inherited init(n);
  1839. typ:=syssym;
  1840. number:=l;
  1841. end;
  1842. constructor tsyssym.load;
  1843. begin
  1844. tsym.load;
  1845. typ:=syssym;
  1846. number:=readlong;
  1847. end;
  1848. destructor tsyssym.done;
  1849. begin
  1850. inherited done;
  1851. end;
  1852. procedure tsyssym.write;
  1853. begin
  1854. tsym.write;
  1855. writelong(number);
  1856. current_ppu^.writeentry(ibsyssym);
  1857. end;
  1858. {$ifdef GDB}
  1859. procedure tsyssym.concatstabto(asmlist : paasmoutput);
  1860. begin
  1861. end;
  1862. {$endif GDB}
  1863. {****************************************************************************
  1864. TMACROSYM
  1865. ****************************************************************************}
  1866. constructor tmacrosym.init(const n : string);
  1867. begin
  1868. inherited init(n);
  1869. typ:=macrosym;
  1870. defined:=true;
  1871. defined_at_startup:=false;
  1872. is_used:=false;
  1873. buftext:=nil;
  1874. buflen:=0;
  1875. end;
  1876. destructor tmacrosym.done;
  1877. begin
  1878. if assigned(buftext) then
  1879. freemem(buftext,buflen);
  1880. inherited done;
  1881. end;
  1882. {
  1883. $Log$
  1884. Revision 1.133 1999-12-14 09:58:42 florian
  1885. + compiler checks now if a goto leaves an exception block
  1886. Revision 1.132 1999/12/01 12:42:33 peter
  1887. * fixed bug 698
  1888. * removed some notes about unused vars
  1889. Revision 1.131 1999/11/30 10:40:55 peter
  1890. + ttype, tsymlist
  1891. Revision 1.130 1999/11/26 00:19:12 peter
  1892. * property overriding dereference fix, but it need a bigger redesign
  1893. which i'll do tomorrow. This quick hack is for the lazarus ppl so
  1894. they can hack on mwcustomedit.
  1895. Revision 1.129 1999/11/21 01:42:37 pierre
  1896. * Nextoverloading ordering fix
  1897. Revision 1.128 1999/11/20 01:22:20 pierre
  1898. + cond FPC_USE_CPREFIX (needs also some RTL changes)
  1899. this allows to use unit global vars as DLL exports
  1900. (the underline prefix seems needed by dlltool)
  1901. Revision 1.127 1999/11/17 17:05:04 pierre
  1902. * Notes/hints changes
  1903. Revision 1.126 1999/11/15 22:00:48 peter
  1904. * labels used but not defined give error instead of warning, the warning
  1905. is now only with declared but not defined and not used.
  1906. Revision 1.125 1999/11/08 14:02:17 florian
  1907. * problem with "index X"-properties solved
  1908. * typed constants of class references are now allowed
  1909. Revision 1.124 1999/11/06 14:34:27 peter
  1910. * truncated log to 20 revs
  1911. Revision 1.123 1999/11/05 17:18:03 pierre
  1912. * local browsing works at first level
  1913. ie for function defined in interface or implementation
  1914. not yet for functions inside other functions
  1915. Revision 1.122 1999/10/21 16:41:41 florian
  1916. * problems with readln fixed: esi wasn't restored correctly when
  1917. reading ordinal fields of objects futher the register allocation
  1918. didn't take care of the extra register when reading ordinal values
  1919. * enumerations can now be used in constant indexes of properties
  1920. Revision 1.121 1999/10/01 08:02:48 peter
  1921. * forward type declaration rewritten
  1922. Revision 1.120 1999/09/27 23:44:58 peter
  1923. * procinfo is now a pointer
  1924. * support for result setting in sub procedure
  1925. Revision 1.119 1999/09/26 21:30:22 peter
  1926. + constant pointer support which can happend with typecasting like
  1927. const p=pointer(1)
  1928. * better procvar parsing in typed consts
  1929. Revision 1.118 1999/09/20 16:39:03 peter
  1930. * cs_create_smart instead of cs_smartlink
  1931. * -CX is create smartlink
  1932. * -CD is create dynamic, but does nothing atm.
  1933. Revision 1.117 1999/08/31 15:42:24 pierre
  1934. + tmacrosym is_used and defined_at_startup boolean fields added
  1935. Revision 1.116 1999/08/24 22:38:55 michael
  1936. * more resourcestring changes
  1937. Revision 1.115 1999/08/23 11:45:42 michael
  1938. * Hopefully final attempt at resourcestrings
  1939. Revision 1.114 1999/08/15 21:57:58 michael
  1940. Changes for resource strings
  1941. Revision 1.113 1999/08/14 00:39:00 peter
  1942. * hack to support property with record fields
  1943. Revision 1.112 1999/08/13 14:24:20 pierre
  1944. + stabs for classes and classref working,
  1945. a class still needs an ^ to get that content of it,
  1946. but the class fields inside a class don't result into an
  1947. infinite loop anymore!
  1948. Revision 1.111 1999/08/10 12:36:31 pierre
  1949. * use of procsym field for correct gdb info in local procedures
  1950. * exported DLL vars made global to be able to use DLLTOOL with themz
  1951. Revision 1.110 1999/08/07 14:21:03 florian
  1952. * some small problems fixed
  1953. Revision 1.109 1999/08/07 13:24:34 daniel
  1954. * Fixed open arrays
  1955. Revision 1.108 1999/08/05 16:53:17 peter
  1956. * V_Fatal=1, all other V_ are also increased
  1957. * Check for local procedure when assigning procvar
  1958. * fixed comment parsing because directives
  1959. * oldtp mode directives better supported
  1960. * added some messages to errore.msg
  1961. Revision 1.107 1999/08/04 13:45:30 florian
  1962. + floating point register variables !!
  1963. * pairegalloc is now generated for register variables
  1964. Revision 1.106 1999/08/03 22:03:19 peter
  1965. * moved bitmask constants to sets
  1966. * some other type/const renamings
  1967. Revision 1.105 1999/07/29 20:54:10 peter
  1968. * write .size also
  1969. Revision 1.104 1999/07/27 23:42:21 peter
  1970. * indirect type referencing is now allowed
  1971. }