symsym.inc 66 KB

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