ppudump.pp 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by the FPC Development Team
  4. Dumps the contents of a FPC unit file (PPU File)
  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. {$ifdef TP}
  18. {$N+,E+}
  19. {$endif}
  20. program pppdump;
  21. uses
  22. {$ifdef go32v2}
  23. dpmiexcp,
  24. {$endif go32v2}
  25. ppu;
  26. const
  27. Version = 'Version 0.99.13';
  28. Title = 'PPU-Analyser';
  29. Copyright = 'Copyright (c) 1998-2000 by the Free Pascal Development Team';
  30. { verbosity }
  31. v_none = $0;
  32. v_header = $1;
  33. v_defs = $2;
  34. v_syms = $4;
  35. v_interface = $8;
  36. v_implementation = $10;
  37. v_browser = $20;
  38. v_all = $ff;
  39. var
  40. ppufile : pppufile;
  41. space : string;
  42. read_member : boolean;
  43. verbose : longint;
  44. {****************************************************************************
  45. Helper Routines
  46. ****************************************************************************}
  47. const has_errors : boolean = false;
  48. Procedure Error(const S : string);
  49. Begin
  50. Writeln(S);
  51. has_errors:=true;
  52. End;
  53. Function Target2Str(w:longint):string;
  54. type
  55. ttarget = (target_none
  56. ,target_i386_GO32V1,target_i386_GO32V2,target_i386_linux,
  57. target_i386_OS2,target_i386_Win32
  58. ,target_m68k_Amiga,target_m68k_Atari,target_m68k_Mac,
  59. target_m68k_linux,target_m68k_PalmOS
  60. );
  61. const
  62. Targets : array[ttarget] of string[10]=('none',
  63. 'GO32V1','GO32V2','Linux-i386','OS/2','Win32',
  64. 'Amiga','Mac68k','Atari','Linux-m68k','PalmOs');
  65. begin
  66. if w<=ord(high(ttarget)) then
  67. Target2Str:=Targets[ttarget(w)]
  68. else
  69. Target2Str:='<Unknown>';
  70. end;
  71. Function Cpu2Str(w:longint):string;
  72. type
  73. ttargetcpu=(no_cpu
  74. ,i386,m68k,alpha
  75. );
  76. const
  77. CpuTxt : array[ttargetcpu] of string[5]=
  78. ('none','i386','m68k','alpha');
  79. begin
  80. if w<=ord(high(ttargetcpu)) then
  81. Cpu2Str:=CpuTxt[ttargetcpu(w)]
  82. else
  83. Cpu2Str:='<Unknown>';
  84. end;
  85. function PPUFlags2Str(flags:longint):string;
  86. type
  87. tflagopt=record
  88. mask : longint;
  89. str : string[30];
  90. end;
  91. const
  92. flagopts=11;
  93. flagopt : array[1..flagopts] of tflagopt=(
  94. (mask: $1 ;str:'init'),
  95. (mask: $2 ;str:'final'),
  96. (mask: $4 ;str:'big_endian'),
  97. (mask: $8 ;str:'dbx'),
  98. (mask: $10 ;str:'browser'),
  99. (mask: $20 ;str:'in_library'),
  100. (mask: $40 ;str:'smart_linked'),
  101. (mask: $80 ;str:'static_linked'),
  102. (mask: $100 ;str:'shared_linked'),
  103. (mask: $200 ;str:'local_browser'),
  104. (mask: $400 ;str:'no_link')
  105. );
  106. var
  107. i : longint;
  108. first : boolean;
  109. s : string;
  110. begin
  111. s:='';
  112. if flags<>0 then
  113. begin
  114. first:=true;
  115. for i:=1to flagopts do
  116. if (flags and flagopt[i].mask)<>0 then
  117. begin
  118. if first then
  119. first:=false
  120. else
  121. s:=s+', ';
  122. s:=s+flagopt[i].str;
  123. end;
  124. end
  125. else
  126. s:='none';
  127. PPUFlags2Str:=s;
  128. end;
  129. const
  130. HexTbl : array[0..15] of char='0123456789ABCDEF';
  131. function HexB(b:byte):string;
  132. begin
  133. HexB[0]:=#2;
  134. HexB[1]:=HexTbl[b shr 4];
  135. HexB[2]:=HexTbl[b and $f];
  136. end;
  137. {****************************************************************************
  138. Read Routines
  139. ****************************************************************************}
  140. Procedure ReadLinkContainer(const prefix:string);
  141. {
  142. Read a serie of strings and write to the screen starting every line
  143. with prefix
  144. }
  145. function maskstr(m:longint):string;
  146. const
  147. { link options }
  148. link_none = $0;
  149. link_allways = $1;
  150. link_static = $2;
  151. link_smart = $4;
  152. link_shared = $8;
  153. var
  154. s : string;
  155. begin
  156. s:='';
  157. if (m and link_allways)<>0 then
  158. s:=s+'always ';
  159. if (m and link_static)<>0 then
  160. s:=s+'static ';
  161. if (m and link_smart)<>0 then
  162. s:=s+'smart ';
  163. if (m and link_shared)<>0 then
  164. s:=s+'shared ';
  165. maskstr:=s;
  166. end;
  167. var
  168. s : string;
  169. m : longint;
  170. begin
  171. while not ppufile^.endofentry do
  172. begin
  173. s:=ppufile^.getstring;
  174. m:=ppufile^.getlongint;
  175. WriteLn(prefix,s,' (',maskstr(m),')');
  176. end;
  177. end;
  178. Procedure ReadContainer(const prefix:string);
  179. {
  180. Read a serie of strings and write to the screen starting every line
  181. with prefix
  182. }
  183. begin
  184. while not ppufile^.endofentry do
  185. WriteLn(prefix,ppufile^.getstring);
  186. end;
  187. Procedure ReadRef;
  188. begin
  189. if (verbose and v_browser)=0 then
  190. exit;
  191. while (not ppufile^.endofentry) and (not ppufile^.error) do
  192. Writeln(space,' - Refered : ',ppufile^.getword,', (',ppufile^.getlongint,',',ppufile^.getword,')');
  193. end;
  194. Procedure ReadPosInfo;
  195. begin
  196. Writeln(ppufile^.getword,' (',ppufile^.getlongint,',',ppufile^.getword,')');
  197. end;
  198. function readderef(const s:string;skipnil:boolean):boolean;
  199. type
  200. tdereftype = (derefnil,derefaktrecordindex,derefaktstaticindex,
  201. derefunit,derefrecord,derefindex,
  202. dereflocal,derefpara,derefaktlocalindex);
  203. var
  204. b : tdereftype;
  205. begin
  206. readderef:=true;
  207. repeat
  208. b:=tdereftype(ppufile^.getbyte);
  209. case b of
  210. derefnil :
  211. begin
  212. if not skipnil then
  213. writeln('nil');
  214. readderef:=false;
  215. break;
  216. end;
  217. derefaktrecordindex :
  218. begin
  219. writeln('AktRecord ',s,' ',ppufile^.getword);
  220. break;
  221. end;
  222. derefaktstaticindex :
  223. begin
  224. writeln('AktStatic ',s,' ',ppufile^.getword);
  225. break;
  226. end;
  227. derefaktlocalindex :
  228. begin
  229. writeln('AktLocal ',s,' ',ppufile^.getword);
  230. break;
  231. end;
  232. derefunit :
  233. begin
  234. writeln('Unit ',ppufile^.getword);
  235. break;
  236. end;
  237. derefrecord :
  238. begin
  239. write('RecordDef ',ppufile^.getword,', ');
  240. end;
  241. derefpara :
  242. begin
  243. write('Parameter of procdef ',ppufile^.getword,', ');
  244. end;
  245. dereflocal :
  246. begin
  247. write('Local of procdef ',ppufile^.getword,', ');
  248. end;
  249. derefindex :
  250. begin
  251. write(s,' ',ppufile^.getword,', ');
  252. end;
  253. else
  254. begin
  255. writeln('!! unsupported dereftyp: ',ord(derefindex));
  256. break;
  257. end;
  258. end;
  259. until false;
  260. end;
  261. function readdefref:boolean;
  262. begin
  263. readdefref:=readderef('Definition',false);
  264. end;
  265. function readsymref:boolean;
  266. begin
  267. readsymref:=readderef('Symbol',false);
  268. end;
  269. procedure readtype;
  270. var
  271. b1,b2 : boolean;
  272. begin
  273. b1:=readderef('Definition',true);
  274. b2:=readderef('Symbol',true);
  275. if not(b1 or b2) then
  276. Writeln('nil')
  277. else
  278. if (b1 and b2) then
  279. Writeln('!! Type has both definition and symbol stored');
  280. end;
  281. procedure readsymlist(const s:string);
  282. begin
  283. readdefref;
  284. repeat
  285. write(s);
  286. if not readsymref then
  287. break;
  288. until false;
  289. end;
  290. procedure read_abstract_proc_def;
  291. type
  292. tproccalloption=(pocall_none,
  293. pocall_clearstack, { Use IBM flat calling convention. (Used by GCC.) }
  294. pocall_leftright, { Push parameters from left to right }
  295. pocall_cdecl, { procedure uses C styled calling }
  296. pocall_register, { procedure uses register (fastcall) calling }
  297. pocall_stdcall, { procedure uses stdcall call }
  298. pocall_safecall, { safe call calling conventions }
  299. pocall_palmossyscall, { procedure is a PalmOS system call }
  300. pocall_system,
  301. pocall_inline, { Procedure is an assembler macro }
  302. pocall_internproc, { Procedure has compiler magic}
  303. pocall_internconst { procedure has constant evaluator intern }
  304. );
  305. tproccalloptions=set of tproccalloption;
  306. tproctypeoption=(potype_none,
  307. potype_proginit, { Program initialization }
  308. potype_unitinit, { unit initialization }
  309. potype_unitfinalize, { unit finalization }
  310. potype_constructor, { Procedure is a constructor }
  311. potype_destructor, { Procedure is a destructor }
  312. potype_operator { Procedure defines an operator }
  313. );
  314. tproctypeoptions=set of tproctypeoption;
  315. tprocoption=(po_none,
  316. po_classmethod, { class method }
  317. po_virtualmethod, { Procedure is a virtual method }
  318. po_abstractmethod, { Procedure is an abstract method }
  319. po_staticmethod, { static method }
  320. po_overridingmethod, { method with override directive }
  321. po_methodpointer, { method pointer, only in procvardef, also used for 'with object do' }
  322. po_containsself, { self is passed explicit to the compiler }
  323. po_interrupt, { Procedure is an interrupt handler }
  324. po_iocheck, { IO checking should be done after a call to the procedure }
  325. po_assembler, { Procedure is written in assembler }
  326. po_msgstr, { method for string message handling }
  327. po_msgint, { method for int message handling }
  328. po_exports, { Procedure has export directive (needed for OS/2) }
  329. po_external, { Procedure is external (in other object or lib)}
  330. po_savestdregs, { save std regs cdecl and stdcall need that ! }
  331. po_saveregisters { save all registers }
  332. );
  333. tprocoptions=set of tprocoption;
  334. type
  335. tproccallopt=record
  336. mask : tproccalloption;
  337. str : string[30];
  338. end;
  339. tproctypeopt=record
  340. mask : tproctypeoption;
  341. str : string[30];
  342. end;
  343. tprocopt=record
  344. mask : tprocoption;
  345. str : string[30];
  346. end;
  347. const
  348. proccallopts=12;
  349. proccallopt : array[1..proccallopts] of tproccallopt=(
  350. (mask:pocall_none; str:''),
  351. (mask:pocall_clearstack; str:'ClearStack'),
  352. (mask:pocall_leftright; str:'LeftRight'),
  353. (mask:pocall_cdecl; str:'Cdecl'),
  354. (mask:pocall_register; str:'Register'),
  355. (mask:pocall_stdcall; str:'StdCall'),
  356. (mask:pocall_safecall; str:'SafeCall'),
  357. (mask:pocall_palmossyscall;str:'PalmOSSysCall'),
  358. (mask:pocall_system; str:'System'),
  359. (mask:pocall_inline; str:'Inline'),
  360. (mask:pocall_internproc; str:'InternProc'),
  361. (mask:pocall_internconst; str:'InternConst')
  362. );
  363. proctypeopts=6;
  364. proctypeopt : array[1..proctypeopts] of tproctypeopt=(
  365. (mask:potype_proginit; str:'ProgInit'),
  366. (mask:potype_unitinit; str:'UnitInit'),
  367. (mask:potype_unitfinalize;str:'UnitFinalize'),
  368. (mask:potype_constructor; str:'Constructor'),
  369. (mask:potype_destructor; str:'Destructor'),
  370. (mask:potype_operator; str:'Operator')
  371. );
  372. procopts=16;
  373. procopt : array[1..procopts] of tprocopt=(
  374. (mask:po_classmethod; str:'ClassMethod'),
  375. (mask:po_virtualmethod; str:'VirtualMethod'),
  376. (mask:po_abstractmethod; str:'AbstractMethod'),
  377. (mask:po_staticmethod; str:'StaticMethod'),
  378. (mask:po_overridingmethod;str:'OverridingMethod'),
  379. (mask:po_methodpointer; str:'MethodPointer'),
  380. (mask:po_containsself; str:'ContainsSelf'),
  381. (mask:po_interrupt; str:'Interrupt'),
  382. (mask:po_iocheck; str:'IOCheck'),
  383. (mask:po_assembler; str:'Assembler'),
  384. (mask:po_msgstr; str:'MsgStr'),
  385. (mask:po_msgint; str:'MsgInt'),
  386. (mask:po_exports; str:'Exports'),
  387. (mask:po_external; str:'External'),
  388. (mask:po_savestdregs; str:'SaveStdRegs'),
  389. (mask:po_saveregisters; str:'SaveRegisters')
  390. );
  391. tvarspez : array[0..2] of string[5]=('Value','Const','Var ');
  392. var
  393. proctypeoption : tproctypeoption;
  394. proccalloptions : tproccalloptions;
  395. procoptions : tprocoptions;
  396. i,params : longint;
  397. first : boolean;
  398. begin
  399. write(space,' Return type : ');
  400. readtype;
  401. writeln(space,' Fpu used : ',ppufile^.getbyte);
  402. proctypeoption:=tproctypeoption(ppufile^.getlongint);
  403. if proctypeoption<>potype_none then
  404. begin
  405. write(space,' TypeOption : ');
  406. first:=true;
  407. for i:=1to proctypeopts do
  408. if (proctypeopt[i].mask=proctypeoption) then
  409. begin
  410. if first then
  411. first:=false
  412. else
  413. write(', ');
  414. write(proctypeopt[i].str);
  415. end;
  416. writeln;
  417. end;
  418. ppufile^.getsmallset(proccalloptions);
  419. if proccalloptions<>[] then
  420. begin
  421. write(space,' CallOptions : ');
  422. first:=true;
  423. for i:=1to proccallopts do
  424. if (proccallopt[i].mask in proccalloptions) then
  425. begin
  426. if first then
  427. first:=false
  428. else
  429. write(', ');
  430. write(proccallopt[i].str);
  431. end;
  432. writeln;
  433. end;
  434. ppufile^.getsmallset(procoptions);
  435. if procoptions<>[] then
  436. begin
  437. write(space,' Options : ');
  438. first:=true;
  439. for i:=1to procopts do
  440. if (procopt[i].mask in procoptions) then
  441. begin
  442. if first then
  443. first:=false
  444. else
  445. write(', ');
  446. write(procopt[i].str);
  447. end;
  448. writeln;
  449. end;
  450. params:=ppufile^.getword;
  451. writeln(space,' Nr of parameters : ',params);
  452. if params>0 then
  453. begin
  454. repeat
  455. write(space,' - ',tvarspez[ppufile^.getbyte],' : ');
  456. readtype;
  457. dec(params);
  458. until params=0;
  459. end;
  460. end;
  461. procedure readcommonsym(const s:string);
  462. type
  463. tsymoption=(sp_none,
  464. sp_public,
  465. sp_private,
  466. sp_published,
  467. sp_protected,
  468. sp_forwarddef,
  469. sp_static,
  470. sp_primary_typesym { this is for typesym, to know who is the primary symbol of a def }
  471. );
  472. tsymoptions=set of tsymoption;
  473. tsymopt=record
  474. mask : tsymoption;
  475. str : string[30];
  476. end;
  477. const
  478. symopts=7;
  479. symopt : array[1..symopts] of tsymopt=(
  480. (mask:sp_public; str:'Public'),
  481. (mask:sp_private; str:'Private'),
  482. (mask:sp_published; str:'Published'),
  483. (mask:sp_protected; str:'Protected'),
  484. (mask:sp_forwarddef; str:'ForwardDef'),
  485. (mask:sp_static; str:'Static'),
  486. (mask:sp_primary_typesym;str:'PrimaryTypeSym')
  487. );
  488. var
  489. symoptions : tsymoptions;
  490. i : longint;
  491. first : boolean;
  492. begin
  493. writeln(space,'** Symbol Nr. ',ppufile^.getword,' **');
  494. writeln(space,s,ppufile^.getstring);
  495. ppufile^.getsmallset(symoptions);
  496. if symoptions<>[] then
  497. begin
  498. write(space,' File Pos: ');
  499. readposinfo;
  500. write(space,' Options: ');
  501. first:=true;
  502. for i:=1to symopts do
  503. if (symopt[i].mask in symoptions) then
  504. begin
  505. if first then
  506. first:=false
  507. else
  508. write(', ');
  509. write(symopt[i].str);
  510. end;
  511. writeln;
  512. end;
  513. end;
  514. procedure readcommondef(const s:string);
  515. begin
  516. writeln(space,'** Definition Nr. ',ppufile^.getword,' **');
  517. writeln(space,s);
  518. write (space,' Type symbol : ');
  519. readsymref;
  520. end;
  521. {****************************************************************************
  522. Read Symbols Part
  523. ****************************************************************************}
  524. procedure readsymbols;
  525. Const
  526. vo_is_C_var = 2;
  527. Type
  528. absolutetyp = (tovar,toasm,toaddr);
  529. tconsttyp = (constnone,
  530. constord,conststring,constreal,constbool,
  531. constint,constchar,constset,constpointer,constnil,
  532. constresourcestring
  533. );
  534. var
  535. b : byte;
  536. pc : pchar;
  537. totalsyms,
  538. symcnt,
  539. i,j,len : longint;
  540. begin
  541. symcnt:=1;
  542. with ppufile^ do
  543. begin
  544. if space<>'' then
  545. Writeln(space,'-----------------------------');
  546. if readentry=ibstartsyms then
  547. begin
  548. totalsyms:=getlongint;
  549. Writeln(space,'Number of symbols: ',totalsyms);
  550. Writeln(space,'Symtable datasize: ',getlongint);
  551. end
  552. else
  553. begin
  554. totalsyms:=-1;
  555. Writeln('!! ibstartsym not found');
  556. end;
  557. repeat
  558. b:=readentry;
  559. if not (b in [iberror,ibendsyms]) then
  560. inc(symcnt);
  561. case b of
  562. ibunitsym :
  563. readcommonsym('Unit symbol ');
  564. iblabelsym :
  565. readcommonsym('Label symbol ');
  566. ibtypesym :
  567. begin
  568. readcommonsym('Type symbol ');
  569. write(space,' Result Type: ');
  570. readtype;
  571. end;
  572. ibprocsym :
  573. begin
  574. readcommonsym('Procedure symbol ');
  575. write(space,' Definition: ');
  576. readdefref;
  577. end;
  578. ibconstsym :
  579. begin
  580. readcommonsym('Constant symbol ');
  581. b:=getbyte;
  582. case tconsttyp(b) of
  583. constord :
  584. begin
  585. write (space,' Ordinal Type : ');
  586. readtype;
  587. writeln (space,' Value : ',getlongint)
  588. end;
  589. constpointer :
  590. begin
  591. write (space,' Pointer Type : ');
  592. readtype;
  593. writeln (space,' Value : ',getlongint)
  594. end;
  595. conststring,
  596. constresourcestring :
  597. begin
  598. len:=getlongint;
  599. getmem(pc,len+1);
  600. getdata(pc^,len);
  601. writeln(space,' Length : ',len);
  602. writeln(space,' Value : "',pc,'"');
  603. freemem(pc,len+1);
  604. if tconsttyp(b)=constresourcestring then
  605. writeln(space,' Index : ',getlongint);
  606. end;
  607. constreal :
  608. writeln(space,' Value : ',getreal);
  609. constbool :
  610. if getlongint<>0 then
  611. writeln (space,' Value : True')
  612. else
  613. writeln (space,' Value : False');
  614. constint :
  615. writeln(space,' Value : ',getlongint);
  616. constchar :
  617. writeln(space,' Value : "'+chr(getlongint)+'"');
  618. constset :
  619. begin
  620. write (space,' Set Type : ');
  621. readtype;
  622. for i:=1to 4 do
  623. begin
  624. write (space,' Value : ');
  625. for j:=1to 8 do
  626. begin
  627. if j>1 then
  628. write(',');
  629. write(hexb(getbyte));
  630. end;
  631. writeln;
  632. end;
  633. end;
  634. else
  635. Writeln ('!! Invalid unit format : Invalid const type encountered: ',b);
  636. end;
  637. end;
  638. ibvarsym :
  639. begin
  640. readcommonsym('Variable symbol ');
  641. writeln(space,' Type: ',getbyte);
  642. if read_member then
  643. writeln(space,' Address: ',getlongint);
  644. write (space,' Var Type: ');
  645. readtype;
  646. i:=getlongint;
  647. writeln(space,' Options: ',i);
  648. if (i and vo_is_C_var)<>0 then
  649. writeln(space,' Mangledname: ',getstring);
  650. end;
  651. ibenumsym :
  652. begin
  653. readcommonsym('Enumeration symbol ');
  654. write (space,' Definition: ');
  655. readdefref;
  656. writeln(space,' Value: ',getlongint);
  657. end;
  658. ibsyssym :
  659. begin
  660. readcommonsym('Internal system symbol ');
  661. writeln(space,' Internal Nr: ',getlongint);
  662. end;
  663. ibtypedconstsym :
  664. begin
  665. readcommonsym('Typed constant ');
  666. write (space,' Constant Type: ');
  667. readtype;
  668. writeln(space,' Label: ',getstring);
  669. writeln(space,' ReallyConst: ',(getbyte<>0));
  670. end;
  671. ibabsolutesym :
  672. begin
  673. readcommonsym('Absolute variable symbol ');
  674. writeln(space,' Type: ',getbyte);
  675. if read_member then
  676. writeln(space,' Address: ',getlongint);
  677. write (space,' Var Type: ');
  678. readtype;
  679. writeln(space,' Options: ',getlongint);
  680. Write (space,' Relocated to ');
  681. b:=getbyte;
  682. case absolutetyp(b) of
  683. tovar :
  684. Writeln('Name : ',getstring);
  685. toasm :
  686. Writeln('Assembler name : ',getstring);
  687. toaddr :
  688. begin
  689. Write('Address : ',getlongint);
  690. WriteLn(' (Far: ',getbyte<>0,')');
  691. end;
  692. else
  693. Writeln ('!! Invalid unit format : Invalid absolute type encountered: ',b);
  694. end;
  695. end;
  696. ibpropertysym :
  697. begin
  698. readcommonsym('Property ');
  699. write (space,' Prop Type: ');
  700. readtype;
  701. writeln(space,' Options: ',getlongint);
  702. writeln(space,' Index: ',getlongint);
  703. writeln(space,' Default: ',getlongint);
  704. write (space,' Index Type: ');
  705. readtype;
  706. write (space,' Read access: ');
  707. readsymlist(space+' Sym: ');
  708. write (space,' Write access: ');
  709. readsymlist(space+' Sym: ');
  710. write (space,' Stored access: ');
  711. readsymlist(space+' Sym: ');
  712. end;
  713. ibfuncretsym :
  714. begin
  715. readcommonsym('Func return value ');
  716. write (space,' Return Type: ');
  717. readtype;
  718. writeln(space,' Address: ',getlongint);
  719. end;
  720. iberror :
  721. begin
  722. Writeln('!! Error in PPU');
  723. exit;
  724. end;
  725. ibendsyms :
  726. break;
  727. else
  728. WriteLn('!! Skipping unsupported PPU Entry in Symbols: ',b);
  729. end;
  730. if not EndOfEntry then
  731. Writeln('!! Entry has more information stored');
  732. until false;
  733. if (totalsyms<>-1) and (symcnt-1<>totalsyms) then
  734. Writeln('!! Only read ',symcnt-1,' of ',totalsyms,' symbols');
  735. end;
  736. end;
  737. {****************************************************************************
  738. Read defintions Part
  739. ****************************************************************************}
  740. procedure readdefinitions(start_read : boolean);
  741. type
  742. tsettype = (normset,smallset,varset);
  743. tbasetype = (uauto,uvoid,uchar,
  744. u8bit,u16bit,u32bit,
  745. s8bit,s16bit,s32bit,
  746. bool8bit,bool16bit,bool32bit,
  747. u64bit,s64bit);
  748. var
  749. b : byte;
  750. oldread_member : boolean;
  751. totaldefs,
  752. defcnt : longint;
  753. begin
  754. defcnt:=0;
  755. with ppufile^ do
  756. begin
  757. if space<>'' then
  758. Writeln(space,'-----------------------------');
  759. if not start_read then
  760. if readentry=ibstartdefs then
  761. begin
  762. totaldefs:=getlongint;
  763. Writeln(space,'Number of definitions: ',totaldefs);
  764. end
  765. else
  766. begin
  767. totaldefs:=-1;
  768. Writeln('!! ibstartdef not found');
  769. end;
  770. repeat
  771. b:=readentry;
  772. if not (b in [iberror,ibenddefs]) then
  773. inc(defcnt);
  774. case b of
  775. ibpointerdef :
  776. begin
  777. readcommondef('Pointer definition');
  778. write (space,' Pointed Type : ');
  779. readtype;
  780. writeln(space,' Is Far : ',(getbyte<>0));
  781. end;
  782. iborddef :
  783. begin
  784. readcommondef('Ordinal definition');
  785. write (space,' Base type : ');
  786. b:=getbyte;
  787. case tbasetype(b) of
  788. uauto : writeln('uauto');
  789. uvoid : writeln('uvoid');
  790. uchar : writeln('uchar');
  791. u8bit : writeln('u8bit');
  792. u16bit : writeln('u16bit');
  793. u32bit : writeln('s32bit');
  794. s8bit : writeln('s8bit');
  795. s16bit : writeln('s16bit');
  796. s32bit : writeln('s32bit');
  797. bool8bit : writeln('bool8bit');
  798. bool16bit : writeln('bool16bit');
  799. bool32bit : writeln('bool32bit');
  800. u64bit : writeln('u64bit');
  801. s64bit : writeln('s64bit');
  802. else writeln('!! Warning: Invalid base type ',b);
  803. end;
  804. writeln(space,' Range : ',getlongint,' to ',getlongint);
  805. end;
  806. ibfloatdef :
  807. begin
  808. readcommondef('Float definition');
  809. writeln(space,' Float type : ',getbyte);
  810. end;
  811. ibarraydef :
  812. begin
  813. readcommondef('Array definition');
  814. write (space,' Element type : ');
  815. readtype;
  816. write (space,' Range Type : ');
  817. readtype;
  818. writeln(space,' Range : ',getlongint,' to ',getlongint);
  819. writeln(space,' Is Constructor : ',(getbyte<>0));
  820. end;
  821. ibprocdef :
  822. begin
  823. readcommondef('Procedure definition');
  824. read_abstract_proc_def;
  825. writeln(space,' Used Register : ',getbyte);
  826. writeln(space,' Mangled name : ',getstring);
  827. writeln(space,' Number : ',getlongint);
  828. write (space,' Next : ');
  829. readdefref;
  830. write (space,' Class : ');
  831. readdefref;
  832. write (space,' File Pos : ');
  833. readposinfo;
  834. end;
  835. ibprocvardef :
  836. begin
  837. readcommondef('Procedural type (ProcVar) definition');
  838. read_abstract_proc_def;
  839. end;
  840. ibshortstringdef :
  841. begin
  842. readcommondef('ShortString definition');
  843. writeln(space,' Length : ',getbyte);
  844. end;
  845. ibwidestringdef :
  846. begin
  847. readcommondef('WideString definition');
  848. writeln(space,' Length : ',getlongint);
  849. end;
  850. ibansistringdef :
  851. begin
  852. readcommondef('AnsiString definition');
  853. writeln(space,' Length : ',getlongint);
  854. end;
  855. iblongstringdef :
  856. begin
  857. readcommondef('Longstring definition');
  858. writeln(space,' Length : ',getlongint);
  859. end;
  860. ibrecorddef :
  861. begin
  862. readcommondef('Record definition');
  863. writeln(space,' Size : ',getlongint);
  864. {read the record definitions and symbols}
  865. space:=' '+space;
  866. oldread_member:=read_member;
  867. read_member:=true;
  868. readdefinitions(false);
  869. readsymbols;
  870. read_member:=oldread_member;
  871. Delete(space,1,4);
  872. end;
  873. ibobjectdef :
  874. begin
  875. readcommondef('Object/Class definition');
  876. writeln(space,' Size : ',getlongint);
  877. writeln(space,' Vmt offset : ',getlongint);
  878. writeln(space,' Name of Class : ',getstring);
  879. write(space, ' Ancestor Class : ');
  880. readdefref;
  881. writeln(space,' Options : ',getlongint);
  882. {read the record definitions and symbols}
  883. space:=' '+space;
  884. oldread_member:=read_member;
  885. read_member:=true;
  886. readdefinitions(false);
  887. readsymbols;
  888. read_member:=oldread_member;
  889. Delete(space,1,4);
  890. end;
  891. ibfiledef :
  892. begin
  893. ReadCommonDef('File definition');
  894. write (space,' Type : ');
  895. case getbyte of
  896. 0 : writeln('Text');
  897. 1 : begin
  898. writeln('Typed');
  899. write (space,' File of Type : ');
  900. Readtype;
  901. end;
  902. 2 : writeln('Untyped');
  903. end;
  904. end;
  905. ibformaldef :
  906. readcommondef('Generic Definition (void-typ)');
  907. ibenumdef :
  908. begin
  909. readcommondef('Enumeration type definition');
  910. write(space,'Base enumeration type : ');
  911. readdefref;
  912. writeln(space,' Smallest element : ',getlongint);
  913. writeln(space,' Largest element : ',getlongint);
  914. writeln(space,' Size : ',getlongint);
  915. end;
  916. ibclassrefdef :
  917. begin
  918. readcommondef('Class reference definition');
  919. write (space,' Pointed Type : ');
  920. readtype;
  921. end;
  922. ibsetdef :
  923. begin
  924. readcommondef('Set definition');
  925. write (space,' Element type : ');
  926. readtype;
  927. b:=getbyte;
  928. case tsettype(b) of
  929. smallset : writeln(space,' Set with 32 Elements');
  930. normset : writeln(space,' Set with 256 Elements');
  931. varset : writeln(space,' Set with ',getlongint,' Elements');
  932. else writeln('!! Warning: Invalid set type ',b);
  933. end;
  934. end;
  935. iberror :
  936. begin
  937. Writeln('!! Error in PPU');
  938. exit;
  939. end;
  940. ibenddefs :
  941. break;
  942. else
  943. WriteLn('!! Skipping unsupported PPU Entry in definitions: ',b);
  944. end;
  945. if not EndOfEntry then
  946. Writeln('!! Entry has more information stored');
  947. until false;
  948. if (totaldefs<>-1) and (defcnt<>totaldefs) then
  949. Writeln('!! Only read ',defcnt,' of ',totaldefs,' definitions');
  950. end;
  951. end;
  952. {****************************************************************************
  953. Read General Part
  954. ****************************************************************************}
  955. procedure readinterface;
  956. var
  957. b : byte;
  958. sourcenumber,
  959. unitnumber : word;
  960. ucrc,uintfcrc : longint;
  961. begin
  962. with ppufile^ do
  963. begin
  964. repeat
  965. b:=readentry;
  966. case b of
  967. ibmodulename :
  968. Writeln('Module Name: ',getstring);
  969. ibsourcefiles :
  970. begin
  971. sourcenumber:=1;
  972. while not EndOfEntry do
  973. begin
  974. Writeln('Source file ',sourcenumber,' : ',getstring);
  975. inc(sourcenumber);
  976. end;
  977. end;
  978. ibusedmacros :
  979. begin
  980. while not EndOfEntry do
  981. begin
  982. Write('Conditional ',getstring);
  983. b:=getbyte;
  984. if boolean(b)=true then
  985. write(' defined at startup')
  986. else
  987. write(' not defined at startup');
  988. b:=getbyte;
  989. if boolean(b)=true then
  990. writeln(' was used')
  991. else
  992. writeln;
  993. end;
  994. end;
  995. ibloadunit :
  996. begin
  997. unitnumber:=1;
  998. while not EndOfEntry do
  999. begin
  1000. write('Uses unit: ',getstring,' (Number: ',unitnumber,')');
  1001. ucrc:=getlongint;
  1002. uintfcrc:=getlongint;
  1003. write(' (Crc: ',ucrc,', IntfcCrc: ',uintfcrc,')');
  1004. if getbyte<>0 then
  1005. writeln(' (interface)')
  1006. else
  1007. writeln(' (implementation)');
  1008. inc(unitnumber);
  1009. end;
  1010. end;
  1011. iblinkunitofiles :
  1012. ReadLinkContainer('Link unit object file: ');
  1013. iblinkunitstaticlibs :
  1014. ReadLinkContainer('Link unit static lib: ');
  1015. iblinkunitsharedlibs :
  1016. ReadLinkContainer('Link unit shared lib: ');
  1017. iblinkotherofiles :
  1018. ReadLinkContainer('Link other object file: ');
  1019. iblinkotherstaticlibs :
  1020. ReadLinkContainer('Link other static lib: ');
  1021. iblinkothersharedlibs :
  1022. ReadLinkContainer('Link other shared lib: ');
  1023. iberror :
  1024. begin
  1025. Writeln('Error in PPU');
  1026. exit;
  1027. end;
  1028. ibendinterface :
  1029. break;
  1030. else
  1031. WriteLn('!! Skipping unsupported PPU Entry in General Part: ',b);
  1032. end;
  1033. until false;
  1034. end;
  1035. end;
  1036. {****************************************************************************
  1037. Read Implementation Part
  1038. ****************************************************************************}
  1039. procedure readimplementation;
  1040. var
  1041. b : byte;
  1042. begin
  1043. with ppufile^ do
  1044. begin
  1045. repeat
  1046. b:=readentry;
  1047. case b of
  1048. iberror :
  1049. begin
  1050. Writeln('Error in PPU');
  1051. exit;
  1052. end;
  1053. ibendimplementation :
  1054. break;
  1055. else
  1056. WriteLn('!! Skipping unsupported PPU Entry in Implementation: ',b);
  1057. end;
  1058. until false;
  1059. end;
  1060. end;
  1061. {****************************************************************************
  1062. Read Browser Part
  1063. ****************************************************************************}
  1064. procedure readbrowser;
  1065. var
  1066. b : byte;
  1067. const indent : string = '';
  1068. begin
  1069. Writeln(indent,'Start of symtable browser');
  1070. indent:=indent+'**';
  1071. with ppufile^ do
  1072. begin
  1073. repeat
  1074. b:=readentry;
  1075. case b of
  1076. ibbeginsymtablebrowser :
  1077. { here we must read object and record symtables !! }
  1078. begin
  1079. indent:=indent+' ';
  1080. Writeln(indent,'Record/Object symtable');
  1081. readbrowser;
  1082. Indent:=Copy(Indent,1,Length(Indent)-2);
  1083. end;
  1084. ibsymref : begin
  1085. readsymref;
  1086. readref;
  1087. end;
  1088. ibdefref : begin
  1089. readdefref;
  1090. readref;
  1091. if (ppufile^.header.flags and uf_local_browser)<>0 then
  1092. begin
  1093. { parast and localst }
  1094. indent:=indent+' ';
  1095. Writeln(indent,'Parasymtable for function');
  1096. readdefinitions(false);
  1097. readsymbols;
  1098. b:=ppufile^.readentry;
  1099. if b=ibbeginsymtablebrowser then
  1100. readbrowser;
  1101. Writeln(indent,'Localsymtable for function');
  1102. readdefinitions(false);
  1103. readsymbols;
  1104. b:=ppufile^.readentry;
  1105. if b=ibbeginsymtablebrowser then
  1106. readbrowser;
  1107. Indent:=Copy(Indent,1,Length(Indent)-2);
  1108. end;
  1109. end;
  1110. iberror : begin
  1111. Writeln('Error in PPU');
  1112. exit;
  1113. end;
  1114. ibendsymtablebrowser : break;
  1115. else
  1116. begin
  1117. WriteLn('!! Skipping unsupported PPU Entry in Browser: ',b);
  1118. Halt;
  1119. end;
  1120. end;
  1121. until false;
  1122. end;
  1123. Indent:=Copy(Indent,1,Length(Indent)-2);
  1124. Writeln(Indent,'End of symtable browser');
  1125. end;
  1126. procedure dofile (filename : string);
  1127. var
  1128. b,unitindex : byte;
  1129. begin
  1130. { reset }
  1131. space:='';
  1132. { fix filename }
  1133. if pos('.',filename)=0 then
  1134. filename:=filename+'.ppu';
  1135. ppufile:=new(pppufile,Init(filename));
  1136. if not ppufile^.open then
  1137. begin
  1138. writeln ('IO-Error when opening : ',filename,', Skipping');
  1139. exit;
  1140. end;
  1141. { PPU File is open, check for PPU Id }
  1142. if not ppufile^.CheckPPUID then
  1143. begin
  1144. writeln(Filename,' : Not a valid PPU file, Skipping');
  1145. exit;
  1146. end;
  1147. { Check PPU Version }
  1148. Writeln('Analyzing ',filename,' (v',ppufile^.GetPPUVersion,')');
  1149. if ppufile^.GetPPUVersion<16 then
  1150. begin
  1151. writeln(Filename,' : Old PPU Formats (<v16) are not supported, Skipping');
  1152. exit;
  1153. end;
  1154. { Write PPU Header Information }
  1155. if (verbose and v_header)<>0 then
  1156. begin
  1157. Writeln;
  1158. Writeln('Header');
  1159. Writeln('-------');
  1160. with ppufile^.header do
  1161. begin
  1162. Writeln('Compiler version : ',hi(ppufile^.header.compiler and $ff),'.',lo(ppufile^.header.compiler));
  1163. WriteLn('Target processor : ',Cpu2Str(cpu));
  1164. WriteLn('Target operating system : ',Target2Str(target));
  1165. Writeln('Unit flags : ',PPUFlags2Str(flags));
  1166. Writeln('FileSize (w/o header) : ',size);
  1167. Writeln('Checksum : ',checksum);
  1168. Writeln('Interface Checksum : ',interface_checksum);
  1169. end;
  1170. end;
  1171. {read the general stuff}
  1172. if (verbose and v_interface)<>0 then
  1173. begin
  1174. Writeln;
  1175. Writeln('Interface section');
  1176. Writeln('------------------');
  1177. readinterface;
  1178. end
  1179. else
  1180. ppufile^.skipuntilentry(ibendinterface);
  1181. {read the definitions}
  1182. if (verbose and v_defs)<>0 then
  1183. begin
  1184. Writeln;
  1185. Writeln('Interface definitions');
  1186. Writeln('----------------------');
  1187. readdefinitions(false);
  1188. end
  1189. else
  1190. ppufile^.skipuntilentry(ibenddefs);
  1191. {read the symbols}
  1192. if (verbose and v_syms)<>0 then
  1193. begin
  1194. Writeln;
  1195. Writeln('Interface Symbols');
  1196. Writeln('------------------');
  1197. readsymbols;
  1198. end
  1199. else
  1200. ppufile^.skipuntilentry(ibendsyms);
  1201. {read the implementation stuff}
  1202. { Not used at the moment (PFV)
  1203. if (verbose and v_implementation)<>0 then
  1204. begin
  1205. Writeln;
  1206. Writeln('Implementation section');
  1207. Writeln('-----------------------');
  1208. readimplementation;
  1209. end
  1210. else}
  1211. ppufile^.skipuntilentry(ibendimplementation);
  1212. {read the static browser units stuff}
  1213. if (ppufile^.header.flags and uf_local_browser)<>0 then
  1214. begin
  1215. if (verbose and v_defs)<>0 then
  1216. begin
  1217. Writeln;
  1218. Writeln('Static definitions');
  1219. Writeln('----------------------');
  1220. readdefinitions(false);
  1221. end
  1222. else
  1223. ppufile^.skipuntilentry(ibenddefs);
  1224. {read the symbols}
  1225. if (verbose and v_syms)<>0 then
  1226. begin
  1227. Writeln;
  1228. Writeln('Static Symbols');
  1229. Writeln('------------------');
  1230. readsymbols;
  1231. end;
  1232. end;
  1233. {read the browser units stuff}
  1234. if (ppufile^.header.flags and uf_has_browser)<>0 then
  1235. begin
  1236. if (verbose and v_browser)<>0 then
  1237. begin
  1238. Writeln;
  1239. Writeln('Browser section');
  1240. Writeln('---------------');
  1241. UnitIndex:=0;
  1242. repeat
  1243. b:=ppufile^.readentry;
  1244. if b = ibendbrowser then break;
  1245. if b=ibbeginsymtablebrowser then
  1246. begin
  1247. Writeln('Unit ',UnitIndex);
  1248. readbrowser;
  1249. Inc(UnitIndex);
  1250. end
  1251. else
  1252. Writeln('Wrong end browser entry ',b,' should be ',ibendbrowser);
  1253. until false;
  1254. end;
  1255. end;
  1256. {read the static browser units stuff}
  1257. if (ppufile^.header.flags and uf_local_browser)<>0 then
  1258. begin
  1259. if (verbose and v_browser)<>0 then
  1260. begin
  1261. Writeln;
  1262. Writeln('Static browser section');
  1263. Writeln('---------------');
  1264. b:=ppufile^.readentry;
  1265. if b=ibbeginsymtablebrowser then
  1266. begin
  1267. Writeln('Unit ',UnitIndex);
  1268. readbrowser;
  1269. Inc(UnitIndex);
  1270. end
  1271. else
  1272. Writeln('Wrong end browser entry ',b,' should be ',ibendbrowser);
  1273. end;
  1274. end;
  1275. {shutdown ppufile}
  1276. ppufile^.close;
  1277. dispose(ppufile,done);
  1278. Writeln;
  1279. end;
  1280. procedure help;
  1281. begin
  1282. writeln('usage: ppudump [options] <filename1> <filename2>...');
  1283. writeln;
  1284. writeln('[options] can be:');
  1285. writeln(' -V<verbose> Set verbosity to <verbose>');
  1286. writeln(' H - Show header info');
  1287. writeln(' I - Show interface');
  1288. writeln(' M - Show implementation');
  1289. writeln(' S - Show interface symbols');
  1290. writeln(' D - Show interface definitions');
  1291. writeln(' B - Show browser info');
  1292. writeln(' A - Show all');
  1293. writeln(' -? This helpscreen');
  1294. halt;
  1295. end;
  1296. var
  1297. startpara,
  1298. nrfile,i : longint;
  1299. para : string;
  1300. begin
  1301. writeln(Title+' '+Version);
  1302. writeln(Copyright);
  1303. writeln;
  1304. if paramcount<1 then
  1305. begin
  1306. writeln('usage: dumpppu [options] <filename1> <filename2>...');
  1307. halt(1);
  1308. end;
  1309. { turn verbose on by default }
  1310. verbose:=v_all;
  1311. { read options }
  1312. startpara:=1;
  1313. while copy(paramstr(startpara),1,1)='-' do
  1314. begin
  1315. para:=paramstr(startpara);
  1316. case upcase(para[2]) of
  1317. 'V' : begin
  1318. verbose:=0;
  1319. for i:=3to length(para) do
  1320. case upcase(para[i]) of
  1321. 'H' : verbose:=verbose or v_header;
  1322. 'I' : verbose:=verbose or v_interface;
  1323. 'M' : verbose:=verbose or v_implementation;
  1324. 'D' : verbose:=verbose or v_defs;
  1325. 'S' : verbose:=verbose or v_syms;
  1326. 'B' : verbose:=verbose or v_browser;
  1327. 'A' : verbose:=verbose or v_all;
  1328. end;
  1329. end;
  1330. '?' : help;
  1331. end;
  1332. inc(startpara);
  1333. end;
  1334. { process files }
  1335. for nrfile:=startpara to paramcount do
  1336. dofile (paramstr(nrfile));
  1337. if has_errors then
  1338. Halt(1);
  1339. end.
  1340. {
  1341. $Log$
  1342. Revision 1.13 2000-01-23 16:34:36 peter
  1343. * updated for new aktlocalindex
  1344. Revision 1.12 2000/01/07 16:46:03 daniel
  1345. * copyright 2000
  1346. Revision 1.11 1999/11/30 10:35:37 peter
  1347. * support new readtype
  1348. Revision 1.10 1999/11/08 14:06:45 florian
  1349. + indexref of propertysym is handle too now
  1350. Revision 1.9 1999/08/31 16:07:37 pierre
  1351. + support for writeusedmacros
  1352. Revision 1.8 1999/08/15 10:47:14 peter
  1353. * updates for new options
  1354. Revision 1.7 1999/08/13 21:25:35 peter
  1355. * updated flags
  1356. Revision 1.6 1999/07/27 23:45:29 peter
  1357. * updated for typesym writing
  1358. Revision 1.5 1999/07/05 12:32:40 florian
  1359. * new property ppu writing implemented
  1360. Revision 1.4 1999/07/03 00:25:44 peter
  1361. * 0.99.13
  1362. * new link support
  1363. Revision 1.3 1999/06/08 22:16:06 peter
  1364. * version 0.99.12
  1365. Revision 1.2 1999/05/14 17:52:04 peter
  1366. * new deref
  1367. Revision 1.1 1999/05/12 16:11:39 peter
  1368. * moved
  1369. Revision 1.31 1999/04/29 17:22:34 peter
  1370. * fixed property sym
  1371. Revision 1.30 1999/04/26 18:27:39 peter
  1372. * more updates
  1373. Revision 1.29 1999/04/26 13:30:44 peter
  1374. * support new unit format
  1375. Revision 1.28 1999/04/26 09:35:04 peter
  1376. * support for v16
  1377. Revision 1.27 1999/03/16 21:00:03 peter
  1378. * fixed varsym
  1379. Revision 1.26 1999/03/02 22:54:54 peter
  1380. * merged some of my code back which was changed after pierres commit
  1381. Revision 1.25 1999/03/02 14:21:44 pierre
  1382. * adapted to symtable changes mainly local browser
  1383. Revision 1.24 1999/03/02 13:48:16 peter
  1384. * better procoptions display and easy maintainance
  1385. * removed implementation section printing, becuase it's not used
  1386. * linkunitfiles support
  1387. Revision 1.23 1999/02/22 13:22:00 pierre
  1388. + static browser reading
  1389. Revision 1.22 1999/02/16 00:48:42 peter
  1390. * updated for new flags
  1391. Revision 1.21 1998/11/28 16:21:02 peter
  1392. + support for dll variables
  1393. Revision 1.20 1998/11/12 11:36:43 peter
  1394. * fixed target name
  1395. Revision 1.19 1998/11/04 10:17:42 peter
  1396. + const,var,value is written for parameters
  1397. Revision 1.18 1998/10/13 13:06:14 peter
  1398. * updated for new target enum
  1399. Revision 1.17 1998/09/25 09:51:53 peter
  1400. + symtable size and # of symbols
  1401. Revision 1.16 1998/09/24 23:24:11 peter
  1402. * small update to support ibstartdef
  1403. Revision 1.12 1998/09/21 08:45:28 pierre
  1404. + added vmt_offset in tobjectdef.write for fututre use
  1405. (first steps to have objects without vmt if no virtual !!)
  1406. + added fpu_used field for tabstractprocdef :
  1407. sets this level to 2 if the functions return with value in FPU
  1408. (is then set to correct value at parsing of implementation)
  1409. THIS MIGHT refuse some code with FPU expression too complex
  1410. that were accepted before and even in some cases
  1411. that don't overflow in fact
  1412. ( like if f : float; is a forward that finally in implementation
  1413. only uses one fpu register !!)
  1414. Nevertheless I think that it will improve security on
  1415. FPU operations !!
  1416. * most other changes only for UseBrowser code
  1417. (added symtable references for record and objects)
  1418. local switch for refs to args and local of each function
  1419. (static symtable still missing)
  1420. UseBrowser still not stable and probably broken by
  1421. the definition hash array !!
  1422. Revision 1.11 1998/09/18 08:01:42 pierre
  1423. + improvement on the usebrowser part
  1424. (does not work correctly for now)
  1425. Revision 1.10 1998/09/01 17:35:33 peter
  1426. * update for new po's
  1427. Revision 1.9 1998/09/01 12:46:52 peter
  1428. + enum savesize
  1429. Revision 1.8 1998/08/26 10:01:18 peter
  1430. + set support
  1431. Revision 1.7 1998/08/20 13:01:41 peter
  1432. + object_options, new enumdef
  1433. Revision 1.6 1998/08/17 10:26:28 peter
  1434. * updated for new shared/static style
  1435. Revision 1.5 1998/08/13 10:56:28 peter
  1436. * check if a whole entry is read
  1437. + support for constset
  1438. Revision 1.4 1998/08/11 15:31:44 peter
  1439. * write extended to ppu file
  1440. * new version 0.99.7
  1441. Revision 1.3 1998/07/10 10:59:17 peter
  1442. + m68k target support
  1443. Revision 1.2 1998/06/17 13:58:28 peter
  1444. + symbol/def nrs are now listed
  1445. Revision 1.1 1998/06/13 00:05:01 peter
  1446. + new util to dump v15+ ppu
  1447. }