symsym.inc 65 KB

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