symsym.inc 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247
  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. 'U_'+owner^.name^+'_';
  946. else
  947. Message(sym_e_invalid_call_tvarsymmangledname);
  948. end;
  949. mangledname:=prefix+name;
  950. end;
  951. function tvarsym.getsize : longint;
  952. begin
  953. if assigned(vartype.def) and
  954. (varspez=vs_value) and
  955. ((vartype.def^.deftype<>arraydef) or
  956. (Parraydef(vartype.def)^.highrange>=Parraydef(vartype.def)^.lowrange)) then
  957. getsize:=vartype.def^.size
  958. else
  959. getsize:=0;
  960. end;
  961. function tvarsym.getpushsize : longint;
  962. begin
  963. if assigned(vartype.def) then
  964. begin
  965. case varspez of
  966. vs_var :
  967. getpushsize:=target_os.size_of_pointer;
  968. vs_value,
  969. vs_const :
  970. begin
  971. if push_addr_param(vartype.def) then
  972. getpushsize:=target_os.size_of_pointer
  973. else
  974. getpushsize:=vartype.def^.size;
  975. end;
  976. end;
  977. end
  978. else
  979. getpushsize:=0;
  980. end;
  981. function data_align(length : longint) : longint;
  982. begin
  983. (* this is useless under go32v2 at least
  984. because the section are only align to dword
  985. if length>8 then
  986. data_align:=16
  987. else if length>4 then
  988. data_align:=8
  989. else *)
  990. if length>2 then
  991. data_align:=4
  992. else
  993. if length>1 then
  994. data_align:=2
  995. else
  996. data_align:=1;
  997. end;
  998. procedure tvarsym.insert_in_data;
  999. var
  1000. varalign,
  1001. l,ali,modulo : longint;
  1002. storefilepos : tfileposinfo;
  1003. begin
  1004. if (vo_is_external in varoptions) then
  1005. exit;
  1006. { handle static variables of objects especially }
  1007. if read_member and (owner^.symtabletype=objectsymtable) and
  1008. (sp_static in symoptions) then
  1009. begin
  1010. { the data filed is generated in parser.pas
  1011. with a tobject_FIELDNAME variable }
  1012. { this symbol can't be loaded to a register }
  1013. {$ifdef INCLUDEOK}
  1014. exclude(varoptions,vo_regable);
  1015. exclude(varoptions,vo_fpuregable);
  1016. {$else}
  1017. varoptions:=varoptions-[vo_regable,vo_fpuregable];
  1018. {$endif}
  1019. end
  1020. else
  1021. if not(read_member) then
  1022. begin
  1023. { made problems with parameters etc. ! (FK) }
  1024. { check for instance of an abstract object or class }
  1025. {
  1026. if (pvarsym(sym)^.definition^.deftype=objectdef) and
  1027. ((pobjectdef(pvarsym(sym)^.definition)^.options and oo_is_abstract)<>0) then
  1028. Message(sym_e_no_instance_of_abstract_object);
  1029. }
  1030. storefilepos:=aktfilepos;
  1031. aktfilepos:=tokenpos;
  1032. if (vo_is_thread_var in varoptions) then
  1033. l:=4
  1034. else
  1035. l:=getsize;
  1036. case owner^.symtabletype of
  1037. stt_exceptsymtable:
  1038. { can contain only one symbol, address calculated later }
  1039. ;
  1040. localsymtable :
  1041. begin
  1042. varstate:=vs_declared;
  1043. modulo:=owner^.datasize and 3;
  1044. {$ifdef m68k}
  1045. { word alignment required for motorola }
  1046. if (l=1) then
  1047. l:=2
  1048. else
  1049. {$endif}
  1050. {
  1051. if (cs_optimize in aktglobalswitches) and
  1052. (aktoptprocessor in [classp5,classp6]) and
  1053. (l>=8) and ((owner^.datasize and 7)<>0) then
  1054. inc(owner^.datasize,8-(owner^.datasize and 7))
  1055. else
  1056. }
  1057. begin
  1058. if (l>=4) and (modulo<>0) then
  1059. inc(l,4-modulo)
  1060. else
  1061. if (l>=2) and ((modulo and 1)<>0) then
  1062. inc(l,2-(modulo and 1));
  1063. end;
  1064. inc(owner^.datasize,l);
  1065. address:=owner^.datasize;
  1066. end;
  1067. staticsymtable :
  1068. begin
  1069. { enable unitialized warning for local symbols }
  1070. varstate:=vs_declared;
  1071. if (cs_create_smart in aktmoduleswitches) then
  1072. bsssegment^.concat(new(pai_cut,init));
  1073. ali:=data_align(l);
  1074. if ali>1 then
  1075. begin
  1076. modulo:=owner^.datasize mod ali;
  1077. if modulo>0 then
  1078. inc(owner^.datasize,ali-modulo);
  1079. end;
  1080. {$ifdef GDB}
  1081. if cs_debuginfo in aktmoduleswitches then
  1082. concatstabto(bsssegment);
  1083. {$endif GDB}
  1084. if (cs_create_smart in aktmoduleswitches) or
  1085. DLLSource or
  1086. (vo_is_C_var in varoptions) then
  1087. bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)))
  1088. else
  1089. bsssegment^.concat(new(pai_datablock,init(mangledname,l)));
  1090. { increase datasize }
  1091. inc(owner^.datasize,l);
  1092. { this symbol can't be loaded to a register }
  1093. {$ifdef INCLUDEOK}
  1094. exclude(varoptions,vo_regable);
  1095. exclude(varoptions,vo_fpuregable);
  1096. {$else}
  1097. varoptions:=varoptions-[vo_regable,vo_fpuregable];
  1098. {$endif}
  1099. end;
  1100. globalsymtable :
  1101. begin
  1102. if (cs_create_smart in aktmoduleswitches) then
  1103. bsssegment^.concat(new(pai_cut,init));
  1104. ali:=data_align(l);
  1105. if ali>1 then
  1106. begin
  1107. modulo:=owner^.datasize mod ali;
  1108. if modulo>0 then
  1109. inc(owner^.datasize,ali-modulo);
  1110. end;
  1111. {$ifdef GDB}
  1112. if cs_debuginfo in aktmoduleswitches then
  1113. concatstabto(bsssegment);
  1114. {$endif GDB}
  1115. bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)));
  1116. inc(owner^.datasize,l);
  1117. { this symbol can't be loaded to a register }
  1118. {$ifdef INCLUDEOK}
  1119. exclude(varoptions,vo_regable);
  1120. exclude(varoptions,vo_fpuregable);
  1121. {$else}
  1122. varoptions:=varoptions-[vo_regable,vo_fpuregable];
  1123. {$endif}
  1124. end;
  1125. recordsymtable,
  1126. objectsymtable :
  1127. begin
  1128. { this symbol can't be loaded to a register }
  1129. {$ifdef INCLUDEOK}
  1130. exclude(varoptions,vo_regable);
  1131. exclude(varoptions,vo_fpuregable);
  1132. {$else}
  1133. varoptions:=varoptions-[vo_regable,vo_fpuregable];
  1134. {$endif}
  1135. { get the alignment size }
  1136. if (aktpackrecords=packrecord_C) then
  1137. begin
  1138. varalign:=vartype.def^.alignment;
  1139. if varalign=0 then
  1140. begin
  1141. if (owner^.dataalignment<4) then
  1142. begin
  1143. if (l>=4) then
  1144. owner^.dataalignment:=4
  1145. else
  1146. if (owner^.dataalignment<2) and (l>=2) then
  1147. owner^.dataalignment:=2;
  1148. end;
  1149. end;
  1150. end
  1151. else
  1152. varalign:=0;
  1153. { align record and object fields }
  1154. if (l=1) or (varalign=1) or (owner^.dataalignment=1) then
  1155. begin
  1156. address:=owner^.datasize;
  1157. inc(owner^.datasize,l)
  1158. end
  1159. else
  1160. if (l=2) or (varalign=2) or (owner^.dataalignment=2) then
  1161. begin
  1162. owner^.datasize:=(owner^.datasize+1) and (not 1);
  1163. address:=owner^.datasize;
  1164. inc(owner^.datasize,l)
  1165. end
  1166. else
  1167. if (l<=4) or (varalign=4) or (owner^.dataalignment=4) then
  1168. begin
  1169. owner^.datasize:=(owner^.datasize+3) and (not 3);
  1170. address:=owner^.datasize;
  1171. inc(owner^.datasize,l);
  1172. end
  1173. else
  1174. if (l<=8) or (owner^.dataalignment=8) then
  1175. begin
  1176. owner^.datasize:=(owner^.datasize+7) and (not 7);
  1177. address:=owner^.datasize;
  1178. inc(owner^.datasize,l);
  1179. end
  1180. else
  1181. if (l<=16) or (owner^.dataalignment=16) then
  1182. begin
  1183. owner^.datasize:=(owner^.datasize+15) and (not 15);
  1184. address:=owner^.datasize;
  1185. inc(owner^.datasize,l);
  1186. end
  1187. else
  1188. if (l<=32) or (owner^.dataalignment=32) then
  1189. begin
  1190. owner^.datasize:=(owner^.datasize+31) and (not 31);
  1191. address:=owner^.datasize;
  1192. inc(owner^.datasize,l);
  1193. end;
  1194. end;
  1195. parasymtable :
  1196. begin
  1197. { here we need the size of a push instead of the
  1198. size of the data }
  1199. l:=getpushsize;
  1200. varstate:=vs_assigned;
  1201. address:=owner^.datasize;
  1202. owner^.datasize:=align(owner^.datasize+l,target_os.stackalignment);
  1203. end
  1204. else
  1205. begin
  1206. modulo:=owner^.datasize and 3;
  1207. if (l>=4) and (modulo<>0) then
  1208. inc(owner^.datasize,4-modulo)
  1209. else
  1210. if (l>=2) and ((modulo and 1)<>0) then
  1211. inc(owner^.datasize);
  1212. address:=owner^.datasize;
  1213. inc(owner^.datasize,l);
  1214. end;
  1215. end;
  1216. aktfilepos:=storefilepos;
  1217. end;
  1218. end;
  1219. {$ifdef GDB}
  1220. function tvarsym.stabstring : pchar;
  1221. var
  1222. st : string[2];
  1223. begin
  1224. if (vartype.def^.deftype=objectdef) and
  1225. pobjectdef(vartype.def)^.is_class then
  1226. st:='*'
  1227. else
  1228. st:='';
  1229. if (owner^.symtabletype = objectsymtable) and
  1230. (sp_static in symoptions) then
  1231. begin
  1232. if (cs_gdb_gsym in aktglobalswitches) then st := 'G'+st else st := 'S'+st;
  1233. {$ifndef Delphi}
  1234. stabstring := strpnew('"'+owner^.name^+'__'+name+':'+st+
  1235. +vartype.def^.numberstring+'",'+
  1236. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1237. {$endif}
  1238. end
  1239. else if (owner^.symtabletype = globalsymtable) or
  1240. (owner^.symtabletype = unitsymtable) then
  1241. begin
  1242. { Here we used S instead of
  1243. because with G GDB doesn't look at the address field
  1244. but searches the same name or with a leading underscore
  1245. but these names don't exist in pascal !}
  1246. if (cs_gdb_gsym in aktglobalswitches) then st := 'G'+st else st := 'S'+st;
  1247. stabstring := strpnew('"'+name+':'+st
  1248. +vartype.def^.numberstring+'",'+
  1249. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1250. end
  1251. else if owner^.symtabletype = staticsymtable then
  1252. begin
  1253. stabstring := strpnew('"'+name+':S'+st
  1254. +vartype.def^.numberstring+'",'+
  1255. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1256. end
  1257. else if (owner^.symtabletype=parasymtable) then
  1258. begin
  1259. case varspez of
  1260. vs_var : st := 'v'+st;
  1261. vs_value,
  1262. vs_const : if push_addr_param(vartype.def) then
  1263. st := 'v'+st { should be 'i' but 'i' doesn't work }
  1264. else
  1265. st := 'p'+st;
  1266. end;
  1267. stabstring := strpnew('"'+name+':'+st
  1268. +vartype.def^.numberstring+'",'+
  1269. tostr(N_PSYM)+',0,'+tostr(fileinfo.line)+','+
  1270. tostr(address+owner^.address_fixup));
  1271. {offset to ebp => will not work if the framepointer is esp
  1272. so some optimizing will make things harder to debug }
  1273. end
  1274. else if (owner^.symtabletype=localsymtable) then
  1275. {$ifdef i386}
  1276. if reg<>R_NO then
  1277. begin
  1278. { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
  1279. { this is the register order for GDB}
  1280. stabstring:=strpnew('"'+name+':r'+st
  1281. +vartype.def^.numberstring+'",'+
  1282. tostr(N_RSYM)+',0,'+
  1283. tostr(fileinfo.line)+','+tostr(GDB_i386index[reg]));
  1284. end
  1285. else
  1286. {$endif i386}
  1287. { I don't know if this will work (PM) }
  1288. if (vo_is_C_var in varoptions) then
  1289. stabstring := strpnew('"'+name+':S'+st
  1290. +vartype.def^.numberstring+'",'+
  1291. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname)
  1292. else
  1293. stabstring := strpnew('"'+name+':'+st
  1294. +vartype.def^.numberstring+'",'+
  1295. tostr(N_LSYM)+',0,'+tostr(fileinfo.line)+',-'+tostr(address))
  1296. else
  1297. stabstring := inherited stabstring;
  1298. end;
  1299. procedure tvarsym.concatstabto(asmlist : paasmoutput);
  1300. {$ifdef i386}
  1301. var stab_str : pchar;
  1302. {$endif i386}
  1303. begin
  1304. inherited concatstabto(asmlist);
  1305. {$ifdef i386}
  1306. if (owner^.symtabletype=parasymtable) and
  1307. (reg<>R_NO) then
  1308. begin
  1309. { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
  1310. { this is the register order for GDB}
  1311. stab_str:=strpnew('"'+name+':r'
  1312. +vartype.def^.numberstring+'",'+
  1313. tostr(N_RSYM)+',0,'+
  1314. tostr(fileinfo.line)+','+tostr(GDB_i386index[reg]));
  1315. asmlist^.concat(new(pai_stabs,init(stab_str)));
  1316. end;
  1317. {$endif i386}
  1318. end;
  1319. {$endif GDB}
  1320. {****************************************************************************
  1321. TTYPEDCONSTSYM
  1322. *****************************************************************************}
  1323. constructor ttypedconstsym.init(const n : string;p : pdef;really_const : boolean);
  1324. begin
  1325. tsym.init(n);
  1326. typ:=typedconstsym;
  1327. typedconsttype.setdef(p);
  1328. is_really_const:=really_const;
  1329. prefix:=stringdup(procprefix);
  1330. end;
  1331. constructor ttypedconstsym.inittype(const n : string;const tt : ttype;really_const : boolean);
  1332. begin
  1333. ttypedconstsym.init(n,nil,really_const);
  1334. typedconsttype:=tt;
  1335. end;
  1336. constructor ttypedconstsym.load;
  1337. begin
  1338. tsym.load;
  1339. typ:=typedconstsym;
  1340. typedconsttype.load;
  1341. prefix:=stringdup(readstring);
  1342. is_really_const:=boolean(readbyte);
  1343. end;
  1344. destructor ttypedconstsym.done;
  1345. begin
  1346. stringdispose(prefix);
  1347. tsym.done;
  1348. end;
  1349. function ttypedconstsym.mangledname : string;
  1350. begin
  1351. mangledname:='TC_'+prefix^+'_'+name;
  1352. end;
  1353. function ttypedconstsym.getsize : longint;
  1354. begin
  1355. if assigned(typedconsttype.def) then
  1356. getsize:=typedconsttype.def^.size
  1357. else
  1358. getsize:=0;
  1359. end;
  1360. procedure ttypedconstsym.deref;
  1361. begin
  1362. typedconsttype.resolve;
  1363. end;
  1364. procedure ttypedconstsym.write;
  1365. begin
  1366. tsym.write;
  1367. typedconsttype.write;
  1368. writestring(prefix^);
  1369. writebyte(byte(is_really_const));
  1370. current_ppu^.writeentry(ibtypedconstsym);
  1371. end;
  1372. procedure ttypedconstsym.insert_in_data;
  1373. var
  1374. curconstsegment : paasmoutput;
  1375. l,ali,modulo : longint;
  1376. storefilepos : tfileposinfo;
  1377. begin
  1378. storefilepos:=aktfilepos;
  1379. aktfilepos:=tokenpos;
  1380. if is_really_const then
  1381. curconstsegment:=consts
  1382. else
  1383. curconstsegment:=datasegment;
  1384. if (cs_create_smart in aktmoduleswitches) then
  1385. curconstsegment^.concat(new(pai_cut,init));
  1386. l:=getsize;
  1387. ali:=data_align(l);
  1388. if ali>1 then
  1389. begin
  1390. curconstsegment^.concat(new(pai_align,init(ali)));
  1391. modulo:=owner^.datasize mod ali;
  1392. if modulo>0 then
  1393. inc(owner^.datasize,ali-modulo);
  1394. end;
  1395. { Why was there no owner size update here ??? }
  1396. inc(owner^.datasize,l);
  1397. {$ifdef GDB}
  1398. if cs_debuginfo in aktmoduleswitches then
  1399. concatstabto(curconstsegment);
  1400. {$endif GDB}
  1401. if owner^.symtabletype=globalsymtable then
  1402. begin
  1403. curconstsegment^.concat(new(pai_symbol,initname_global(mangledname,getsize)));
  1404. end
  1405. else
  1406. if owner^.symtabletype<>unitsymtable then
  1407. begin
  1408. if (cs_create_smart in aktmoduleswitches) or
  1409. DLLSource then
  1410. curconstsegment^.concat(new(pai_symbol,initname_global(mangledname,getsize)))
  1411. else
  1412. curconstsegment^.concat(new(pai_symbol,initname(mangledname,getsize)));
  1413. end;
  1414. aktfilepos:=storefilepos;
  1415. end;
  1416. {$ifdef GDB}
  1417. function ttypedconstsym.stabstring : pchar;
  1418. var
  1419. st : char;
  1420. begin
  1421. if (cs_gdb_gsym in aktglobalswitches) and (owner^.symtabletype in [unitsymtable,globalsymtable]) then
  1422. st := 'G'
  1423. else
  1424. st := 'S';
  1425. stabstring := strpnew('"'+name+':'+st+
  1426. typedconsttype.def^.numberstring+'",'+tostr(n_STSYM)+',0,'+
  1427. tostr(fileinfo.line)+','+mangledname);
  1428. end;
  1429. {$endif GDB}
  1430. {****************************************************************************
  1431. TCONSTSYM
  1432. ****************************************************************************}
  1433. constructor tconstsym.init(const n : string;t : tconsttyp;v : longint);
  1434. begin
  1435. inherited init(n);
  1436. typ:=constsym;
  1437. consttyp:=t;
  1438. value:=v;
  1439. ResStrIndex:=0;
  1440. consttype.reset;
  1441. len:=0;
  1442. end;
  1443. constructor tconstsym.init_def(const n : string;t : tconsttyp;v : longint;def : pdef);
  1444. begin
  1445. inherited init(n);
  1446. typ:=constsym;
  1447. consttyp:=t;
  1448. value:=v;
  1449. consttype.setdef(def);
  1450. len:=0;
  1451. end;
  1452. constructor tconstsym.init_string(const n : string;t : tconsttyp;str:pchar;l:longint);
  1453. begin
  1454. inherited init(n);
  1455. typ:=constsym;
  1456. consttyp:=t;
  1457. value:=longint(str);
  1458. consttype.reset;
  1459. len:=l;
  1460. if t=constresourcestring then
  1461. ResStrIndex:=registerresourcestring(name,pchar(value),len);
  1462. end;
  1463. constructor tconstsym.load;
  1464. var
  1465. pd : pbestreal;
  1466. ps : pnormalset;
  1467. begin
  1468. tsym.load;
  1469. typ:=constsym;
  1470. consttype.reset;
  1471. consttyp:=tconsttyp(readbyte);
  1472. case consttyp of
  1473. constint,
  1474. constbool,
  1475. constchar :
  1476. value:=readlong;
  1477. constpointer,
  1478. constord :
  1479. begin
  1480. consttype.load;
  1481. value:=readlong;
  1482. end;
  1483. conststring,constresourcestring :
  1484. begin
  1485. len:=readlong;
  1486. getmem(pchar(value),len+1);
  1487. current_ppu^.getdata(pchar(value)^,len);
  1488. if consttyp=constresourcestring then
  1489. ResStrIndex:=readlong;
  1490. end;
  1491. constreal :
  1492. begin
  1493. new(pd);
  1494. pd^:=readreal;
  1495. value:=longint(pd);
  1496. end;
  1497. constset :
  1498. begin
  1499. consttype.load;
  1500. new(ps);
  1501. readnormalset(ps^);
  1502. value:=longint(ps);
  1503. end;
  1504. constnil : ;
  1505. else
  1506. Message1(unit_f_ppu_invalid_entry,tostr(ord(consttyp)));
  1507. end;
  1508. end;
  1509. destructor tconstsym.done;
  1510. begin
  1511. case consttyp of
  1512. conststring :
  1513. freemem(pchar(value),len+1);
  1514. constreal :
  1515. dispose(pbestreal(value));
  1516. constset :
  1517. dispose(pnormalset(value));
  1518. end;
  1519. inherited done;
  1520. end;
  1521. function tconstsym.mangledname : string;
  1522. begin
  1523. mangledname:=name;
  1524. end;
  1525. procedure tconstsym.deref;
  1526. begin
  1527. if consttyp in [constord,constpointer,constset] then
  1528. consttype.resolve;
  1529. end;
  1530. procedure tconstsym.write;
  1531. begin
  1532. tsym.write;
  1533. writebyte(byte(consttyp));
  1534. case consttyp of
  1535. constnil : ;
  1536. constint,
  1537. constbool,
  1538. constchar :
  1539. writelong(value);
  1540. constpointer,
  1541. constord :
  1542. begin
  1543. consttype.write;
  1544. writelong(value);
  1545. end;
  1546. conststring,constresourcestring :
  1547. begin
  1548. writelong(len);
  1549. current_ppu^.putdata(pchar(value)^,len);
  1550. if consttyp=constresourcestring then
  1551. writelong(ResStrIndex);
  1552. end;
  1553. constreal :
  1554. writereal(pbestreal(value)^);
  1555. constset :
  1556. begin
  1557. consttype.write;
  1558. writenormalset(pointer(value)^);
  1559. end;
  1560. else
  1561. internalerror(13);
  1562. end;
  1563. current_ppu^.writeentry(ibconstsym);
  1564. end;
  1565. {$ifdef GDB}
  1566. function tconstsym.stabstring : pchar;
  1567. var st : string;
  1568. begin
  1569. {even GDB v4.16 only now 'i' 'r' and 'e' !!!}
  1570. case consttyp of
  1571. conststring : begin
  1572. { I had to remove ibm2ascii !! }
  1573. st := pstring(value)^;
  1574. {st := ibm2ascii(pstring(value)^);}
  1575. st := 's'''+st+'''';
  1576. end;
  1577. constbool,
  1578. constint,
  1579. constpointer,
  1580. constord,
  1581. constchar : st := 'i'+tostr(value);
  1582. constreal : begin
  1583. system.str(pbestreal(value)^,st);
  1584. st := 'r'+st;
  1585. end;
  1586. { if we don't know just put zero !! }
  1587. else st:='i0';
  1588. {***SETCONST}
  1589. {constset:;} {*** I don't know what to do with a set.}
  1590. { sets are not recognized by GDB}
  1591. {***}
  1592. end;
  1593. stabstring := strpnew('"'+name+':c='+st+'",'+tostr(N_function)+',0,'+
  1594. tostr(fileinfo.line)+',0');
  1595. end;
  1596. procedure tconstsym.concatstabto(asmlist : paasmoutput);
  1597. begin
  1598. if consttyp <> conststring then
  1599. inherited concatstabto(asmlist);
  1600. end;
  1601. {$endif GDB}
  1602. {****************************************************************************
  1603. TENUMSYM
  1604. ****************************************************************************}
  1605. constructor tenumsym.init(const n : string;def : penumdef;v : longint);
  1606. begin
  1607. tsym.init(n);
  1608. typ:=enumsym;
  1609. definition:=def;
  1610. value:=v;
  1611. if def^.min>v then
  1612. def^.setmin(v);
  1613. if def^.max<v then
  1614. def^.setmax(v);
  1615. order;
  1616. end;
  1617. constructor tenumsym.load;
  1618. begin
  1619. tsym.load;
  1620. typ:=enumsym;
  1621. definition:=penumdef(readdefref);
  1622. value:=readlong;
  1623. nextenum := Nil;
  1624. end;
  1625. procedure tenumsym.deref;
  1626. begin
  1627. resolvedef(pdef(definition));
  1628. order;
  1629. end;
  1630. procedure tenumsym.order;
  1631. var
  1632. sym : penumsym;
  1633. begin
  1634. sym := definition^.firstenum;
  1635. if sym = nil then
  1636. begin
  1637. definition^.firstenum := @self;
  1638. nextenum := nil;
  1639. exit;
  1640. end;
  1641. { reorder the symbols in increasing value }
  1642. if value < sym^.value then
  1643. begin
  1644. nextenum := sym;
  1645. definition^.firstenum := @self;
  1646. end
  1647. else
  1648. begin
  1649. while (sym^.value <= value) and assigned(sym^.nextenum) do
  1650. sym := sym^.nextenum;
  1651. nextenum := sym^.nextenum;
  1652. sym^.nextenum := @self;
  1653. end;
  1654. end;
  1655. procedure tenumsym.write;
  1656. begin
  1657. tsym.write;
  1658. writedefref(definition);
  1659. writelong(value);
  1660. current_ppu^.writeentry(ibenumsym);
  1661. end;
  1662. {$ifdef GDB}
  1663. procedure tenumsym.concatstabto(asmlist : paasmoutput);
  1664. begin
  1665. {enum elements have no stab !}
  1666. end;
  1667. {$EndIf GDB}
  1668. {****************************************************************************
  1669. TTYPESYM
  1670. ****************************************************************************}
  1671. constructor ttypesym.init(const n : string;const tt : ttype);
  1672. begin
  1673. tsym.init(n);
  1674. typ:=typesym;
  1675. restype:=tt;
  1676. {$ifdef GDB}
  1677. isusedinstab := false;
  1678. {$endif GDB}
  1679. if assigned(restype.def) then
  1680. begin
  1681. if not(assigned(restype.def^.typesym)) then
  1682. begin
  1683. restype.def^.typesym:=@self;
  1684. synonym:=nil;
  1685. {$ifdef INCLUDEOK}
  1686. include(symoptions,sp_primary_typesym);
  1687. {$else}
  1688. symoptions:=symoptions+[sp_primary_typesym];
  1689. {$endif}
  1690. end
  1691. else
  1692. begin
  1693. synonym:=restype.def^.typesym^.synonym;
  1694. restype.def^.typesym^.synonym:=@self;
  1695. end;
  1696. end;
  1697. end;
  1698. constructor ttypesym.initdef(const n : string;d : pdef);
  1699. var
  1700. t : ttype;
  1701. begin
  1702. t.setdef(d);
  1703. ttypesym.init(n,t);
  1704. end;
  1705. constructor ttypesym.load;
  1706. begin
  1707. tsym.load;
  1708. typ:=typesym;
  1709. synonym:=nil;
  1710. {$ifdef GDB}
  1711. isusedinstab := false;
  1712. {$endif GDB}
  1713. restype.load;
  1714. end;
  1715. destructor ttypesym.done;
  1716. var
  1717. prevsym : ptypesym;
  1718. begin
  1719. if assigned(restype.def) then
  1720. begin
  1721. prevsym:=restype.def^.typesym;
  1722. if prevsym=@self then
  1723. restype.def^.typesym:=synonym;
  1724. while assigned(prevsym) do
  1725. begin
  1726. if (prevsym^.synonym=@self) then
  1727. begin
  1728. prevsym^.synonym:=synonym;
  1729. break;
  1730. end;
  1731. prevsym:=prevsym^.synonym;
  1732. end;
  1733. end;
  1734. synonym:=nil;
  1735. inherited done;
  1736. end;
  1737. procedure ttypesym.deref;
  1738. begin
  1739. restype.resolve;
  1740. if assigned(restype.def) then
  1741. begin
  1742. if (sp_primary_typesym in symoptions) then
  1743. begin
  1744. if restype.def^.typesym<>@self then
  1745. synonym:=restype.def^.typesym;
  1746. restype.def^.typesym:=@self;
  1747. end
  1748. else
  1749. begin
  1750. if assigned(restype.def^.typesym) then
  1751. begin
  1752. synonym:=restype.def^.typesym^.synonym;
  1753. if restype.def^.typesym<>@self then
  1754. restype.def^.typesym^.synonym:=@self;
  1755. end
  1756. else
  1757. restype.def^.typesym:=@self;
  1758. end;
  1759. if (restype.def^.deftype=recorddef) and assigned(precorddef(restype.def)^.symtable) and
  1760. (restype.def^.typesym=@self) then
  1761. precorddef(restype.def)^.symtable^.name:=stringdup('record '+name);
  1762. end;
  1763. end;
  1764. procedure ttypesym.write;
  1765. begin
  1766. tsym.write;
  1767. restype.write;
  1768. current_ppu^.writeentry(ibtypesym);
  1769. end;
  1770. procedure ttypesym.load_references;
  1771. begin
  1772. inherited load_references;
  1773. if (restype.def^.deftype=recorddef) then
  1774. precorddef(restype.def)^.symtable^.load_browser;
  1775. if (restype.def^.deftype=objectdef) then
  1776. pobjectdef(restype.def)^.symtable^.load_browser;
  1777. end;
  1778. function ttypesym.write_references : boolean;
  1779. begin
  1780. if not inherited write_references then
  1781. { write address of this symbol if record or object
  1782. even if no real refs are there
  1783. because we need it for the symtable }
  1784. if (restype.def^.deftype=recorddef) or
  1785. (restype.def^.deftype=objectdef) then
  1786. begin
  1787. writesymref(@self);
  1788. current_ppu^.writeentry(ibsymref);
  1789. end;
  1790. write_references:=true;
  1791. if (restype.def^.deftype=recorddef) then
  1792. precorddef(restype.def)^.symtable^.write_browser;
  1793. if (restype.def^.deftype=objectdef) then
  1794. pobjectdef(restype.def)^.symtable^.write_browser;
  1795. end;
  1796. {$ifdef BrowserLog}
  1797. procedure ttypesym.add_to_browserlog;
  1798. begin
  1799. inherited add_to_browserlog;
  1800. if (restype.def^.deftype=recorddef) then
  1801. precorddef(restype.def)^.symtable^.writebrowserlog;
  1802. if (restype.def^.deftype=objectdef) then
  1803. pobjectdef(restype.def)^.symtable^.writebrowserlog;
  1804. end;
  1805. {$endif BrowserLog}
  1806. {$ifdef GDB}
  1807. function ttypesym.stabstring : pchar;
  1808. var
  1809. stabchar : string[2];
  1810. short : string;
  1811. begin
  1812. if restype.def^.deftype in tagtypes then
  1813. stabchar := 'Tt'
  1814. else
  1815. stabchar := 't';
  1816. short := '"'+name+':'+stabchar+restype.def^.numberstring
  1817. +'",'+tostr(N_LSYM)+',0,'+tostr(fileinfo.line)+',0';
  1818. stabstring := strpnew(short);
  1819. end;
  1820. procedure ttypesym.concatstabto(asmlist : paasmoutput);
  1821. begin
  1822. {not stabs for forward defs }
  1823. if assigned(restype.def) then
  1824. if (restype.def^.typesym = @self) then
  1825. restype.def^.concatstabto(asmlist)
  1826. else
  1827. inherited concatstabto(asmlist);
  1828. end;
  1829. {$endif GDB}
  1830. {****************************************************************************
  1831. TSYSSYM
  1832. ****************************************************************************}
  1833. constructor tsyssym.init(const n : string;l : longint);
  1834. begin
  1835. inherited init(n);
  1836. typ:=syssym;
  1837. number:=l;
  1838. end;
  1839. constructor tsyssym.load;
  1840. begin
  1841. tsym.load;
  1842. typ:=syssym;
  1843. number:=readlong;
  1844. end;
  1845. destructor tsyssym.done;
  1846. begin
  1847. inherited done;
  1848. end;
  1849. procedure tsyssym.write;
  1850. begin
  1851. tsym.write;
  1852. writelong(number);
  1853. current_ppu^.writeentry(ibsyssym);
  1854. end;
  1855. {$ifdef GDB}
  1856. procedure tsyssym.concatstabto(asmlist : paasmoutput);
  1857. begin
  1858. end;
  1859. {$endif GDB}
  1860. {****************************************************************************
  1861. TMACROSYM
  1862. ****************************************************************************}
  1863. constructor tmacrosym.init(const n : string);
  1864. begin
  1865. inherited init(n);
  1866. typ:=macrosym;
  1867. defined:=true;
  1868. defined_at_startup:=false;
  1869. is_used:=false;
  1870. buftext:=nil;
  1871. buflen:=0;
  1872. end;
  1873. destructor tmacrosym.done;
  1874. begin
  1875. if assigned(buftext) then
  1876. freemem(buftext,buflen);
  1877. inherited done;
  1878. end;
  1879. {
  1880. $Log$
  1881. Revision 1.134 1999-12-20 21:42:37 pierre
  1882. + dllversion global variable
  1883. * FPC_USE_CPREFIX code removed, not necessary anymore
  1884. as we use .edata direct writing by default now.
  1885. Revision 1.133 1999/12/14 09:58:42 florian
  1886. + compiler checks now if a goto leaves an exception block
  1887. Revision 1.132 1999/12/01 12:42:33 peter
  1888. * fixed bug 698
  1889. * removed some notes about unused vars
  1890. Revision 1.131 1999/11/30 10:40:55 peter
  1891. + ttype, tsymlist
  1892. Revision 1.130 1999/11/26 00:19:12 peter
  1893. * property overriding dereference fix, but it need a bigger redesign
  1894. which i'll do tomorrow. This quick hack is for the lazarus ppl so
  1895. they can hack on mwcustomedit.
  1896. Revision 1.129 1999/11/21 01:42:37 pierre
  1897. * Nextoverloading ordering fix
  1898. Revision 1.128 1999/11/20 01:22:20 pierre
  1899. + cond FPC_USE_CPREFIX (needs also some RTL changes)
  1900. this allows to use unit global vars as DLL exports
  1901. (the underline prefix seems needed by dlltool)
  1902. Revision 1.127 1999/11/17 17:05:04 pierre
  1903. * Notes/hints changes
  1904. Revision 1.126 1999/11/15 22:00:48 peter
  1905. * labels used but not defined give error instead of warning, the warning
  1906. is now only with declared but not defined and not used.
  1907. Revision 1.125 1999/11/08 14:02:17 florian
  1908. * problem with "index X"-properties solved
  1909. * typed constants of class references are now allowed
  1910. Revision 1.124 1999/11/06 14:34:27 peter
  1911. * truncated log to 20 revs
  1912. Revision 1.123 1999/11/05 17:18:03 pierre
  1913. * local browsing works at first level
  1914. ie for function defined in interface or implementation
  1915. not yet for functions inside other functions
  1916. Revision 1.122 1999/10/21 16:41:41 florian
  1917. * problems with readln fixed: esi wasn't restored correctly when
  1918. reading ordinal fields of objects futher the register allocation
  1919. didn't take care of the extra register when reading ordinal values
  1920. * enumerations can now be used in constant indexes of properties
  1921. Revision 1.121 1999/10/01 08:02:48 peter
  1922. * forward type declaration rewritten
  1923. Revision 1.120 1999/09/27 23:44:58 peter
  1924. * procinfo is now a pointer
  1925. * support for result setting in sub procedure
  1926. Revision 1.119 1999/09/26 21:30:22 peter
  1927. + constant pointer support which can happend with typecasting like
  1928. const p=pointer(1)
  1929. * better procvar parsing in typed consts
  1930. Revision 1.118 1999/09/20 16:39:03 peter
  1931. * cs_create_smart instead of cs_smartlink
  1932. * -CX is create smartlink
  1933. * -CD is create dynamic, but does nothing atm.
  1934. Revision 1.117 1999/08/31 15:42:24 pierre
  1935. + tmacrosym is_used and defined_at_startup boolean fields added
  1936. Revision 1.116 1999/08/24 22:38:55 michael
  1937. * more resourcestring changes
  1938. Revision 1.115 1999/08/23 11:45:42 michael
  1939. * Hopefully final attempt at resourcestrings
  1940. Revision 1.114 1999/08/15 21:57:58 michael
  1941. Changes for resource strings
  1942. Revision 1.113 1999/08/14 00:39:00 peter
  1943. * hack to support property with record fields
  1944. Revision 1.112 1999/08/13 14:24:20 pierre
  1945. + stabs for classes and classref working,
  1946. a class still needs an ^ to get that content of it,
  1947. but the class fields inside a class don't result into an
  1948. infinite loop anymore!
  1949. Revision 1.111 1999/08/10 12:36:31 pierre
  1950. * use of procsym field for correct gdb info in local procedures
  1951. * exported DLL vars made global to be able to use DLLTOOL with themz
  1952. Revision 1.110 1999/08/07 14:21:03 florian
  1953. * some small problems fixed
  1954. Revision 1.109 1999/08/07 13:24:34 daniel
  1955. * Fixed open arrays
  1956. Revision 1.108 1999/08/05 16:53:17 peter
  1957. * V_Fatal=1, all other V_ are also increased
  1958. * Check for local procedure when assigning procvar
  1959. * fixed comment parsing because directives
  1960. * oldtp mode directives better supported
  1961. * added some messages to errore.msg
  1962. Revision 1.107 1999/08/04 13:45:30 florian
  1963. + floating point register variables !!
  1964. * pairegalloc is now generated for register variables
  1965. Revision 1.106 1999/08/03 22:03:19 peter
  1966. * moved bitmask constants to sets
  1967. * some other type/const renamings
  1968. Revision 1.105 1999/07/29 20:54:10 peter
  1969. * write .size also
  1970. Revision 1.104 1999/07/27 23:42:21 peter
  1971. * indirect type referencing is now allowed
  1972. }