symsym.inc 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288
  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. {$ifndef OLDPPU}
  24. inherited initname(n);
  25. {$else}
  26. left:=nil;
  27. right:=nil;
  28. setname(n);
  29. indexnb:=0;
  30. {$ifdef nextfield}
  31. nextsym:=nil;
  32. {$endif nextfield}
  33. {$endif}
  34. typ:=abstractsym;
  35. properties:=current_object_option;
  36. {$ifdef GDB}
  37. isstabwritten := false;
  38. {$endif GDB}
  39. fileinfo:=tokenpos;
  40. defref:=nil;
  41. lastwritten:=nil;
  42. refcount:=0;
  43. if (cs_browser in aktmoduleswitches) and make_ref then
  44. begin
  45. defref:=new(pref,init(defref,@tokenpos));
  46. inc(refcount);
  47. end;
  48. lastref:=defref;
  49. end;
  50. constructor tsym.load;
  51. begin
  52. {$ifndef OLDPPU}
  53. inherited init;
  54. indexnr:=readword;
  55. {$else}
  56. left:=nil;
  57. right:=nil;
  58. {$endif}
  59. setname(readstring);
  60. typ:=abstractsym;
  61. fillchar(fileinfo,sizeof(fileinfo),0);
  62. properties:=symprop(readbyte);
  63. lastref:=nil;
  64. defref:=nil;
  65. lastwritten:=nil;
  66. refcount:=0;
  67. {$ifdef GDB}
  68. isstabwritten := false;
  69. {$endif GDB}
  70. end;
  71. procedure tsym.load_references;
  72. var
  73. pos : tfileposinfo;
  74. move_last : boolean;
  75. begin
  76. move_last:=lastwritten=lastref;
  77. while (not current_ppu^.endofentry) do
  78. begin
  79. readposinfo(pos);
  80. inc(refcount);
  81. lastref:=new(pref,init(lastref,@pos));
  82. lastref^.is_written:=true;
  83. if refcount=1 then
  84. defref:=lastref;
  85. end;
  86. if move_last then
  87. lastwritten:=lastref;
  88. end;
  89. { big problem here :
  90. wrong refs were written because of
  91. interface parsing of other units PM
  92. moduleindex must be checked !! }
  93. function tsym.write_references : boolean;
  94. var
  95. ref : pref;
  96. symref_written,move_last : boolean;
  97. begin
  98. write_references:=false;
  99. if lastwritten=lastref then
  100. exit;
  101. { should we update lastref }
  102. move_last:=true;
  103. symref_written:=false;
  104. { write symbol refs }
  105. if assigned(lastwritten) then
  106. ref:=lastwritten
  107. else
  108. ref:=defref;
  109. while assigned(ref) do
  110. begin
  111. if ref^.moduleindex=current_module^.unit_index then
  112. begin
  113. { write address to this symbol }
  114. if not symref_written then
  115. begin
  116. writesymref(@self);
  117. symref_written:=true;
  118. end;
  119. writeposinfo(ref^.posinfo);
  120. ref^.is_written:=true;
  121. if move_last then
  122. lastwritten:=ref;
  123. end
  124. else if not ref^.is_written then
  125. move_last:=false
  126. else if move_last then
  127. lastwritten:=ref;
  128. ref:=ref^.nextref;
  129. end;
  130. if symref_written then
  131. current_ppu^.writeentry(ibsymref);
  132. write_references:=symref_written;
  133. end;
  134. {$ifdef BrowserLog}
  135. procedure tsym.add_to_browserlog;
  136. begin
  137. if assigned(defref) then
  138. begin
  139. browserlog.AddLog('***'+name+'***');
  140. browserlog.AddLogRefs(defref);
  141. end;
  142. end;
  143. {$endif BrowserLog}
  144. destructor tsym.done;
  145. begin
  146. if assigned(defref) then
  147. dispose(defref,done);
  148. {$ifndef OLDPPU}
  149. inherited done;
  150. {$else}
  151. {$ifdef tp}
  152. if not(use_big) then
  153. {$endif tp}
  154. strdispose(_name);
  155. if assigned(left) then
  156. dispose(left,done);
  157. if assigned(right) then
  158. dispose(right,done);
  159. {$endif}
  160. end;
  161. procedure tsym.write;
  162. begin
  163. {$ifndef OLDPPU}
  164. writeword(indexnr);
  165. {$endif}
  166. writestring(name);
  167. writebyte(byte(properties));
  168. end;
  169. procedure tsym.deref;
  170. begin
  171. end;
  172. {$ifdef OLDPPU}
  173. function tsym.name : string;
  174. {$ifdef tp}
  175. var
  176. s : string;
  177. b : byte;
  178. {$endif}
  179. begin
  180. {$ifdef tp}
  181. if use_big then
  182. begin
  183. symbolstream.seek(longint(_name));
  184. symbolstream.read(b,1);
  185. symbolstream.read(s[1],b);
  186. s[0]:=chr(b);
  187. name:=s;
  188. end
  189. else
  190. {$endif}
  191. if assigned(_name) then
  192. name:=strpas(_name)
  193. else
  194. name:='';
  195. end;
  196. procedure tsym.setname(const s : string);
  197. begin
  198. setstring(_name,s);
  199. end;
  200. {$endif}
  201. function tsym.mangledname : string;
  202. begin
  203. mangledname:=name;
  204. end;
  205. { for most symbol types there is nothing to do at all }
  206. procedure tsym.insert_in_data;
  207. begin
  208. end;
  209. {$ifdef GDB}
  210. function tsym.stabstring : pchar;
  211. begin
  212. stabstring:=strpnew('"'+name+'",'+tostr(N_LSYM)+',0,'+
  213. tostr(fileinfo.line)+',0');
  214. end;
  215. procedure tsym.concatstabto(asmlist : paasmoutput);
  216. var stab_str : pchar;
  217. begin
  218. if not isstabwritten then
  219. begin
  220. stab_str := stabstring;
  221. if asmlist = debuglist then do_count_dbx := true;
  222. { count_dbx(stab_str); moved to GDB.PAS }
  223. asmlist^.concat(new(pai_stabs,init(stab_str)));
  224. isstabwritten:=true;
  225. end;
  226. end;
  227. {$endif GDB}
  228. {****************************************************************************
  229. TLABELSYM
  230. ****************************************************************************}
  231. constructor tlabelsym.init(const n : string; l : plabel);
  232. begin
  233. inherited init(n);
  234. typ:=labelsym;
  235. number:=l;
  236. number^.is_used:=false;
  237. number^.is_set:=true;
  238. number^.refcount:=0;
  239. defined:=false;
  240. end;
  241. constructor tlabelsym.load;
  242. begin
  243. tsym.load;
  244. typ:=labelsym;
  245. { this is all dummy
  246. it is only used for local browsing }
  247. number:=nil;
  248. defined:=true;
  249. end;
  250. destructor tlabelsym.done;
  251. begin
  252. inherited done;
  253. end;
  254. function tlabelsym.mangledname : string;
  255. begin
  256. { this also sets the is_used field }
  257. mangledname:=lab2str(number);
  258. end;
  259. procedure tlabelsym.write;
  260. begin
  261. if owner^.symtabletype in [unitsymtable,globalsymtable] then
  262. Message(sym_e_ill_label_decl)
  263. else
  264. begin
  265. tsym.write;
  266. current_ppu^.writeentry(iblabelsym);
  267. end;
  268. end;
  269. {****************************************************************************
  270. TUNITSYM
  271. ****************************************************************************}
  272. constructor tunitsym.init(const n : string;ref : punitsymtable);
  273. var
  274. old_make_ref : boolean;
  275. begin
  276. old_make_ref:=make_ref;
  277. make_ref:=false;
  278. inherited init(n);
  279. make_ref:=old_make_ref;
  280. typ:=unitsym;
  281. unitsymtable:=ref;
  282. prevsym:=ref^.unitsym;
  283. ref^.unitsym:=@self;
  284. refs:=0;
  285. end;
  286. constructor tunitsym.load;
  287. begin
  288. tsym.load;
  289. typ:=unitsym;
  290. unitsymtable:=punitsymtable(current_module^.globalsymtable);
  291. prevsym:=nil;
  292. end;
  293. destructor tunitsym.done;
  294. begin
  295. if assigned(unitsymtable) and (unitsymtable^.unitsym=@self) then
  296. unitsymtable^.unitsym:=prevsym;
  297. inherited done;
  298. end;
  299. procedure tunitsym.write;
  300. begin
  301. tsym.write;
  302. current_ppu^.writeentry(ibunitsym);
  303. end;
  304. {$ifdef GDB}
  305. procedure tunitsym.concatstabto(asmlist : paasmoutput);
  306. begin
  307. {Nothing to write to stabs !}
  308. end;
  309. {$endif GDB}
  310. {****************************************************************************
  311. TPROCSYM
  312. ****************************************************************************}
  313. constructor tprocsym.init(const n : string);
  314. begin
  315. tsym.init(n);
  316. typ:=procsym;
  317. definition:=nil;
  318. owner:=nil;
  319. {$ifdef GDB}
  320. is_global := false;
  321. {$endif GDB}
  322. end;
  323. constructor tprocsym.load;
  324. begin
  325. tsym.load;
  326. typ:=procsym;
  327. definition:=pprocdef(readdefref);
  328. {$ifdef GDB}
  329. is_global := false;
  330. {$endif GDB}
  331. end;
  332. destructor tprocsym.done;
  333. begin
  334. check_forward;
  335. tsym.done;
  336. end;
  337. function tprocsym.mangledname : string;
  338. begin
  339. mangledname:=definition^.mangledname;
  340. end;
  341. function tprocsym.demangledname:string;
  342. begin
  343. demangledname:=name+definition^.demangled_paras;
  344. end;
  345. procedure tprocsym.write_parameter_lists;
  346. var
  347. p : pprocdef;
  348. begin
  349. p:=definition;
  350. while assigned(p) do
  351. begin
  352. { force the error to be printed }
  353. Verbose.Message1(sym_b_param_list,name+p^.demangled_paras);
  354. p:=p^.nextoverloaded;
  355. end;
  356. end;
  357. procedure tprocsym.check_forward;
  358. var
  359. pd : pprocdef;
  360. oldaktfilepos : tfileposinfo;
  361. begin
  362. { don't check if errors !! }
  363. if Errorcount>0 then
  364. exit;
  365. pd:=definition;
  366. while assigned(pd) do
  367. begin
  368. if pd^.forwarddef then
  369. begin
  370. oldaktfilepos:=aktfilepos;
  371. aktfilepos:=fileinfo;
  372. if assigned(pd^._class) then
  373. Message1(sym_e_forward_not_resolved,pd^._class^.objname^+'.'+name+demangledparas(pd^.demangled_paras))
  374. else
  375. Message1(sym_e_forward_not_resolved,name+pd^.demangled_paras);
  376. aktfilepos:=oldaktfilepos;
  377. end;
  378. pd:=pd^.nextoverloaded;
  379. end;
  380. end;
  381. procedure tprocsym.deref;
  382. var
  383. t : ttoken;
  384. last : pprocdef;
  385. begin
  386. resolvedef(pdef(definition));
  387. if (definition^.options and pooperator) <> 0 then
  388. begin
  389. last:=definition;
  390. while assigned(last^.nextoverloaded) do
  391. last:=last^.nextoverloaded;
  392. for t:=first_overloaded to last_overloaded do
  393. if (name=overloaded_names[t]) then
  394. begin
  395. if assigned(overloaded_operators[t]) then
  396. last^.nextoverloaded:=overloaded_operators[t]^.definition;
  397. overloaded_operators[t]:=@self;
  398. end;
  399. end;
  400. end;
  401. procedure tprocsym.write;
  402. begin
  403. tsym.write;
  404. writedefref(pdef(definition));
  405. current_ppu^.writeentry(ibprocsym);
  406. end;
  407. procedure tprocsym.load_references;
  408. (* var
  409. prdef,prdef2 : pprocdef;
  410. b : byte; *)
  411. begin
  412. inherited load_references;
  413. (* prdef:=definition;
  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(owner^.defowner^.sym) then
  482. info := ','+name+','+owner^.defowner^.sym^.name;
  483. end;
  484. stabsstr:=definition^.mangledname;
  485. getmem(p,length(stabsstr)+255);
  486. strpcopy(p,'"'+obj+':'+RetType
  487. +definition^.retdef^.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 (definition^.options and pointernproc) <> 0 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. options:=0;
  532. proptype:=nil;
  533. readaccessdef:=nil;
  534. writeaccessdef:=nil;
  535. readaccesssym:=nil;
  536. writeaccesssym:=nil;
  537. storedsym:=nil;
  538. storeddef:=nil;
  539. index:=0;
  540. default:=0;
  541. end;
  542. destructor tpropertysym.done;
  543. begin
  544. inherited done;
  545. end;
  546. constructor tpropertysym.load;
  547. begin
  548. inherited load;
  549. typ:=propertysym;
  550. proptype:=readdefref;
  551. options:=readlong;
  552. index:=readlong;
  553. default:=readlong;
  554. { it's hack ... }
  555. readaccesssym:=psym(stringdup(readstring));
  556. writeaccesssym:=psym(stringdup(readstring));
  557. storedsym:=psym(stringdup(readstring));
  558. { now the defs: }
  559. readaccessdef:=readdefref;
  560. writeaccessdef:=readdefref;
  561. storeddef:=readdefref;
  562. end;
  563. procedure tpropertysym.deref;
  564. begin
  565. resolvedef(proptype);
  566. resolvedef(readaccessdef);
  567. resolvedef(writeaccessdef);
  568. resolvedef(storeddef);
  569. { solve the hack we did in load: }
  570. if pstring(readaccesssym)^<>'' then
  571. begin
  572. srsym:=search_class_member(pobjectdef(owner^.defowner),pstring(readaccesssym)^);
  573. if not(assigned(srsym)) then
  574. srsym:=generrorsym;
  575. end
  576. else
  577. srsym:=nil;
  578. stringdispose(pstring(readaccesssym));
  579. readaccesssym:=srsym;
  580. if pstring(writeaccesssym)^<>'' then
  581. begin
  582. srsym:=search_class_member(pobjectdef(owner^.defowner),pstring(writeaccesssym)^);
  583. if not(assigned(srsym)) then
  584. srsym:=generrorsym;
  585. end
  586. else
  587. srsym:=nil;
  588. stringdispose(pstring(writeaccesssym));
  589. writeaccesssym:=srsym;
  590. if pstring(storedsym)^<>'' then
  591. begin
  592. srsym:=search_class_member(pobjectdef(owner^.defowner),pstring(storedsym)^);
  593. if not(assigned(srsym)) then
  594. srsym:=generrorsym;
  595. end
  596. else
  597. srsym:=nil;
  598. stringdispose(pstring(storedsym));
  599. storedsym:=srsym;
  600. end;
  601. function tpropertysym.getsize : longint;
  602. begin
  603. getsize:=0;
  604. end;
  605. procedure tpropertysym.write;
  606. begin
  607. tsym.write;
  608. writedefref(proptype);
  609. writelong(options);
  610. writelong(index);
  611. writelong(default);
  612. if assigned(readaccesssym) then
  613. writestring(readaccesssym^.name)
  614. else
  615. writestring('');
  616. if assigned(writeaccesssym) then
  617. writestring(writeaccesssym^.name)
  618. else
  619. writestring('');
  620. if assigned(storedsym) then
  621. writestring(storedsym^.name)
  622. else
  623. writestring('');
  624. writedefref(readaccessdef);
  625. writedefref(writeaccessdef);
  626. writedefref(storeddef);
  627. current_ppu^.writeentry(ibpropertysym);
  628. end;
  629. {$ifdef GDB}
  630. function tpropertysym.stabstring : pchar;
  631. begin
  632. { !!!! don't know how to handle }
  633. stabstring:=strpnew('');
  634. end;
  635. procedure tpropertysym.concatstabto(asmlist : paasmoutput);
  636. begin
  637. { !!!! don't know how to handle }
  638. end;
  639. {$endif GDB}
  640. {****************************************************************************
  641. TFUNCRETSYM
  642. ****************************************************************************}
  643. constructor tfuncretsym.init(const n : string;approcinfo : pointer{pprocinfo});
  644. begin
  645. tsym.init(n);
  646. typ:=funcretsym;
  647. funcretprocinfo:=approcinfo;
  648. funcretdef:=pprocinfo(approcinfo)^.retdef;
  649. { address valid for ret in param only }
  650. { otherwise set by insert }
  651. address:=pprocinfo(approcinfo)^.retoffset;
  652. end;
  653. constructor tfuncretsym.load;
  654. begin
  655. tsym.load;
  656. funcretdef:=readdefref;
  657. address:=readlong;
  658. funcretprocinfo:=nil;
  659. typ:=funcretsym;
  660. end;
  661. procedure tfuncretsym.write;
  662. begin
  663. (*
  664. Normally all references are
  665. transfered to the function symbol itself !! PM *)
  666. tsym.write;
  667. writedefref(funcretdef);
  668. writelong(address);
  669. current_ppu^.writeentry(ibfuncretsym);
  670. end;
  671. procedure tfuncretsym.deref;
  672. begin
  673. resolvedef(funcretdef);
  674. end;
  675. {$ifdef GDB}
  676. procedure tfuncretsym.concatstabto(asmlist : paasmoutput);
  677. begin
  678. { Nothing to do here, it is done in genexitcode }
  679. end;
  680. {$endif GDB}
  681. procedure tfuncretsym.insert_in_data;
  682. var
  683. l : longint;
  684. begin
  685. { allocate space in local if ret in acc or in fpu }
  686. if ret_in_acc(procinfo.retdef) or (procinfo.retdef^.deftype=floatdef) then
  687. begin
  688. l:=funcretdef^.size;
  689. inc(owner^.datasize,l);
  690. {$ifdef m68k}
  691. { word alignment required for motorola }
  692. if (l=1) then
  693. inc(owner^.datasize,1)
  694. else
  695. {$endif}
  696. if (l>=4) and ((owner^.datasize and 3)<>0) then
  697. inc(owner^.datasize,4-(owner^.datasize and 3))
  698. else if (l>=2) and ((owner^.datasize and 1)<>0) then
  699. inc(owner^.datasize,2-(owner^.datasize and 1));
  700. address:=owner^.datasize;
  701. procinfo.retoffset:=-owner^.datasize;
  702. end;
  703. end;
  704. {****************************************************************************
  705. TABSOLUTESYM
  706. ****************************************************************************}
  707. constructor tabsolutesym.init(const n : string;p : pdef);
  708. begin
  709. inherited init(n,p);
  710. typ:=absolutesym;
  711. end;
  712. constructor tabsolutesym.load;
  713. begin
  714. tvarsym.load;
  715. typ:=absolutesym;
  716. ref:=nil;
  717. address:=0;
  718. asmname:=nil;
  719. abstyp:=absolutetyp(readbyte);
  720. absseg:=false;
  721. case abstyp of
  722. tovar :
  723. begin
  724. asmname:=stringdup(readstring);
  725. ref:=srsym;
  726. end;
  727. toasm :
  728. asmname:=stringdup(readstring);
  729. toaddr :
  730. begin
  731. address:=readlong;
  732. absseg:=boolean(readbyte);
  733. end;
  734. end;
  735. end;
  736. procedure tabsolutesym.write;
  737. begin
  738. tsym.write;
  739. writebyte(byte(varspez));
  740. if read_member then
  741. writelong(address);
  742. writedefref(definition);
  743. writebyte(var_options and (not vo_regable));
  744. writebyte(byte(abstyp));
  745. case abstyp of
  746. tovar :
  747. writestring(ref^.name);
  748. toasm :
  749. writestring(asmname^);
  750. toaddr :
  751. begin
  752. writelong(address);
  753. writebyte(byte(absseg));
  754. end;
  755. end;
  756. current_ppu^.writeentry(ibabsolutesym);
  757. end;
  758. procedure tabsolutesym.deref;
  759. begin
  760. resolvedef(definition);
  761. if (abstyp=tovar) and (asmname<>nil) then
  762. begin
  763. { search previous loaded symtables }
  764. getsym(asmname^,false);
  765. if not(assigned(srsym)) then
  766. getsymonlyin(owner,asmname^);
  767. if not(assigned(srsym)) then
  768. srsym:=generrorsym;
  769. ref:=srsym;
  770. stringdispose(asmname);
  771. end;
  772. end;
  773. function tabsolutesym.mangledname : string;
  774. begin
  775. case abstyp of
  776. tovar :
  777. mangledname:=ref^.mangledname;
  778. toasm :
  779. mangledname:=asmname^;
  780. toaddr :
  781. mangledname:='$'+tostr(address);
  782. else
  783. internalerror(10002);
  784. end;
  785. end;
  786. procedure tabsolutesym.insert_in_data;
  787. begin
  788. end;
  789. {$ifdef GDB}
  790. procedure tabsolutesym.concatstabto(asmlist : paasmoutput);
  791. begin
  792. { I don't know how to handle this !! }
  793. end;
  794. {$endif GDB}
  795. {****************************************************************************
  796. TVARSYM
  797. ****************************************************************************}
  798. constructor tvarsym.init(const n : string;p : pdef);
  799. begin
  800. tsym.init(n);
  801. typ:=varsym;
  802. definition:=p;
  803. _mangledname:=nil;
  804. varspez:=vs_value;
  805. address:=0;
  806. islocalcopy:=false;
  807. localvarsym:=nil;
  808. refs:=0;
  809. is_valid := 1;
  810. var_options:=0;
  811. { can we load the value into a register ? }
  812. case p^.deftype of
  813. pointerdef,
  814. enumdef,
  815. procvardef :
  816. var_options:=var_options or vo_regable;
  817. orddef :
  818. case porddef(p)^.typ of
  819. bool8bit,bool16bit,bool32bit,
  820. u8bit,u16bit,u32bit,
  821. s8bit,s16bit,s32bit :
  822. var_options:=var_options or vo_regable;
  823. else
  824. var_options:=var_options and not vo_regable;
  825. end;
  826. setdef:
  827. if psetdef(p)^.settype=smallset then
  828. var_options:=var_options or vo_regable;
  829. else
  830. var_options:=var_options and not vo_regable;
  831. end;
  832. reg:=R_NO;
  833. end;
  834. constructor tvarsym.init_dll(const n : string;p : pdef);
  835. begin
  836. { The tvarsym is necessary for 0.99.5 (PFV) }
  837. tvarsym.init(n,p);
  838. var_options:=var_options or vo_is_dll_var;
  839. end;
  840. constructor tvarsym.init_C(const n,mangled : string;p : pdef);
  841. begin
  842. { The tvarsym is necessary for 0.99.5 (PFV) }
  843. tvarsym.init(n,p);
  844. var_options:=var_options or vo_is_C_var;
  845. setmangledname(mangled);
  846. end;
  847. constructor tvarsym.load;
  848. begin
  849. tsym.load;
  850. typ:=varsym;
  851. _mangledname:=nil;
  852. reg:=R_NO;
  853. refs := 0;
  854. is_valid := 1;
  855. varspez:=tvarspez(readbyte);
  856. if read_member then
  857. address:=readlong
  858. else
  859. address:=0;
  860. islocalcopy:=false;
  861. localvarsym:=nil;
  862. definition:=readdefref;
  863. var_options:=readbyte;
  864. if (var_options and vo_is_C_var)<>0 then
  865. setmangledname(readstring);
  866. end;
  867. procedure tvarsym.deref;
  868. begin
  869. resolvedef(definition);
  870. end;
  871. procedure tvarsym.write;
  872. begin
  873. tsym.write;
  874. writebyte(byte(varspez));
  875. if read_member then
  876. writelong(address);
  877. writedefref(definition);
  878. { symbols which are load are never candidates for a register,
  879. turn of the regable }
  880. writebyte(var_options and (not vo_regable));
  881. if (var_options and vo_is_C_var)<>0 then
  882. writestring(mangledname);
  883. current_ppu^.writeentry(ibvarsym);
  884. end;
  885. procedure tvarsym.setmangledname(const s : string);
  886. begin
  887. _mangledname:=strpnew(s);
  888. end;
  889. function tvarsym.mangledname : string;
  890. var
  891. prefix : string;
  892. begin
  893. if assigned(_mangledname) then
  894. begin
  895. mangledname:=strpas(_mangledname);
  896. exit;
  897. end;
  898. case owner^.symtabletype of
  899. staticsymtable :
  900. if (cs_smartlink in aktmoduleswitches) then
  901. prefix:='_'+owner^.name^+'$$$_'
  902. else
  903. prefix:='_';
  904. unitsymtable,
  905. globalsymtable :
  906. prefix:='U_'+owner^.name^+'_';
  907. else
  908. Message(sym_e_invalid_call_tvarsymmangledname);
  909. end;
  910. mangledname:=prefix+name;
  911. end;
  912. function tvarsym.getsize : longint;
  913. begin
  914. if assigned(definition) and (varspez=vs_value) then
  915. getsize:=definition^.size
  916. else
  917. getsize:=0;
  918. end;
  919. function tvarsym.getpushsize : longint;
  920. begin
  921. if assigned(definition) then
  922. begin
  923. case varspez of
  924. vs_var :
  925. getpushsize:=target_os.size_of_pointer;
  926. vs_value,
  927. vs_const :
  928. begin
  929. case definition^.deftype of
  930. arraydef,
  931. setdef,
  932. stringdef,
  933. recorddef,
  934. objectdef :
  935. getpushsize:=target_os.size_of_pointer;
  936. else
  937. getpushsize:=definition^.size;
  938. end;
  939. end;
  940. end;
  941. end
  942. else
  943. getpushsize:=0;
  944. end;
  945. procedure tvarsym.insert_in_data;
  946. var
  947. l,modulo : longint;
  948. begin
  949. if (var_options and vo_is_external)<>0 then
  950. exit;
  951. { handle static variables of objects especially }
  952. if read_member and (owner^.symtabletype=objectsymtable) and
  953. ((properties and sp_static)<>0) then
  954. begin
  955. { the data filed is generated in parser.pas
  956. with a tobject_FIELDNAME variable }
  957. { this symbol can't be loaded to a register }
  958. var_options:=var_options and not vo_regable;
  959. end
  960. else
  961. if not(read_member) then
  962. begin
  963. { made problems with parameters etc. ! (FK) }
  964. { check for instance of an abstract object or class }
  965. {
  966. if (pvarsym(sym)^.definition^.deftype=objectdef) and
  967. ((pobjectdef(pvarsym(sym)^.definition)^.options and oo_is_abstract)<>0) then
  968. Message(sym_e_no_instance_of_abstract_object);
  969. }
  970. l:=getsize;
  971. case owner^.symtabletype of
  972. stt_exceptsymtable:
  973. { can contain only one symbol, address calculated later }
  974. ;
  975. localsymtable :
  976. begin
  977. is_valid := 0;
  978. modulo:=owner^.datasize and 3;
  979. {$ifdef m68k}
  980. { word alignment required for motorola }
  981. if (l=1) then
  982. l:=2
  983. else
  984. {$endif}
  985. if (l>=4) and (modulo<>0) then
  986. inc(l,4-modulo)
  987. else
  988. if (l>=2) and ((modulo and 1)<>0) then
  989. inc(l,2-(modulo and 1));
  990. inc(owner^.datasize,l);
  991. address:=owner^.datasize;
  992. end;
  993. staticsymtable :
  994. begin
  995. { enable unitilized warning for local symbols }
  996. is_valid := 0;
  997. if (cs_smartlink in aktmoduleswitches) then
  998. bsssegment^.concat(new(pai_cut,init));
  999. {$ifdef GDB}
  1000. if cs_debuginfo in aktmoduleswitches then
  1001. concatstabto(bsssegment);
  1002. {$endif GDB}
  1003. if (cs_smartlink in aktmoduleswitches) or
  1004. ((var_options and vo_is_c_var)<>0) then
  1005. bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)))
  1006. else
  1007. bsssegment^.concat(new(pai_datablock,init(mangledname,l)));
  1008. { increase datasize }
  1009. inc(owner^.datasize,l);
  1010. { this symbol can't be loaded to a register }
  1011. var_options:=var_options and not vo_regable;
  1012. end;
  1013. globalsymtable :
  1014. begin
  1015. if (cs_smartlink in aktmoduleswitches) then
  1016. bsssegment^.concat(new(pai_cut,init));
  1017. {$ifdef GDB}
  1018. if cs_debuginfo in aktmoduleswitches then
  1019. concatstabto(bsssegment);
  1020. {$endif GDB}
  1021. bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)));
  1022. inc(owner^.datasize,l);
  1023. { this symbol can't be loaded to a register }
  1024. var_options:=var_options and not vo_regable;
  1025. end;
  1026. recordsymtable,
  1027. objectsymtable :
  1028. begin
  1029. { this symbol can't be loaded to a register }
  1030. var_options:=var_options and not vo_regable;
  1031. { align record and object fields }
  1032. if (l=1) or (aktpackrecords=1) then
  1033. begin
  1034. address:=owner^.datasize;
  1035. inc(owner^.datasize,l)
  1036. end
  1037. else
  1038. if (l=2) or (aktpackrecords=2) then
  1039. begin
  1040. owner^.datasize:=(owner^.datasize+1) and (not 1);
  1041. address:=owner^.datasize;
  1042. inc(owner^.datasize,l)
  1043. end
  1044. else
  1045. if (l<=4) or (aktpackrecords=4) then
  1046. begin
  1047. owner^.datasize:=(owner^.datasize+3) and (not 3);
  1048. address:=owner^.datasize;
  1049. inc(owner^.datasize,l);
  1050. end
  1051. else
  1052. if (l<=8) or (aktpackrecords=8) then
  1053. begin
  1054. owner^.datasize:=(owner^.datasize+7) and (not 7);
  1055. address:=owner^.datasize;
  1056. inc(owner^.datasize,l);
  1057. end
  1058. else
  1059. if (l<=16) or (aktpackrecords=16) then
  1060. begin
  1061. owner^.datasize:=(owner^.datasize+15) and (not 15);
  1062. address:=owner^.datasize;
  1063. inc(owner^.datasize,l);
  1064. end
  1065. else
  1066. if (l<=32) or (aktpackrecords=32) then
  1067. begin
  1068. owner^.datasize:=(owner^.datasize+31) and (not 31);
  1069. address:=owner^.datasize;
  1070. inc(owner^.datasize,l);
  1071. end;
  1072. end;
  1073. parasymtable :
  1074. begin
  1075. { here we need the size of a push instead of the
  1076. size of the data }
  1077. l:=getpushsize;
  1078. address:=owner^.datasize;
  1079. owner^.datasize:=align(owner^.datasize+l,target_os.stackalignment);
  1080. end
  1081. else
  1082. begin
  1083. modulo:=owner^.datasize and 3 ;
  1084. if (l>=4) and (modulo<>0) then
  1085. inc(owner^.datasize,4-modulo)
  1086. else
  1087. if (l>=2) and ((modulo and 1)<>0) then
  1088. inc(owner^.datasize);
  1089. address:=owner^.datasize;
  1090. inc(owner^.datasize,l);
  1091. end;
  1092. end;
  1093. end;
  1094. end;
  1095. {$ifdef GDB}
  1096. function tvarsym.stabstring : pchar;
  1097. var
  1098. st : char;
  1099. begin
  1100. if (owner^.symtabletype = objectsymtable) and
  1101. ((properties and sp_static)<>0) then
  1102. begin
  1103. if (cs_gdb_gsym in aktglobalswitches) then st := 'G' else st := 'S';
  1104. stabstring := strpnew('"'+owner^.name^+'__'+name+':'+
  1105. +definition^.numberstring+'",'+
  1106. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1107. end
  1108. else if (owner^.symtabletype = globalsymtable) or
  1109. (owner^.symtabletype = unitsymtable) then
  1110. begin
  1111. { Here we used S instead of
  1112. because with G GDB doesn't look at the address field
  1113. but searches the same name or with a leading underscore
  1114. but these names don't exist in pascal !}
  1115. if (cs_gdb_gsym in aktglobalswitches) then st := 'G' else st := 'S';
  1116. stabstring := strpnew('"'+name+':'+st
  1117. +definition^.numberstring+'",'+
  1118. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1119. end
  1120. else if owner^.symtabletype = staticsymtable then
  1121. begin
  1122. stabstring := strpnew('"'+name+':S'
  1123. +definition^.numberstring+'",'+
  1124. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1125. end
  1126. else if (owner^.symtabletype=parasymtable) then
  1127. begin
  1128. case varspez of
  1129. vs_var : st := 'v';
  1130. vs_value,
  1131. vs_const : if push_addr_param(definition) then
  1132. st := 'v' { should be 'i' but 'i' doesn't work }
  1133. else
  1134. st := 'p';
  1135. end;
  1136. stabstring := strpnew('"'+name+':'+st
  1137. +definition^.numberstring+'",'+
  1138. tostr(N_PSYM)+',0,'+tostr(fileinfo.line)+','+
  1139. tostr(address+owner^.address_fixup));
  1140. {offset to ebp => will not work if the framepointer is esp
  1141. so some optimizing will make things harder to debug }
  1142. end
  1143. else if (owner^.symtabletype=localsymtable) then
  1144. {$ifdef i386}
  1145. if reg<>R_NO then
  1146. begin
  1147. { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
  1148. { this is the register order for GDB}
  1149. stabstring:=strpnew('"'+name+':r'
  1150. +definition^.numberstring+'",'+
  1151. tostr(N_RSYM)+',0,'+
  1152. tostr(fileinfo.line)+','+tostr(GDB_i386index[reg]));
  1153. end
  1154. else
  1155. {$endif i386}
  1156. stabstring := strpnew('"'+name+':'
  1157. +definition^.numberstring+'",'+
  1158. tostr(N_LSYM)+',0,'+tostr(fileinfo.line)+',-'+tostr(address))
  1159. else
  1160. stabstring := inherited stabstring;
  1161. end;
  1162. procedure tvarsym.concatstabto(asmlist : paasmoutput);
  1163. {$ifdef i386}
  1164. var stab_str : pchar;
  1165. {$endif i386}
  1166. begin
  1167. inherited concatstabto(asmlist);
  1168. {$ifdef i386}
  1169. if (owner^.symtabletype=parasymtable) and
  1170. (reg<>R_NO) then
  1171. begin
  1172. { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
  1173. { this is the register order for GDB}
  1174. stab_str:=strpnew('"'+name+':r'
  1175. +definition^.numberstring+'",'+
  1176. tostr(N_RSYM)+',0,'+
  1177. tostr(fileinfo.line)+','+tostr(GDB_i386index[reg]));
  1178. asmlist^.concat(new(pai_stabs,init(stab_str)));
  1179. end;
  1180. {$endif i386}
  1181. end;
  1182. {$endif GDB}
  1183. destructor tvarsym.done;
  1184. begin
  1185. strdispose(_mangledname);
  1186. inherited done;
  1187. end;
  1188. {****************************************************************************
  1189. TTYPEDCONSTSYM
  1190. *****************************************************************************}
  1191. constructor ttypedconstsym.init(const n : string;p : pdef;really_const : boolean);
  1192. begin
  1193. tsym.init(n);
  1194. typ:=typedconstsym;
  1195. definition:=p;
  1196. is_really_const:=really_const;
  1197. prefix:=stringdup(procprefix);
  1198. end;
  1199. constructor ttypedconstsym.load;
  1200. begin
  1201. tsym.load;
  1202. typ:=typedconstsym;
  1203. definition:=readdefref;
  1204. {$ifdef DELPHI_CONST_IN_RODATA}
  1205. is_really_const:=boolean(readbyte);
  1206. {$else DELPHI_CONST_IN_RODATA}
  1207. is_really_const:=false;
  1208. {$endif DELPHI_CONST_IN_RODATA}
  1209. prefix:=stringdup(readstring);
  1210. end;
  1211. destructor ttypedconstsym.done;
  1212. begin
  1213. stringdispose(prefix);
  1214. tsym.done;
  1215. end;
  1216. function ttypedconstsym.mangledname : string;
  1217. begin
  1218. mangledname:='TC_'+prefix^+'_'+name;
  1219. end;
  1220. function ttypedconstsym.getsize : longint;
  1221. begin
  1222. if assigned(definition) then
  1223. getsize:=definition^.size
  1224. else
  1225. getsize:=0;
  1226. end;
  1227. procedure ttypedconstsym.deref;
  1228. begin
  1229. resolvedef(definition);
  1230. end;
  1231. procedure ttypedconstsym.write;
  1232. begin
  1233. tsym.write;
  1234. writedefref(definition);
  1235. writestring(prefix^);
  1236. {$ifdef DELPHI_CONST_IN_RODATA}
  1237. writebyte(byte(is_really_const));
  1238. {$endif DELPHI_CONST_IN_RODATA}
  1239. current_ppu^.writeentry(ibtypedconstsym);
  1240. end;
  1241. { for most symbol types ther is nothing to do at all }
  1242. procedure ttypedconstsym.insert_in_data;
  1243. begin
  1244. { here there is a problem for ansistrings !! }
  1245. { we must write the label only after the 12 header bytes (PM)
  1246. if not is_ansistring(definition) then
  1247. }
  1248. { solved, the ansis string is moved to consts (FK) }
  1249. really_insert_in_data;
  1250. end;
  1251. procedure ttypedconstsym.really_insert_in_data;
  1252. var curconstsegment : paasmoutput;
  1253. begin
  1254. if is_really_const then
  1255. curconstsegment:=consts
  1256. else
  1257. curconstsegment:=datasegment;
  1258. if owner^.symtabletype=globalsymtable then
  1259. begin
  1260. if (cs_smartlink in aktmoduleswitches) then
  1261. curconstsegment^.concat(new(pai_cut,init));
  1262. {$ifdef GDB}
  1263. if cs_debuginfo in aktmoduleswitches then
  1264. concatstabto(curconstsegment);
  1265. {$endif GDB}
  1266. curconstsegment^.concat(new(pai_symbol,init_global(mangledname)));
  1267. end
  1268. else
  1269. if owner^.symtabletype<>unitsymtable then
  1270. begin
  1271. if (cs_smartlink in aktmoduleswitches) then
  1272. curconstsegment^.concat(new(pai_cut,init));
  1273. {$ifdef GDB}
  1274. if cs_debuginfo in aktmoduleswitches then
  1275. concatstabto(curconstsegment);
  1276. {$endif GDB}
  1277. if (cs_smartlink in aktmoduleswitches) then
  1278. curconstsegment^.concat(new(pai_symbol,init_global(mangledname)))
  1279. else
  1280. curconstsegment^.concat(new(pai_symbol,init(mangledname)));
  1281. end;
  1282. end;
  1283. {$ifdef GDB}
  1284. function ttypedconstsym.stabstring : pchar;
  1285. var
  1286. st : char;
  1287. begin
  1288. if (cs_gdb_gsym in aktglobalswitches) and (owner^.symtabletype in [unitsymtable,globalsymtable]) then
  1289. st := 'G'
  1290. else
  1291. st := 'S';
  1292. stabstring := strpnew('"'+name+':'+st+
  1293. definition^.numberstring+'",'+tostr(n_STSYM)+',0,'+
  1294. tostr(fileinfo.line)+','+mangledname);
  1295. end;
  1296. {$endif GDB}
  1297. {****************************************************************************
  1298. TCONSTSYM
  1299. ****************************************************************************}
  1300. constructor tconstsym.init(const n : string;t : tconsttype;v : longint);
  1301. begin
  1302. inherited init(n);
  1303. typ:=constsym;
  1304. consttype:=t;
  1305. value:=v;
  1306. definition:=nil;
  1307. len:=0;
  1308. end;
  1309. constructor tconstsym.init_def(const n : string;t : tconsttype;v : longint;def : pdef);
  1310. begin
  1311. inherited init(n);
  1312. typ:=constsym;
  1313. consttype:=t;
  1314. value:=v;
  1315. definition:=def;
  1316. len:=0;
  1317. end;
  1318. constructor tconstsym.init_string(const n : string;t : tconsttype;str:pchar;l:longint);
  1319. begin
  1320. inherited init(n);
  1321. typ:=constsym;
  1322. consttype:=t;
  1323. value:=longint(str);
  1324. definition:=nil;
  1325. len:=l;
  1326. end;
  1327. constructor tconstsym.load;
  1328. var
  1329. pd : pbestreal;
  1330. ps : pnormalset;
  1331. begin
  1332. tsym.load;
  1333. typ:=constsym;
  1334. consttype:=tconsttype(readbyte);
  1335. case consttype of
  1336. constint,
  1337. constbool,
  1338. constchar : value:=readlong;
  1339. constord :
  1340. begin
  1341. definition:=readdefref;
  1342. value:=readlong;
  1343. end;
  1344. conststring :
  1345. begin
  1346. len:=readlong;
  1347. getmem(pchar(value),len+1);
  1348. current_ppu^.getdata(pchar(value)^,len);
  1349. end;
  1350. constreal :
  1351. begin
  1352. new(pd);
  1353. pd^:=readreal;
  1354. value:=longint(pd);
  1355. end;
  1356. constset :
  1357. begin
  1358. definition:=readdefref;
  1359. new(ps);
  1360. readnormalset(ps^);
  1361. value:=longint(ps);
  1362. end;
  1363. constnil : ;
  1364. else
  1365. Message1(unit_f_ppu_invalid_entry,tostr(ord(consttype)));
  1366. end;
  1367. end;
  1368. destructor tconstsym.done;
  1369. begin
  1370. case consttype of
  1371. conststring :
  1372. freemem(pchar(value),len+1);
  1373. constreal :
  1374. dispose(pbestreal(value));
  1375. constset :
  1376. dispose(pnormalset(value));
  1377. end;
  1378. inherited done;
  1379. end;
  1380. function tconstsym.mangledname : string;
  1381. begin
  1382. mangledname:=name;
  1383. end;
  1384. procedure tconstsym.deref;
  1385. begin
  1386. if consttype in [constord,constset] then
  1387. resolvedef(pdef(definition));
  1388. end;
  1389. procedure tconstsym.write;
  1390. begin
  1391. tsym.write;
  1392. writebyte(byte(consttype));
  1393. case consttype of
  1394. constnil : ;
  1395. constint,
  1396. constbool,
  1397. constchar :
  1398. writelong(value);
  1399. constord :
  1400. begin
  1401. writedefref(definition);
  1402. writelong(value);
  1403. end;
  1404. conststring :
  1405. begin
  1406. writelong(len);
  1407. current_ppu^.putdata(pchar(value)^,len);
  1408. end;
  1409. constreal :
  1410. writereal(pbestreal(value)^);
  1411. constset :
  1412. begin
  1413. writedefref(definition);
  1414. writenormalset(pointer(value)^);
  1415. end;
  1416. else
  1417. internalerror(13);
  1418. end;
  1419. current_ppu^.writeentry(ibconstsym);
  1420. end;
  1421. {$ifdef GDB}
  1422. function tconstsym.stabstring : pchar;
  1423. var st : string;
  1424. begin
  1425. {even GDB v4.16 only now 'i' 'r' and 'e' !!!}
  1426. case consttype of
  1427. conststring : begin
  1428. { I had to remove ibm2ascii !! }
  1429. st := pstring(value)^;
  1430. {st := ibm2ascii(pstring(value)^);}
  1431. st := 's'''+st+'''';
  1432. end;
  1433. constbool, constint, constord, constchar : st := 'i'+tostr(value);
  1434. constreal : begin
  1435. system.str(pbestreal(value)^,st);
  1436. st := 'r'+st;
  1437. end;
  1438. { if we don't know just put zero !! }
  1439. else st:='i0';
  1440. {***SETCONST}
  1441. {constset:;} {*** I don't know what to do with a set.}
  1442. { sets are not recognized by GDB}
  1443. {***}
  1444. end;
  1445. stabstring := strpnew('"'+name+':c='+st+'",'+tostr(N_function)+',0,'+
  1446. tostr(fileinfo.line)+',0');
  1447. end;
  1448. procedure tconstsym.concatstabto(asmlist : paasmoutput);
  1449. begin
  1450. if consttype <> conststring then
  1451. inherited concatstabto(asmlist);
  1452. end;
  1453. {$endif GDB}
  1454. {****************************************************************************
  1455. TENUMSYM
  1456. ****************************************************************************}
  1457. constructor tenumsym.init(const n : string;def : penumdef;v : longint);
  1458. begin
  1459. tsym.init(n);
  1460. typ:=enumsym;
  1461. definition:=def;
  1462. value:=v;
  1463. if def^.min>v then
  1464. def^.setmin(v);
  1465. if def^.max<v then
  1466. def^.setmax(v);
  1467. order;
  1468. end;
  1469. constructor tenumsym.load;
  1470. begin
  1471. tsym.load;
  1472. typ:=enumsym;
  1473. definition:=penumdef(readdefref);
  1474. value:=readlong;
  1475. nextenum := Nil;
  1476. end;
  1477. procedure tenumsym.deref;
  1478. begin
  1479. resolvedef(pdef(definition));
  1480. order;
  1481. end;
  1482. procedure tenumsym.order;
  1483. var
  1484. sym : penumsym;
  1485. begin
  1486. sym := definition^.firstenum;
  1487. if sym = nil then
  1488. begin
  1489. definition^.firstenum := @self;
  1490. nextenum := nil;
  1491. exit;
  1492. end;
  1493. { reorder the symbols in increasing value }
  1494. if value < sym^.value then
  1495. begin
  1496. nextenum := sym;
  1497. definition^.firstenum := @self;
  1498. end
  1499. else
  1500. begin
  1501. while (sym^.value <= value) and assigned(sym^.nextenum) do
  1502. sym := sym^.nextenum;
  1503. nextenum := sym^.nextenum;
  1504. sym^.nextenum := @self;
  1505. end;
  1506. end;
  1507. procedure tenumsym.write;
  1508. begin
  1509. tsym.write;
  1510. writedefref(definition);
  1511. writelong(value);
  1512. current_ppu^.writeentry(ibenumsym);
  1513. end;
  1514. {$ifdef GDB}
  1515. procedure tenumsym.concatstabto(asmlist : paasmoutput);
  1516. begin
  1517. {enum elements have no stab !}
  1518. end;
  1519. {$EndIf GDB}
  1520. {****************************************************************************
  1521. TTYPESYM
  1522. ****************************************************************************}
  1523. constructor ttypesym.init(const n : string;d : pdef);
  1524. begin
  1525. tsym.init(n);
  1526. typ:=typesym;
  1527. definition:=d;
  1528. {$ifdef GDB}
  1529. isusedinstab := false;
  1530. {$endif GDB}
  1531. forwardpointer:=nil;
  1532. if assigned(definition) and not(assigned(definition^.sym)) then
  1533. definition^.sym:=@self;
  1534. end;
  1535. constructor ttypesym.load;
  1536. begin
  1537. tsym.load;
  1538. typ:=typesym;
  1539. forwardpointer:=nil;
  1540. {$ifdef GDB}
  1541. isusedinstab := false;
  1542. {$endif GDB}
  1543. definition:=readdefref;
  1544. end;
  1545. destructor ttypesym.done;
  1546. begin
  1547. if assigned(definition) then
  1548. if definition^.sym=@self then
  1549. definition^.sym:=nil;
  1550. inherited done;
  1551. end;
  1552. procedure ttypesym.deref;
  1553. begin
  1554. resolvedef(definition);
  1555. if assigned(definition) then
  1556. begin
  1557. if definition^.sym=nil then
  1558. definition^.sym:=@self;
  1559. if (definition^.deftype=recorddef) and assigned(precdef(definition)^.symtable) and
  1560. (definition^.sym=@self) then
  1561. precdef(definition)^.symtable^.name:=stringdup('record '+name);
  1562. end;
  1563. end;
  1564. procedure ttypesym.write;
  1565. begin
  1566. tsym.write;
  1567. writedefref(definition);
  1568. current_ppu^.writeentry(ibtypesym);
  1569. end;
  1570. procedure ttypesym.load_references;
  1571. begin
  1572. inherited load_references;
  1573. if (definition^.deftype=recorddef) then
  1574. precdef(definition)^.symtable^.load_browser;
  1575. if (definition^.deftype=objectdef) then
  1576. pobjectdef(definition)^.publicsyms^.load_browser;
  1577. end;
  1578. function ttypesym.write_references : boolean;
  1579. begin
  1580. if not inherited write_references then
  1581. { write address of this symbol if record or object
  1582. even if no real refs are there
  1583. because we need it for the symtable }
  1584. if (definition^.deftype=recorddef) or
  1585. (definition^.deftype=objectdef) then
  1586. begin
  1587. writesymref(@self);
  1588. current_ppu^.writeentry(ibsymref);
  1589. end;
  1590. write_references:=true;
  1591. if (definition^.deftype=recorddef) then
  1592. precdef(definition)^.symtable^.write_browser;
  1593. if (definition^.deftype=objectdef) then
  1594. pobjectdef(definition)^.publicsyms^.write_browser;
  1595. end;
  1596. procedure ttypesym.addforwardpointer(p:ppointerdef);
  1597. var
  1598. hfp : pforwardpointer;
  1599. begin
  1600. new(hfp);
  1601. hfp^.next:=forwardpointer;
  1602. hfp^.def:=p;
  1603. forwardpointer:=hfp;
  1604. end;
  1605. procedure ttypesym.updateforwarddef(p:pdef);
  1606. var
  1607. lasthfp,hfp : pforwardpointer;
  1608. begin
  1609. definition:=p;
  1610. properties:=current_object_option;
  1611. fileinfo:=tokenpos;
  1612. if assigned(definition) and not(assigned(definition^.sym)) then
  1613. definition^.sym:=@self;
  1614. { update all forwardpointers to this definition }
  1615. hfp:=forwardpointer;
  1616. while assigned(hfp) do
  1617. begin
  1618. lasthfp:=hfp;
  1619. hfp^.def^.definition:=definition;
  1620. hfp:=hfp^.next;
  1621. dispose(lasthfp);
  1622. end;
  1623. end;
  1624. {$ifdef BrowserLog}
  1625. procedure ttypesym.add_to_browserlog;
  1626. begin
  1627. inherited add_to_browserlog;
  1628. if (definition^.deftype=recorddef) then
  1629. precdef(definition)^.symtable^.writebrowserlog;
  1630. if (definition^.deftype=objectdef) then
  1631. pobjectdef(definition)^.publicsyms^.writebrowserlog;
  1632. end;
  1633. {$endif BrowserLog}
  1634. {$ifdef GDB}
  1635. function ttypesym.stabstring : pchar;
  1636. var stabchar : string[2];
  1637. short : string;
  1638. begin
  1639. if definition^.deftype in tagtypes then
  1640. stabchar := 'Tt'
  1641. else
  1642. stabchar := 't';
  1643. short := '"'+name+':'+stabchar+definition^.numberstring
  1644. +'",'+tostr(N_LSYM)+',0,'+tostr(fileinfo.line)+',0';
  1645. stabstring := strpnew(short);
  1646. end;
  1647. procedure ttypesym.concatstabto(asmlist : paasmoutput);
  1648. begin
  1649. {not stabs for forward defs }
  1650. if assigned(definition) then
  1651. if (definition^.sym = @self) then
  1652. definition^.concatstabto(asmlist)
  1653. else
  1654. inherited concatstabto(asmlist);
  1655. end;
  1656. {$endif GDB}
  1657. {****************************************************************************
  1658. TSYSSYM
  1659. ****************************************************************************}
  1660. constructor tsyssym.init(const n : string;l : longint);
  1661. begin
  1662. inherited init(n);
  1663. typ:=syssym;
  1664. number:=l;
  1665. end;
  1666. constructor tsyssym.load;
  1667. begin
  1668. tsym.load;
  1669. typ:=syssym;
  1670. number:=readlong;
  1671. end;
  1672. destructor tsyssym.done;
  1673. begin
  1674. inherited done;
  1675. end;
  1676. procedure tsyssym.write;
  1677. begin
  1678. {$ifndef OLDPPU}
  1679. tsym.write;
  1680. writelong(number);
  1681. current_ppu^.writeentry(ibsyssym);
  1682. {$endif}
  1683. end;
  1684. {$ifdef GDB}
  1685. procedure tsyssym.concatstabto(asmlist : paasmoutput);
  1686. begin
  1687. end;
  1688. {$endif GDB}
  1689. {****************************************************************************
  1690. TMACROSYM
  1691. ****************************************************************************}
  1692. constructor tmacrosym.init(const n : string);
  1693. begin
  1694. inherited init(n);
  1695. typ:=macrosym;
  1696. defined:=true;
  1697. buftext:=nil;
  1698. buflen:=0;
  1699. end;
  1700. destructor tmacrosym.done;
  1701. begin
  1702. if assigned(buftext) then
  1703. freemem(buftext,buflen);
  1704. inherited done;
  1705. end;
  1706. {
  1707. $Log$
  1708. Revision 1.82 1999-04-26 13:31:52 peter
  1709. * release storenumber,double_checksum
  1710. Revision 1.81 1999/04/25 22:38:39 pierre
  1711. + added is_really_const booleanfield for typedconstsym
  1712. for Delphi in $J- mode (not yet implemented !)
  1713. Revision 1.80 1999/04/21 09:43:54 peter
  1714. * storenumber works
  1715. * fixed some typos in double_checksum
  1716. + incompatible types type1 and type2 message (with storenumber)
  1717. Revision 1.79 1999/04/17 13:16:21 peter
  1718. * fixes for storenumber
  1719. Revision 1.78 1999/04/14 09:15:02 peter
  1720. * first things to store the symbol/def number in the ppu
  1721. Revision 1.77 1999/04/08 10:11:32 pierre
  1722. + enable uninitilized warnings for static symbols
  1723. Revision 1.76 1999/03/31 13:55:21 peter
  1724. * assembler inlining working for ag386bin
  1725. Revision 1.75 1999/03/24 23:17:27 peter
  1726. * fixed bugs 212,222,225,227,229,231,233
  1727. Revision 1.74 1999/02/23 18:29:27 pierre
  1728. * win32 compilation error fix
  1729. + some work for local browser (not cl=omplete yet)
  1730. Revision 1.73 1999/02/22 13:07:09 pierre
  1731. + -b and -bl options work !
  1732. + cs_local_browser ($L+) is disabled if cs_browser ($Y+)
  1733. is not enabled when quitting global section
  1734. * local vars and procedures are not yet stored into PPU
  1735. Revision 1.72 1999/02/08 09:51:22 pierre
  1736. * gdb info for local functions was wrong
  1737. Revision 1.71 1999/01/23 23:29:41 florian
  1738. * first running version of the new code generator
  1739. * when compiling exceptions under Linux fixed
  1740. Revision 1.70 1999/01/21 22:10:48 peter
  1741. * fixed array of const
  1742. * generic platform independent high() support
  1743. Revision 1.69 1999/01/20 10:20:20 peter
  1744. * don't make localvar copies for assembler procedures
  1745. Revision 1.68 1999/01/12 14:25:36 peter
  1746. + BrowserLog for browser.log generation
  1747. + BrowserCol for browser info in TCollections
  1748. * released all other UseBrowser
  1749. Revision 1.67 1998/12/30 22:15:54 peter
  1750. + farpointer type
  1751. * absolutesym now also stores if its far
  1752. Revision 1.66 1998/12/30 13:41:14 peter
  1753. * released valuepara
  1754. Revision 1.65 1998/12/26 15:35:44 peter
  1755. + read/write of constnil
  1756. Revision 1.64 1998/12/08 10:18:15 peter
  1757. + -gh for heaptrc unit
  1758. Revision 1.63 1998/11/28 16:20:56 peter
  1759. + support for dll variables
  1760. Revision 1.62 1998/11/27 14:50:48 peter
  1761. + open strings, $P switch support
  1762. Revision 1.61 1998/11/18 15:44:18 peter
  1763. * VALUEPARA for tp7 compatible value parameters
  1764. Revision 1.60 1998/11/16 10:13:51 peter
  1765. * label defines are checked at the end of the proc
  1766. Revision 1.59 1998/11/13 12:09:11 peter
  1767. * unused label is now a warning
  1768. Revision 1.58 1998/11/10 10:50:57 pierre
  1769. * temporary fix for long mangled procsym names
  1770. Revision 1.57 1998/11/05 23:39:31 peter
  1771. + typedconst.getsize
  1772. Revision 1.56 1998/10/28 18:26:18 pierre
  1773. * removed some erros after other errors (introduced by useexcept)
  1774. * stabs works again correctly (for how long !)
  1775. Revision 1.55 1998/10/20 08:07:00 pierre
  1776. * several memory corruptions due to double freemem solved
  1777. => never use p^.loc.location:=p^.left^.loc.location;
  1778. + finally I added now by default
  1779. that ra386dir translates global and unit symbols
  1780. + added a first field in tsymtable and
  1781. a nextsym field in tsym
  1782. (this allows to obtain ordered type info for
  1783. records and objects in gdb !)
  1784. Revision 1.54 1998/10/19 08:55:07 pierre
  1785. * wrong stabs info corrected once again !!
  1786. + variable vmt offset with vmt field only if required
  1787. implemented now !!!
  1788. Revision 1.53 1998/10/16 08:51:53 peter
  1789. + target_os.stackalignment
  1790. + stack can be aligned at 2 or 4 byte boundaries
  1791. Revision 1.52 1998/10/08 17:17:32 pierre
  1792. * current_module old scanner tagged as invalid if unit is recompiled
  1793. + added ppheap for better info on tracegetmem of heaptrc
  1794. (adds line column and file index)
  1795. * several memory leaks removed ith help of heaptrc !!
  1796. Revision 1.51 1998/10/08 13:48:50 peter
  1797. * fixed memory leaks for do nothing source
  1798. * fixed unit interdependency
  1799. Revision 1.50 1998/10/06 17:16:56 pierre
  1800. * some memory leaks fixed (thanks to Peter for heaptrc !)
  1801. Revision 1.49 1998/10/01 09:22:55 peter
  1802. * fixed value openarray
  1803. * ungettemp of arrayconstruct
  1804. Revision 1.48 1998/09/26 17:45:44 peter
  1805. + idtoken and only one token table
  1806. Revision 1.47 1998/09/24 15:11:17 peter
  1807. * fixed enum for not GDB
  1808. Revision 1.46 1998/09/23 15:39:13 pierre
  1809. * browser bugfixes
  1810. was adding a reference when looking for the symbol
  1811. if -bSYM_NAME was used
  1812. Revision 1.45 1998/09/21 08:45:24 pierre
  1813. + added vmt_offset in tobjectdef.write for fututre use
  1814. (first steps to have objects without vmt if no virtual !!)
  1815. + added fpu_used field for tabstractprocdef :
  1816. sets this level to 2 if the functions return with value in FPU
  1817. (is then set to correct value at parsing of implementation)
  1818. THIS MIGHT refuse some code with FPU expression too complex
  1819. that were accepted before and even in some cases
  1820. that don't overflow in fact
  1821. ( like if f : float; is a forward that finally in implementation
  1822. only uses one fpu register !!)
  1823. Nevertheless I think that it will improve security on
  1824. FPU operations !!
  1825. * most other changes only for UseBrowser code
  1826. (added symtable references for record and objects)
  1827. local switch for refs to args and local of each function
  1828. (static symtable still missing)
  1829. UseBrowser still not stable and probably broken by
  1830. the definition hash array !!
  1831. Revision 1.44 1998/09/18 16:03:47 florian
  1832. * some changes to compile with Delphi
  1833. Revision 1.43 1998/09/18 08:01:38 pierre
  1834. + improvement on the usebrowser part
  1835. (does not work correctly for now)
  1836. Revision 1.42 1998/09/07 19:33:25 florian
  1837. + some stuff for property rtti added:
  1838. - NameIndex of the TPropInfo record is now written correctly
  1839. - the DEFAULT/NODEFAULT keyword is supported now
  1840. - the default value and the storedsym/def are now written to
  1841. the PPU fiel
  1842. Revision 1.41 1998/09/07 18:46:12 peter
  1843. * update smartlinking, uses getdatalabel
  1844. * renamed ptree.value vars to value_str,value_real,value_set
  1845. Revision 1.40 1998/09/07 17:37:04 florian
  1846. * first fixes for published properties
  1847. Revision 1.39 1998/09/05 22:11:02 florian
  1848. + switch -vb
  1849. * while/repeat loops accept now also word/longbool conditions
  1850. * makebooltojump did an invalid ungetregister32, fixed
  1851. Revision 1.38 1998/09/01 12:53:26 peter
  1852. + aktpackenum
  1853. Revision 1.37 1998/09/01 07:54:25 pierre
  1854. * UseBrowser a little updated (might still be buggy !!)
  1855. * bug in psub.pas in function specifier removed
  1856. * stdcall allowed in interface and in implementation
  1857. (FPC will not yet complain if it is missing in either part
  1858. because stdcall is only a dummy !!)
  1859. Revision 1.36 1998/08/25 13:09:26 pierre
  1860. * corrected mangling sheme :
  1861. cvar add Cprefix to the mixed case name whereas
  1862. export or public use direct name
  1863. Revision 1.35 1998/08/25 12:42:46 pierre
  1864. * CDECL changed to CVAR for variables
  1865. specifications are read in structures also
  1866. + started adding GPC compatibility mode ( option -Sp)
  1867. * names changed to lowercase
  1868. Revision 1.34 1998/08/21 14:08:53 pierre
  1869. + TEST_FUNCRET now default (old code removed)
  1870. works also for m68k (at least compiles)
  1871. Revision 1.33 1998/08/20 12:53:27 peter
  1872. * object_options are always written for object syms
  1873. Revision 1.32 1998/08/20 09:26:46 pierre
  1874. + funcret setting in underproc testing
  1875. compile with _dTEST_FUNCRET
  1876. Revision 1.31 1998/08/17 10:10:12 peter
  1877. - removed OLDPPU
  1878. Revision 1.30 1998/08/13 10:57:29 peter
  1879. * constant sets are now written correctly to the ppufile
  1880. Revision 1.29 1998/08/11 15:31:42 peter
  1881. * write extended to ppu file
  1882. * new version 0.99.7
  1883. Revision 1.28 1998/08/11 14:07:27 peter
  1884. * fixed pushing of high value for openarray
  1885. Revision 1.27 1998/08/10 14:50:31 peter
  1886. + localswitches, moduleswitches, globalswitches splitting
  1887. Revision 1.26 1998/08/10 10:18:35 peter
  1888. + Compiler,Comphook unit which are the new interface units to the
  1889. compiler
  1890. Revision 1.25 1998/07/30 11:18:19 florian
  1891. + first implementation of try ... except on .. do end;
  1892. * limitiation of 65535 bytes parameters for cdecl removed
  1893. Revision 1.24 1998/07/20 18:40:16 florian
  1894. * handling of ansi string constants should now work
  1895. Revision 1.23 1998/07/14 21:37:24 peter
  1896. * fixed packrecords as discussed at the alias
  1897. Revision 1.22 1998/07/14 14:47:08 peter
  1898. * released NEWINPUT
  1899. Revision 1.21 1998/07/13 21:17:38 florian
  1900. * changed to compile with TP
  1901. Revision 1.20 1998/07/10 00:00:05 peter
  1902. * fixed ttypesym bug finally
  1903. * fileinfo in the symtable and better using for unused vars
  1904. Revision 1.19 1998/07/07 17:40:39 peter
  1905. * packrecords 4 works
  1906. * word aligning of parameters
  1907. Revision 1.18 1998/07/07 11:20:15 peter
  1908. + NEWINPUT for a better inputfile and scanner object
  1909. Revision 1.17 1998/06/24 14:48:40 peter
  1910. * ifdef newppu -> ifndef oldppu
  1911. Revision 1.16 1998/06/19 15:40:42 peter
  1912. * removed cosntructor/constructor warning and 0.99.5 recompiles it again
  1913. Revision 1.15 1998/06/17 14:10:18 peter
  1914. * small os2 fixes
  1915. * fixed interdependent units with newppu (remake3 under linux works now)
  1916. Revision 1.14 1998/06/16 08:56:34 peter
  1917. + targetcpu
  1918. * cleaner pmodules for newppu
  1919. Revision 1.13 1998/06/15 15:38:10 pierre
  1920. * small bug in systems.pas corrected
  1921. + operators in different units better hanlded
  1922. Revision 1.12 1998/06/15 14:23:44 daniel
  1923. * Reverted my changes.
  1924. Revision 1.10 1998/06/13 00:10:18 peter
  1925. * working browser and newppu
  1926. * some small fixes against crashes which occured in bp7 (but not in
  1927. fpc?!)
  1928. Revision 1.9 1998/06/12 16:15:35 pierre
  1929. * external name 'C_var';
  1930. export name 'intern_C_var';
  1931. cdecl;
  1932. cdecl;external;
  1933. are now supported only with -Sv switch
  1934. Revision 1.8 1998/06/11 10:11:59 peter
  1935. * -gb works again
  1936. Revision 1.7 1998/06/09 16:01:51 pierre
  1937. + added procedure directive parsing for procvars
  1938. (accepted are popstack cdecl and pascal)
  1939. + added C vars with the following syntax
  1940. var C calias 'true_c_name';(can be followed by external)
  1941. reason is that you must add the Cprefix
  1942. which is target dependent
  1943. Revision 1.6 1998/06/08 22:59:53 peter
  1944. * smartlinking works for win32
  1945. * some defines to exclude some compiler parts
  1946. Revision 1.5 1998/06/04 23:52:02 peter
  1947. * m68k compiles
  1948. + .def file creation moved to gendef.pas so it could also be used
  1949. for win32
  1950. Revision 1.4 1998/06/04 09:55:46 pierre
  1951. * demangled name of procsym reworked to become independant of the mangling scheme
  1952. Revision 1.3 1998/06/03 22:14:20 florian
  1953. * problem with sizes of classes fixed (if the anchestor was declared
  1954. forward, the compiler doesn't update the child classes size)
  1955. Revision 1.2 1998/05/28 14:40:29 peter
  1956. * fixes for newppu, remake3 works now with it
  1957. Revision 1.1 1998/05/27 19:45:09 peter
  1958. * symtable.pas splitted into includefiles
  1959. * symtable adapted for $ifndef OLDPPU
  1960. }