ppudump.pp 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 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. dos,
  23. ppu;
  24. const
  25. Version = 'Version 1.10';
  26. Title = 'PPU-Analyser';
  27. Copyright = 'Copyright (c) 1998-2003 by the Free Pascal Development Team';
  28. { verbosity }
  29. v_none = $0;
  30. v_header = $1;
  31. v_defs = $2;
  32. v_syms = $4;
  33. v_interface = $8;
  34. v_implementation = $10;
  35. v_browser = $20;
  36. v_all = $ff;
  37. type
  38. { Copied from systems.pas }
  39. ttargetcpu=
  40. (
  41. no_cpu, { 0 }
  42. i386, { 1 }
  43. m68k, { 2 }
  44. alpha, { 3 }
  45. powerpc, { 4 }
  46. sparc, { 5 }
  47. vm { 6 }
  48. );
  49. var
  50. ppufile : tppufile;
  51. space : string;
  52. unitnumber,
  53. unitindex : longint;
  54. verbose : longint;
  55. derefdata : pbyte;
  56. derefdatalen : longint;
  57. {****************************************************************************
  58. Helper Routines
  59. ****************************************************************************}
  60. const has_errors : boolean = false;
  61. Procedure Error(const S : string);
  62. Begin
  63. Writeln(S);
  64. has_errors:=true;
  65. End;
  66. Function Target2Str(w:longint):string;
  67. type
  68. { taken from systems.pas }
  69. ttarget =
  70. (
  71. target_none, { 0 }
  72. target_i386_GO32V1, { 1 }
  73. target_i386_GO32V2, { 2 }
  74. target_i386_linux, { 3 }
  75. target_i386_OS2, { 4 }
  76. target_i386_Win32, { 5 }
  77. target_i386_freebsd, { 6 }
  78. target_m68k_Amiga, { 7 }
  79. target_m68k_Atari, { 8 }
  80. target_m68k_Mac, { 9 }
  81. target_m68k_linux, { 10 }
  82. target_m68k_PalmOS, { 11 }
  83. target_alpha_linux, { 12 }
  84. target_powerpc_linux, { 13 }
  85. target_powerpc_macos, { 14 }
  86. target_i386_sunos, { 15 }
  87. target_i386_beos, { 16 }
  88. target_i386_netbsd, { 17 }
  89. target_m68k_netbsd, { 18 }
  90. target_i386_Netware, { 19 }
  91. target_i386_qnx, { 20 }
  92. target_i386_wdosx, { 21 }
  93. target_sparc_sunos, { 22 }
  94. target_sparc_linux, { 23 }
  95. target_i386_openbsd, { 24 }
  96. target_m68k_openbsd, { 25 }
  97. system_x86_64_linux, { 26 }
  98. system_powerpc_macosx, { 27 }
  99. target_i386_emx { 28 }
  100. );
  101. const
  102. Targets : array[ttarget] of string[16]=(
  103. { 0 } 'none',
  104. { 1 } 'GO32V1',
  105. { 2 } 'GO32V2',
  106. { 3 } 'Linux-i386',
  107. { 4 } 'OS/2',
  108. { 5 } 'Win32',
  109. { 6 } 'FreeBSD-i386',
  110. { 7 } 'Amiga',
  111. { 8 } 'Atari',
  112. { 9 } 'MacOS-m68k',
  113. { 10 } 'Linux-m68k',
  114. { 11 } 'PalmOS-m68k',
  115. { 12 } 'Linux-alpha',
  116. { 13 } 'Linux-ppc',
  117. { 14 } 'MacOS-ppc',
  118. { 15 } 'Solaris-i386',
  119. { 16 } 'BeOS-i386',
  120. { 17 } 'NetBSD-i386',
  121. { 18 } 'NetBSD-m68k',
  122. { 19 } 'Netware',
  123. { 20 } 'Qnx-i386',
  124. { 21 } 'WDOSX-i386',
  125. { 22 } 'Solaris-sparc',
  126. { 23 } 'Linux-sparc',
  127. { 24 } 'OpenBSD-i386',
  128. { 25 } 'OpenBSD-m68k',
  129. { 26 } 'Linux-x86-64',
  130. { 27 } 'MacOSX-ppc',
  131. { 28 } 'OS/2 via EMX'
  132. );
  133. begin
  134. if w<=ord(high(ttarget)) then
  135. Target2Str:=Targets[ttarget(w)]
  136. else
  137. Target2Str:='<Unknown>';
  138. end;
  139. Function Cpu2Str(w:longint):string;
  140. const
  141. CpuTxt : array[ttargetcpu] of string[7]=
  142. ('none','i386','m68k','alpha','powerpc','sparc','vis');
  143. begin
  144. if w<=ord(high(ttargetcpu)) then
  145. Cpu2Str:=CpuTxt[ttargetcpu(w)]
  146. else
  147. Cpu2Str:='<Unknown>';
  148. end;
  149. Function Varspez2Str(w:longint):string;
  150. const
  151. varspezstr : array[0..4] of string[6]=('Value','Const','Var','Out','Hidden');
  152. begin
  153. if w<=ord(high(varspezstr)) then
  154. Varspez2Str:=varspezstr[w]
  155. else
  156. Varspez2Str:='<Unknown>';
  157. end;
  158. function PPUFlags2Str(flags:longint):string;
  159. type
  160. tflagopt=record
  161. mask : longint;
  162. str : string[30];
  163. end;
  164. const
  165. flagopts=16;
  166. flagopt : array[1..flagopts] of tflagopt=(
  167. (mask: $1 ;str:'init'),
  168. (mask: $2 ;str:'final'),
  169. (mask: $4 ;str:'big_endian'),
  170. (mask: $8 ;str:'dbx'),
  171. (mask: $10 ;str:'browser'),
  172. (mask: $20 ;str:'in_library'),
  173. (mask: $40 ;str:'smart_linked'),
  174. (mask: $80 ;str:'static_linked'),
  175. (mask: $100 ;str:'shared_linked'),
  176. (mask: $200 ;str:'local_browser'),
  177. (mask: $400 ;str:'no_link'),
  178. (mask: $800 ;str:'has_resources'),
  179. (mask: $1000 ;str:'little_endian'),
  180. (mask: $2000 ;str:'release'),
  181. (mask: $4000 ;str:'local_threadvars'),
  182. (mask: $8000 ;str:'fpu emulation on')
  183. );
  184. var
  185. i : longint;
  186. first : boolean;
  187. s : string;
  188. begin
  189. s:='';
  190. if flags<>0 then
  191. begin
  192. first:=true;
  193. for i:=1to flagopts do
  194. if (flags and flagopt[i].mask)<>0 then
  195. begin
  196. if first then
  197. first:=false
  198. else
  199. s:=s+', ';
  200. s:=s+flagopt[i].str;
  201. end;
  202. end
  203. else
  204. s:='none';
  205. PPUFlags2Str:=s;
  206. end;
  207. const
  208. HexTbl : array[0..15] of char='0123456789ABCDEF';
  209. function HexB(b:byte):string;
  210. begin
  211. HexB[0]:=#2;
  212. HexB[1]:=HexTbl[b shr 4];
  213. HexB[2]:=HexTbl[b and $f];
  214. end;
  215. function hexstr(val : cardinal;cnt : byte) : string;
  216. const
  217. HexTbl : array[0..15] of char='0123456789ABCDEF';
  218. var
  219. i : longint;
  220. begin
  221. hexstr[0]:=char(cnt);
  222. for i:=cnt downto 1 do
  223. begin
  224. hexstr[i]:=hextbl[val and $f];
  225. val:=val shr 4;
  226. end;
  227. end;
  228. Function L0(l:longint):string;
  229. {
  230. return the string of value l, if l<10 then insert a zero, so
  231. the string is always at least 2 chars '01','02',etc
  232. }
  233. var
  234. s : string;
  235. begin
  236. Str(l,s);
  237. if l<10 then
  238. s:='0'+s;
  239. L0:=s;
  240. end;
  241. function filetimestring( t : longint) : string;
  242. {
  243. convert dos datetime t to a string YY/MM/DD HH:MM:SS
  244. }
  245. var
  246. DT : DateTime;
  247. begin
  248. if t=-1 then
  249. begin
  250. FileTimeString:='Not Found';
  251. exit;
  252. end;
  253. unpacktime(t,DT);
  254. filetimestring:=L0(dt.Year)+'/'+L0(dt.Month)+'/'+L0(dt.Day)+' '+L0(dt.Hour)+':'+L0(dt.min)+':'+L0(dt.sec);
  255. end;
  256. {****************************************************************************
  257. Read Routines
  258. ****************************************************************************}
  259. function getint64:int64;
  260. var
  261. l1,l2 : longint;
  262. begin
  263. l1:=ppufile.getlongint;
  264. l2:=ppufile.getlongint;
  265. getint64:=(int64(l2) shl 32) or qword(l1);
  266. end;
  267. Procedure ReadLinkContainer(const prefix:string);
  268. {
  269. Read a serie of strings and write to the screen starting every line
  270. with prefix
  271. }
  272. function maskstr(m:longint):string;
  273. const
  274. { link options }
  275. link_none = $0;
  276. link_allways = $1;
  277. link_static = $2;
  278. link_smart = $4;
  279. link_shared = $8;
  280. var
  281. s : string;
  282. begin
  283. s:='';
  284. if (m and link_allways)<>0 then
  285. s:=s+'always ';
  286. if (m and link_static)<>0 then
  287. s:=s+'static ';
  288. if (m and link_smart)<>0 then
  289. s:=s+'smart ';
  290. if (m and link_shared)<>0 then
  291. s:=s+'shared ';
  292. maskstr:=s;
  293. end;
  294. var
  295. s : string;
  296. m : longint;
  297. begin
  298. while not ppufile.endofentry do
  299. begin
  300. s:=ppufile.getstring;
  301. m:=ppufile.getlongint;
  302. WriteLn(prefix,s,' (',maskstr(m),')');
  303. end;
  304. end;
  305. Procedure ReadContainer(const prefix:string);
  306. {
  307. Read a serie of strings and write to the screen starting every line
  308. with prefix
  309. }
  310. begin
  311. while not ppufile.endofentry do
  312. WriteLn(prefix,ppufile.getstring);
  313. end;
  314. procedure ReadLoadUnit;
  315. var
  316. ucrc,uintfcrc : longint;
  317. begin
  318. while not ppufile.EndOfEntry do
  319. begin
  320. inc(unitnumber);
  321. write('Uses unit: ',ppufile.getstring,' (Number: ',unitnumber,')');
  322. ucrc:=ppufile.getlongint;
  323. uintfcrc:=ppufile.getlongint;
  324. write(' (Crc: ',hexstr(ucrc,8),', IntfcCrc: ',hexstr(uintfcrc,8),')');
  325. end;
  326. end;
  327. Procedure ReadDerefdata;
  328. begin
  329. derefdatalen:=ppufile.entrysize;
  330. if derefdatalen=0 then
  331. begin
  332. writeln('!! Error: derefdatalen=0');
  333. exit;
  334. end;
  335. Writeln('Derefdata length: ',derefdatalen);
  336. derefdata:=allocmem(derefdatalen);
  337. ppufile.getdata(derefdata^,derefdatalen);
  338. end;
  339. Procedure ReadRef;
  340. begin
  341. if (verbose and v_browser)=0 then
  342. exit;
  343. while (not ppufile.endofentry) and (not ppufile.error) do
  344. Writeln(space,' - Refered : ',ppufile.getword,', (',ppufile.getlongint,',',ppufile.getword,')');
  345. end;
  346. Procedure ReadAsmSymbols;
  347. type
  348. { Copied from aasmbase.pas }
  349. TAsmsymbind=(AB_NONE,AB_EXTERNAL,AB_COMMON,AB_LOCAL,AB_GLOBAL);
  350. TAsmsymtype=(AT_NONE,AT_FUNCTION,AT_DATA,AT_SECTION);
  351. var
  352. s,
  353. bindstr,
  354. typestr : string;
  355. i : longint;
  356. begin
  357. writeln(space,'Number of AsmSymbols: ',ppufile.getlongint);
  358. i:=0;
  359. while (not ppufile.endofentry) and (not ppufile.error) do
  360. begin
  361. s:=ppufile.getstring;
  362. case tasmsymbind(ppufile.getbyte) of
  363. AB_EXTERNAL :
  364. bindstr:='External';
  365. AB_COMMON :
  366. bindstr:='Common';
  367. AB_LOCAL :
  368. bindstr:='Local';
  369. AB_GLOBAL :
  370. bindstr:='Global';
  371. else
  372. bindstr:='<Error !!>'
  373. end;
  374. case tasmsymtype(ppufile.getbyte) of
  375. AT_FUNCTION :
  376. typestr:='Function';
  377. AT_DATA :
  378. typestr:='Data';
  379. AT_SECTION :
  380. typestr:='Section';
  381. else
  382. typestr:='<Error !!>'
  383. end;
  384. Writeln(space,' ',i,' : ',s,' [',bindstr,',',typestr,']');
  385. inc(i);
  386. end;
  387. end;
  388. Procedure ReadPosInfo;
  389. var
  390. info : byte;
  391. fileindex,line,column : longint;
  392. begin
  393. with ppufile do
  394. begin
  395. {
  396. info byte layout in bits:
  397. 0-1 - amount of bytes for fileindex
  398. 2-3 - amount of bytes for line
  399. 4-5 - amount of bytes for column
  400. }
  401. info:=getbyte;
  402. case (info and $03) of
  403. 0 : fileindex:=getbyte;
  404. 1 : fileindex:=getword;
  405. 2 : fileindex:=(getbyte shl 16) or getword;
  406. 3 : fileindex:=getlongint;
  407. end;
  408. case ((info shr 2) and $03) of
  409. 0 : line:=getbyte;
  410. 1 : line:=getword;
  411. 2 : line:=(getbyte shl 16) or getword;
  412. 3 : line:=getlongint;
  413. end;
  414. case ((info shr 4) and $03) of
  415. 0 : column:=getbyte;
  416. 1 : column:=getword;
  417. 2 : column:=(getbyte shl 16) or getword;
  418. 3 : column:=getlongint;
  419. end;
  420. Writeln(fileindex,' (',line,',',column,')');
  421. end;
  422. end;
  423. procedure readderef;
  424. type
  425. tdereftype = (deref_nil,
  426. deref_sym,
  427. deref_def,
  428. deref_aktrecord,
  429. deref_aktstatic,
  430. deref_aktglobal,
  431. deref_aktlocal,
  432. deref_aktpara,
  433. deref_unit,
  434. deref_record,
  435. deref_local,
  436. deref_para,
  437. deref_parent_object
  438. );
  439. var
  440. b : tdereftype;
  441. first : boolean;
  442. idx : word;
  443. i,n : byte;
  444. pdata : pbyte;
  445. begin
  446. if not assigned(derefdata) then
  447. exit;
  448. first:=true;
  449. idx:=ppufile.getlongint;
  450. if (idx>derefdatalen) then
  451. begin
  452. writeln('!! Error: Deref idx ',idx,' > ',derefdatalen);
  453. exit;
  454. end;
  455. write('(',idx,') ');
  456. pdata:=@derefdata[idx];
  457. i:=0;
  458. n:=pdata[i];
  459. inc(i);
  460. if n<1 then
  461. begin
  462. writeln('!! Error: Deref len < 1');
  463. exit;
  464. end;
  465. while (i<n) do
  466. begin
  467. if not first then
  468. write(', ')
  469. else
  470. first:=false;
  471. b:=tdereftype(pdata[i]);
  472. inc(i);
  473. case b of
  474. deref_nil :
  475. write('Nil');
  476. deref_def :
  477. begin
  478. idx:=pdata[i] shl 8;
  479. idx:=idx or pdata[i+1];
  480. inc(i,2);
  481. write('Definition ',idx);
  482. end;
  483. deref_sym :
  484. begin
  485. idx:=pdata[i] shl 8;
  486. idx:=idx or pdata[i+1];
  487. inc(i,2);
  488. write('Symbol ',idx);
  489. end;
  490. deref_aktrecord :
  491. write('AktRecord');
  492. deref_aktstatic :
  493. write('AktStatic');
  494. deref_aktglobal :
  495. write('AktGlobal');
  496. deref_aktlocal :
  497. write('AktLocal');
  498. deref_aktpara :
  499. write('AktPara');
  500. deref_unit :
  501. begin
  502. idx:=pdata[i] shl 8;
  503. idx:=idx or pdata[i+1];
  504. inc(i,2);
  505. write('Unit ',idx);
  506. end;
  507. deref_record :
  508. write('RecordDef');
  509. deref_para :
  510. write('Parameter of procdef');
  511. deref_local :
  512. write('Local of procdef');
  513. deref_parent_object :
  514. write('Parent object');
  515. else
  516. begin
  517. writeln('!! unsupported dereftyp: ',ord(b));
  518. break;
  519. end;
  520. end;
  521. end;
  522. writeln;
  523. end;
  524. procedure readtype;
  525. begin
  526. readderef;
  527. end;
  528. procedure readsymlist(const s:string);
  529. type
  530. tsltype = (sl_none,
  531. sl_load,
  532. sl_call,
  533. sl_subscript,
  534. sl_vec
  535. );
  536. const
  537. slstr : array[tsltype] of string[9] = ('',
  538. 'load',
  539. 'call',
  540. 'subscript',
  541. 'vec'
  542. );
  543. var
  544. sl : tsltype;
  545. begin
  546. readderef;
  547. repeat
  548. sl:=tsltype(ppufile.getbyte);
  549. if sl=sl_none then
  550. break;
  551. write(s,'(',slstr[sl],') ');
  552. case sl of
  553. sl_call,
  554. sl_load,
  555. sl_subscript :
  556. readderef;
  557. sl_vec :
  558. writeln(ppufile.getlongint);
  559. end;
  560. until false;
  561. end;
  562. procedure readsymoptions;
  563. type
  564. tsymoption=(sp_none,
  565. sp_public,
  566. sp_private,
  567. sp_published,
  568. sp_protected,
  569. sp_forwarddef,
  570. sp_static,
  571. sp_primary_typesym { this is for typesym, to know who is the primary symbol of a def }
  572. );
  573. tsymoptions=set of tsymoption;
  574. tsymopt=record
  575. mask : tsymoption;
  576. str : string[30];
  577. end;
  578. const
  579. symopts=7;
  580. symopt : array[1..symopts] of tsymopt=(
  581. (mask:sp_public; str:'Public'),
  582. (mask:sp_private; str:'Private'),
  583. (mask:sp_published; str:'Published'),
  584. (mask:sp_protected; str:'Protected'),
  585. (mask:sp_forwarddef; str:'ForwardDef'),
  586. (mask:sp_static; str:'Static'),
  587. (mask:sp_primary_typesym;str:'PrimaryTypeSym')
  588. );
  589. var
  590. symoptions : tsymoptions;
  591. i : longint;
  592. first : boolean;
  593. begin
  594. ppufile.getsmallset(symoptions);
  595. if symoptions<>[] then
  596. begin
  597. first:=true;
  598. for i:=1to symopts do
  599. if (symopt[i].mask in symoptions) then
  600. begin
  601. if first then
  602. first:=false
  603. else
  604. write(', ');
  605. write(symopt[i].str);
  606. end;
  607. end;
  608. writeln;
  609. end;
  610. { Read abstract procdef and return if inline procdef }
  611. type
  612. tproccalloption=(pocall_none,
  613. pocall_cdecl, { procedure uses C styled calling }
  614. pocall_cppdecl, { C++ calling conventions }
  615. pocall_compilerproc, { Procedure is used for internal compiler calls }
  616. pocall_far16, { Far16 for OS/2 }
  617. pocall_fpccall, { FPC default calling }
  618. pocall_inline, { Procedure is an assembler macro }
  619. pocall_internproc, { Procedure has compiler magic}
  620. pocall_palmossyscall, { procedure is a PalmOS system call }
  621. pocall_pascal, { pascal standard left to right }
  622. pocall_register, { procedure uses register (fastcall) calling }
  623. pocall_safecall, { safe call calling conventions }
  624. pocall_stdcall, { procedure uses stdcall call }
  625. pocall_system { system call }
  626. );
  627. tproccalloptions=set of tproccalloption;
  628. tproctypeoption=(potype_none,
  629. potype_proginit, { Program initialization }
  630. potype_unitinit, { unit initialization }
  631. potype_unitfinalize, { unit finalization }
  632. potype_constructor, { Procedure is a constructor }
  633. potype_destructor, { Procedure is a destructor }
  634. potype_operator { Procedure defines an operator }
  635. );
  636. tproctypeoptions=set of tproctypeoption;
  637. tprocoption=(po_none,
  638. po_classmethod, { class method }
  639. po_virtualmethod, { Procedure is a virtual method }
  640. po_abstractmethod, { Procedure is an abstract method }
  641. po_staticmethod, { static method }
  642. po_overridingmethod, { method with override directive }
  643. po_methodpointer, { method pointer, only in procvardef, also used for 'with object do' }
  644. po_interrupt, { Procedure is an interrupt handler }
  645. po_iocheck, { IO checking should be done after a call to the procedure }
  646. po_assembler, { Procedure is written in assembler }
  647. po_msgstr, { method for string message handling }
  648. po_msgint, { method for int message handling }
  649. po_exports, { Procedure has export directive (needed for OS/2) }
  650. po_external, { Procedure is external (in other object or lib)}
  651. po_savestdregs, { save std regs cdecl and stdcall need that ! }
  652. po_saveregisters, { save all registers }
  653. po_overload, { procedure is declared with overload directive }
  654. po_varargs, { printf like arguments }
  655. po_leftright, { push arguments from left to right }
  656. po_clearstack, { caller clears the stack }
  657. po_internconst, { procedure has constant evaluator intern }
  658. po_addressonly, { flag that only the address of a method is returned and not a full methodpointer }
  659. po_public { procedure is exported }
  660. );
  661. tprocoptions=set of tprocoption;
  662. function read_abstract_proc_def:tproccalloption;
  663. type
  664. tproccallopt=record
  665. mask : tproccalloption;
  666. str : string[30];
  667. end;
  668. tproctypeopt=record
  669. mask : tproctypeoption;
  670. str : string[30];
  671. end;
  672. tprocopt=record
  673. mask : tprocoption;
  674. str : string[30];
  675. end;
  676. const
  677. proccalloptionStr : array[tproccalloption] of string[14]=('',
  678. 'CDecl',
  679. 'CPPDecl',
  680. 'CompilerProc',
  681. 'Far16',
  682. 'FPCCall',
  683. 'Inline',
  684. 'InternProc',
  685. 'PalmOSSysCall',
  686. 'Pascal',
  687. 'Register',
  688. 'SafeCall',
  689. 'StdCall',
  690. 'System'
  691. );
  692. proctypeopts=6;
  693. proctypeopt : array[1..proctypeopts] of tproctypeopt=(
  694. (mask:potype_proginit; str:'ProgInit'),
  695. (mask:potype_unitinit; str:'UnitInit'),
  696. (mask:potype_unitfinalize;str:'UnitFinalize'),
  697. (mask:potype_constructor; str:'Constructor'),
  698. (mask:potype_destructor; str:'Destructor'),
  699. (mask:potype_operator; str:'Operator')
  700. );
  701. procopts=22;
  702. procopt : array[1..procopts] of tprocopt=(
  703. (mask:po_classmethod; str:'ClassMethod'),
  704. (mask:po_virtualmethod; str:'VirtualMethod'),
  705. (mask:po_abstractmethod; str:'AbstractMethod'),
  706. (mask:po_staticmethod; str:'StaticMethod'),
  707. (mask:po_overridingmethod;str:'OverridingMethod'),
  708. (mask:po_methodpointer; str:'MethodPointer'),
  709. (mask:po_interrupt; str:'Interrupt'),
  710. (mask:po_iocheck; str:'IOCheck'),
  711. (mask:po_assembler; str:'Assembler'),
  712. (mask:po_msgstr; str:'MsgStr'),
  713. (mask:po_msgint; str:'MsgInt'),
  714. (mask:po_exports; str:'Exports'),
  715. (mask:po_external; str:'External'),
  716. (mask:po_savestdregs; str:'SaveStdRegs'),
  717. (mask:po_saveregisters; str:'SaveRegisters'),
  718. (mask:po_overload; str:'Overload'),
  719. (mask:po_varargs; str:'VarArgs'),
  720. (mask:po_leftright; str:'LeftRight'),
  721. (mask:po_clearstack; str:'ClearStack'),
  722. (mask:po_internconst; str:'InternConst'),
  723. (mask:po_addressonly; str:'AddressOnly'),
  724. (mask:po_public; str:'Public')
  725. );
  726. var
  727. proctypeoption : tproctypeoption;
  728. proccalloption : tproccalloption;
  729. procoptions : tprocoptions;
  730. i,params : longint;
  731. first : boolean;
  732. begin
  733. write(space,' Return type : ');
  734. readtype;
  735. writeln(space,' Fpu used : ',ppufile.getbyte);
  736. proctypeoption:=tproctypeoption(ppufile.getbyte);
  737. if proctypeoption<>potype_none then
  738. begin
  739. write(space,' TypeOption : ');
  740. first:=true;
  741. for i:=1 to proctypeopts do
  742. if (proctypeopt[i].mask=proctypeoption) then
  743. begin
  744. if first then
  745. first:=false
  746. else
  747. write(', ');
  748. write(proctypeopt[i].str);
  749. end;
  750. writeln;
  751. end;
  752. proccalloption:=tproccalloption(ppufile.getbyte);
  753. read_abstract_proc_def:=proccalloption;
  754. writeln(space,' CallOption : ',proccalloptionStr[proccalloption]);
  755. ppufile.getsmallset(procoptions);
  756. if procoptions<>[] then
  757. begin
  758. write(space,' Options : ');
  759. first:=true;
  760. for i:=1to procopts do
  761. if (procopt[i].mask in procoptions) then
  762. begin
  763. if first then
  764. first:=false
  765. else
  766. write(', ');
  767. write(procopt[i].str);
  768. end;
  769. writeln;
  770. end;
  771. params:=ppufile.getbyte;
  772. writeln(space,' Nr of parameters : ',params);
  773. for i:=1 to params do
  774. begin
  775. writeln(space,' - Parameter ',i);
  776. writeln(space,' Spez : ',Varspez2Str(ppufile.getbyte));
  777. write (space,' Type : ');
  778. readtype;
  779. write (space,' Default : ');
  780. readderef;
  781. write (space,' Symbol : ');
  782. readderef;
  783. writeln(space,' Is Hidden : ',(ppufile.getbyte<>0));
  784. end;
  785. end;
  786. procedure readcommonsym(const s:string);
  787. begin
  788. writeln(space,'** Symbol Nr. ',ppufile.getword,' **');
  789. writeln(space,s,ppufile.getstring);
  790. write(space,' File Pos: ');
  791. readposinfo;
  792. write(space,' SymOptions: ');
  793. readsymoptions;
  794. end;
  795. procedure readcommondef(const s:string);
  796. type
  797. tdefoption=(df_none,
  798. df_has_inittable, { init data has been generated }
  799. df_has_rttitable, { rtti data has been generated }
  800. df_unique
  801. );
  802. tdefoptions=set of tdefoption;
  803. var
  804. defopts : tdefoptions;
  805. begin
  806. writeln(space,'** Definition Nr. ',ppufile.getword,' **');
  807. writeln(space,s);
  808. write (space,' Type symbol : ');
  809. readderef;
  810. ppufile.getsmallset(defopts);
  811. if df_unique in defopts then
  812. writeln (space,' Unique type symbol');
  813. if df_has_rttitable in defopts then
  814. begin
  815. write (space,' RTTI symbol : ');
  816. readderef;
  817. end;
  818. if df_has_inittable in defopts then
  819. begin
  820. write (space,' Init symbol : ');
  821. readderef;
  822. end;
  823. end;
  824. procedure readnodetree;
  825. var
  826. l : longint;
  827. p : pointer;
  828. begin
  829. with ppufile do
  830. begin
  831. if space<>'' then
  832. Writeln(space,'------ nodetree ------');
  833. if readentry=ibnodetree then
  834. begin
  835. l:=entrysize;
  836. Writeln(space,'Tree size : ',l);
  837. { Read data to prevent error that entry is not completly read }
  838. getmem(p,l);
  839. getdata(p^,l);
  840. freemem(p);
  841. end
  842. else
  843. begin
  844. Writeln('!! ibnodetree not found');
  845. end;
  846. end;
  847. end;
  848. {****************************************************************************
  849. Read Symbols Part
  850. ****************************************************************************}
  851. procedure readsymbols(const s:string);
  852. type
  853. { options for variables }
  854. tvaroption=(vo_none,
  855. vo_regable,
  856. vo_is_C_var,
  857. vo_is_external,
  858. vo_is_dll_var,
  859. vo_is_thread_var,
  860. vo_fpuregable,
  861. vo_is_local_copy,
  862. vo_is_const, { variable is declared as const (parameter) and can't be written to }
  863. vo_is_exported,
  864. vo_is_high_value
  865. );
  866. tvaroptions=set of tvaroption;
  867. pguid = ^tguid;
  868. tguid = packed record
  869. D1: LongWord;
  870. D2: Word;
  871. D3: Word;
  872. D4: array[0..7] of Byte;
  873. end;
  874. absolutetyp = (tovar,toasm,toaddr);
  875. tconsttyp = (constnone,
  876. constord,conststring,constreal,constbool,
  877. constint,constchar,constset,constpointer,constnil,
  878. constresourcestring,constwstring,constwchar,constguid
  879. );
  880. var
  881. b : byte;
  882. pc : pchar;
  883. totalsyms,
  884. symcnt,
  885. i,j,len : longint;
  886. guid : tguid;
  887. begin
  888. symcnt:=1;
  889. with ppufile do
  890. begin
  891. if space<>'' then
  892. Writeln(space,'------ ',s,' ------');
  893. if readentry=ibstartsyms then
  894. begin
  895. totalsyms:=getlongint;
  896. Writeln(space,'Number of symbols : ',totalsyms);
  897. Writeln(space,'Symtable datasize : ',getlongint);
  898. Writeln(space,'Symtable alignment: ',getlongint);
  899. end
  900. else
  901. begin
  902. totalsyms:=-1;
  903. Writeln('!! ibstartsym not found');
  904. end;
  905. repeat
  906. b:=readentry;
  907. if not (b in [iberror,ibendsyms]) then
  908. inc(symcnt);
  909. case b of
  910. ibunitsym :
  911. readcommonsym('Unit symbol ');
  912. iblabelsym :
  913. readcommonsym('Label symbol ');
  914. ibtypesym :
  915. begin
  916. readcommonsym('Type symbol ');
  917. write(space,' Result Type: ');
  918. readtype;
  919. end;
  920. ibprocsym :
  921. begin
  922. readcommonsym('Procedure symbol ');
  923. len:=ppufile.getword;
  924. for i:=1 to len do
  925. begin
  926. write(space,' Definition: ');
  927. readderef;
  928. end;
  929. end;
  930. ibconstsym :
  931. begin
  932. readcommonsym('Constant symbol ');
  933. b:=getbyte;
  934. case tconsttyp(b) of
  935. constord :
  936. begin
  937. write (space,'OrdinalType: ');
  938. readtype;
  939. writeln (space,' Value: ',getlongint)
  940. end;
  941. constpointer :
  942. begin
  943. write (space,' Pointer Type: ');
  944. readtype;
  945. writeln (space,' Value: ',getlongint)
  946. end;
  947. conststring,
  948. constresourcestring :
  949. begin
  950. len:=getlongint;
  951. getmem(pc,len+1);
  952. getdata(pc^,len);
  953. writeln(space,' Length: ',len);
  954. writeln(space,' Value: "',pc,'"');
  955. freemem(pc,len+1);
  956. if tconsttyp(b)=constresourcestring then
  957. writeln(space,' Index: ',getlongint);
  958. end;
  959. constreal :
  960. writeln(space,' Value: ',getreal);
  961. constbool :
  962. if getlongint<>0 then
  963. writeln (space,' Value : True')
  964. else
  965. writeln (space,' Value: False');
  966. constint :
  967. writeln(space,' Value: ',getint64);
  968. constchar :
  969. writeln(space,' Value: "'+chr(getlongint)+'"');
  970. constset :
  971. begin
  972. write (space,' Set Type: ');
  973. readtype;
  974. for i:=1to 4 do
  975. begin
  976. write (space,' Value: ');
  977. for j:=1to 8 do
  978. begin
  979. if j>1 then
  980. write(',');
  981. write(hexb(getbyte));
  982. end;
  983. writeln;
  984. end;
  985. end;
  986. constwstring:
  987. begin
  988. end;
  989. constwchar:
  990. writeln(space,' Value: #',getlongint);
  991. constguid:
  992. begin
  993. getdata(guid,sizeof(guid));
  994. write (space,' IID String: {',hexstr(guid.d1,8),'-',hexstr(guid.d2,4),'-',hexstr(guid.d3,4),'-');
  995. for i:=0 to 7 do
  996. begin
  997. write(hexstr(guid.d4[i],2));
  998. if i=1 then write('-');
  999. end;
  1000. writeln('}');
  1001. end
  1002. else
  1003. Writeln ('!! Invalid unit format : Invalid const type encountered: ',b);
  1004. end;
  1005. end;
  1006. ibvarsym :
  1007. begin
  1008. readcommonsym('Variable symbol ');
  1009. writeln(space,' Spez: ',Varspez2Str(getbyte));
  1010. writeln(space,' Address: ',getlongint);
  1011. write (space,' Var Type: ');
  1012. readtype;
  1013. i:=getlongint;
  1014. writeln(space,' Options: ',i);
  1015. if (vo_is_C_var in tvaroptions(i)) then
  1016. writeln(space,' Mangledname: ',getstring);
  1017. end;
  1018. ibenumsym :
  1019. begin
  1020. readcommonsym('Enumeration symbol ');
  1021. write (space,' Definition: ');
  1022. readderef;
  1023. writeln(space,' Value: ',getlongint);
  1024. end;
  1025. ibsyssym :
  1026. begin
  1027. readcommonsym('Internal system symbol ');
  1028. writeln(space,' Internal Nr: ',getlongint);
  1029. end;
  1030. ibrttisym :
  1031. begin
  1032. readcommonsym('RTTI symbol ');
  1033. writeln(space,' RTTI Type: ',getbyte);
  1034. end;
  1035. ibtypedconstsym :
  1036. begin
  1037. readcommonsym('Typed constant ');
  1038. write (space,' Constant Type: ');
  1039. readtype;
  1040. writeln(space,' ReallyConst: ',(getbyte<>0));
  1041. end;
  1042. ibabsolutesym :
  1043. begin
  1044. readcommonsym('Absolute variable symbol ');
  1045. writeln(space,' Type: ',getbyte);
  1046. writeln(space,' Address: ',getlongint);
  1047. write (space,' Var Type: ');
  1048. readtype;
  1049. writeln(space,' Options: ',getlongint);
  1050. Write (space,' Relocated to ');
  1051. b:=getbyte;
  1052. case absolutetyp(b) of
  1053. tovar :
  1054. Writeln('Name : ',getstring);
  1055. toasm :
  1056. Writeln('Assembler name : ',getstring);
  1057. toaddr :
  1058. begin
  1059. Write('Address : ',getlongint);
  1060. WriteLn(' (Far: ',getbyte<>0,')');
  1061. end;
  1062. else
  1063. Writeln ('!! Invalid unit format : Invalid absolute type encountered: ',b);
  1064. end;
  1065. end;
  1066. ibpropertysym :
  1067. begin
  1068. readcommonsym('Property ');
  1069. i:=getlongint;
  1070. writeln(space,' PropOptions: ',i);
  1071. if (i and 32)>0 then
  1072. begin
  1073. write (space,'OverrideProp: ');
  1074. readderef;
  1075. end
  1076. else
  1077. begin
  1078. write (space,' Prop Type: ');
  1079. readtype;
  1080. writeln(space,' Index: ',getlongint);
  1081. writeln(space,' Default: ',getlongint);
  1082. write (space,' Index Type: ');
  1083. readtype;
  1084. write (space,' Readaccess: ');
  1085. readsymlist(space+' Sym: ');
  1086. write (space,' Writeaccess: ');
  1087. readsymlist(space+' Sym: ');
  1088. write (space,'Storedaccess: ');
  1089. readsymlist(space+' Sym: ');
  1090. end;
  1091. end;
  1092. iberror :
  1093. begin
  1094. Writeln('!! Error in PPU');
  1095. exit;
  1096. end;
  1097. ibendsyms :
  1098. break;
  1099. else
  1100. WriteLn('!! Skipping unsupported PPU Entry in Symbols: ',b);
  1101. end;
  1102. if not EndOfEntry then
  1103. Writeln('!! Entry has more information stored');
  1104. until false;
  1105. if (totalsyms<>-1) and (symcnt-1<>totalsyms) then
  1106. Writeln('!! Only read ',symcnt-1,' of ',totalsyms,' symbols');
  1107. end;
  1108. end;
  1109. {****************************************************************************
  1110. Read defintions Part
  1111. ****************************************************************************}
  1112. procedure readdefinitions(const s:string;start_read : boolean);
  1113. type
  1114. tsettype = (normset,smallset,varset);
  1115. tbasetype = (
  1116. uvoid,
  1117. u8bit,u16bit,u32bit,u64bit,
  1118. s8bit,s16bit,s32bit,s64bit,
  1119. bool8bit,bool16bit,bool32bit,
  1120. uchar,uwidechar
  1121. );
  1122. tobjectdeftype = (odt_none,
  1123. odt_class,
  1124. odt_object,
  1125. odt_interfacecom,
  1126. odt_interfacecorba,
  1127. odt_cppclass
  1128. );
  1129. tvarianttype = (
  1130. vt_normalvariant,vt_olevariant
  1131. );
  1132. var
  1133. b : byte;
  1134. totaldefs,l,j,
  1135. defcnt : longint;
  1136. calloption : tproccalloption;
  1137. begin
  1138. defcnt:=0;
  1139. with ppufile do
  1140. begin
  1141. if space<>'' then
  1142. Writeln(space,'------ ',s,' ------');
  1143. if not start_read then
  1144. if readentry=ibstartdefs then
  1145. begin
  1146. totaldefs:=getlongint;
  1147. Writeln(space,'Number of definitions: ',totaldefs);
  1148. end
  1149. else
  1150. begin
  1151. totaldefs:=-1;
  1152. Writeln('!! ibstartdef not found');
  1153. end;
  1154. repeat
  1155. b:=readentry;
  1156. if not (b in [iberror,ibenddefs]) then
  1157. inc(defcnt);
  1158. case b of
  1159. ibpointerdef :
  1160. begin
  1161. readcommondef('Pointer definition');
  1162. write (space,' Pointed Type : ');
  1163. readtype;
  1164. writeln(space,' Is Far : ',(getbyte<>0));
  1165. end;
  1166. iborddef :
  1167. begin
  1168. readcommondef('Ordinal definition');
  1169. write (space,' Base type : ');
  1170. b:=getbyte;
  1171. case tbasetype(b) of
  1172. uvoid : writeln('uvoid');
  1173. u8bit : writeln('u8bit');
  1174. u16bit : writeln('u16bit');
  1175. u32bit : writeln('s32bit');
  1176. u64bit : writeln('u64bit');
  1177. s8bit : writeln('s8bit');
  1178. s16bit : writeln('s16bit');
  1179. s32bit : writeln('s32bit');
  1180. s64bit : writeln('s64bit');
  1181. bool8bit : writeln('bool8bit');
  1182. bool16bit : writeln('bool16bit');
  1183. bool32bit : writeln('bool32bit');
  1184. uchar : writeln('uchar');
  1185. uwidechar : writeln('uwidechar');
  1186. else writeln('!! Warning: Invalid base type ',b);
  1187. end;
  1188. writeln(space,' Range : ',getint64,' to ',getint64);
  1189. end;
  1190. ibfloatdef :
  1191. begin
  1192. readcommondef('Float definition');
  1193. writeln(space,' Float type : ',getbyte);
  1194. end;
  1195. ibarraydef :
  1196. begin
  1197. readcommondef('Array definition');
  1198. write (space,' Element type : ');
  1199. readtype;
  1200. write (space,' Range Type : ');
  1201. readtype;
  1202. writeln(space,' Range : ',getlongint,' to ',getlongint);
  1203. writeln(space,' Is Constructor : ',(getbyte<>0));
  1204. writeln(space,' Is Dynamic : ',(getbyte<>0));
  1205. end;
  1206. ibprocdef :
  1207. begin
  1208. readcommondef('Procedure definition');
  1209. calloption:=read_abstract_proc_def;
  1210. if (getbyte<>0) then
  1211. writeln(space,' Mangled name : ',getstring);
  1212. writeln(space,' Overload Number : ',getword);
  1213. writeln(space,' Number : ',getword);
  1214. writeln(space,' Level : ',getbyte);
  1215. write (space,' Class : ');
  1216. readderef;
  1217. write (space,' Procsym : ');
  1218. readderef;
  1219. write (space,' File Pos : ');
  1220. readposinfo;
  1221. write (space,' SymOptions : ');
  1222. readsymoptions;
  1223. if (calloption=pocall_inline) then
  1224. begin
  1225. write (space,' FuncretSym : ');
  1226. readderef;
  1227. end;
  1228. if not EndOfEntry then
  1229. Writeln('!! Entry has more information stored');
  1230. space:=' '+space;
  1231. { parast }
  1232. readdefinitions('parast',false);
  1233. readsymbols('parast');
  1234. { localst }
  1235. if (calloption=pocall_inline) or
  1236. ((ppufile.header.flags and uf_local_browser) <> 0) then
  1237. begin
  1238. readdefinitions('localst',false);
  1239. readsymbols('localst');
  1240. end;
  1241. { code }
  1242. if (calloption=pocall_inline) then
  1243. readnodetree;
  1244. delete(space,1,4);
  1245. end;
  1246. ibprocvardef :
  1247. begin
  1248. readcommondef('Procedural type (ProcVar) definition');
  1249. read_abstract_proc_def;
  1250. if not EndOfEntry then
  1251. Writeln('!! Entry has more information stored');
  1252. space:=' '+space;
  1253. { parast }
  1254. readdefinitions('parast',false);
  1255. readsymbols('parast');
  1256. delete(space,1,4);
  1257. end;
  1258. ibshortstringdef :
  1259. begin
  1260. readcommondef('ShortString definition');
  1261. writeln(space,' Length : ',getbyte);
  1262. end;
  1263. ibwidestringdef :
  1264. begin
  1265. readcommondef('WideString definition');
  1266. writeln(space,' Length : ',getlongint);
  1267. end;
  1268. ibansistringdef :
  1269. begin
  1270. readcommondef('AnsiString definition');
  1271. writeln(space,' Length : ',getlongint);
  1272. end;
  1273. iblongstringdef :
  1274. begin
  1275. readcommondef('Longstring definition');
  1276. writeln(space,' Length : ',getlongint);
  1277. end;
  1278. ibrecorddef :
  1279. begin
  1280. readcommondef('Record definition');
  1281. writeln(space,' Size : ',getlongint);
  1282. if not EndOfEntry then
  1283. Writeln('!! Entry has more information stored');
  1284. {read the record definitions and symbols}
  1285. space:=' '+space;
  1286. readdefinitions('fields',false);
  1287. readsymbols('fields');
  1288. Delete(space,1,4);
  1289. end;
  1290. ibobjectdef :
  1291. begin
  1292. readcommondef('Object/Class definition');
  1293. b:=getbyte;
  1294. write (space,' Type : ');
  1295. case tobjectdeftype(b) of
  1296. odt_class : writeln('class');
  1297. odt_object : writeln('object');
  1298. odt_interfacecom : writeln('interfacecom');
  1299. odt_interfacecorba : writeln('interfacecorba');
  1300. odt_cppclass : writeln('cppclass');
  1301. else writeln('!! Warning: Invalid object type ',b);
  1302. end;
  1303. writeln(space,' Size : ',getlongint);
  1304. writeln(space,' Vmt offset : ',getlongint);
  1305. writeln(space,' Name of Class : ',getstring);
  1306. write(space, ' Ancestor Class : ');
  1307. readderef;
  1308. writeln(space,' Options : ',getlongint);
  1309. if tobjectdeftype(b) in [odt_interfacecom,odt_interfacecorba] then
  1310. begin
  1311. { IIDGUID }
  1312. for j:=1to 16 do
  1313. getbyte;
  1314. writeln(space,' IID String : ',getstring);
  1315. writeln(space,' Last VTable idx : ',getlongint);
  1316. end;
  1317. if tobjectdeftype(b) in [odt_class,odt_interfacecorba] then
  1318. begin
  1319. l:=getlongint;
  1320. writeln(space,' Impl Intf Count : ',l);
  1321. for j:=1 to l do
  1322. begin
  1323. write (space,' - Definition : ');
  1324. readderef;
  1325. writeln(space,' IOffset : ',getlongint);
  1326. end;
  1327. end;
  1328. if not EndOfEntry then
  1329. Writeln('!! Entry has more information stored');
  1330. {read the record definitions and symbols}
  1331. space:=' '+space;
  1332. readdefinitions('fields',false);
  1333. readsymbols('fields');
  1334. Delete(space,1,4);
  1335. end;
  1336. ibfiledef :
  1337. begin
  1338. ReadCommonDef('File definition');
  1339. write (space,' Type : ');
  1340. case getbyte of
  1341. 0 : writeln('Text');
  1342. 1 : begin
  1343. writeln('Typed');
  1344. write (space,' File of Type : ');
  1345. Readtype;
  1346. end;
  1347. 2 : writeln('Untyped');
  1348. end;
  1349. end;
  1350. ibformaldef :
  1351. readcommondef('Generic Definition (void-typ)');
  1352. ibenumdef :
  1353. begin
  1354. readcommondef('Enumeration type definition');
  1355. write(space,'Base enumeration type : ');
  1356. readderef;
  1357. writeln(space,' Smallest element : ',getlongint);
  1358. writeln(space,' Largest element : ',getlongint);
  1359. writeln(space,' Size : ',getlongint);
  1360. end;
  1361. ibclassrefdef :
  1362. begin
  1363. readcommondef('Class reference definition');
  1364. write (space,' Pointed Type : ');
  1365. readtype;
  1366. end;
  1367. ibsetdef :
  1368. begin
  1369. readcommondef('Set definition');
  1370. write (space,' Element type : ');
  1371. readtype;
  1372. b:=getbyte;
  1373. case tsettype(b) of
  1374. smallset : writeln(space,' Set with 32 Elements');
  1375. normset : writeln(space,' Set with 256 Elements');
  1376. varset : writeln(space,' Set with ',getlongint,' Elements');
  1377. else writeln('!! Warning: Invalid set type ',b);
  1378. end;
  1379. end;
  1380. ibvariantdef :
  1381. begin
  1382. readcommondef('Variant definition');
  1383. write (space,' Varianttype : ');
  1384. b:=getbyte;
  1385. case tvarianttype(b) of
  1386. vt_normalvariant :
  1387. writeln('Normal');
  1388. vt_olevariant :
  1389. writeln('OLE');
  1390. else
  1391. writeln('!! Warning: Invalid varianttype ',b);
  1392. end;
  1393. end;
  1394. iberror :
  1395. begin
  1396. Writeln('!! Error in PPU');
  1397. exit;
  1398. end;
  1399. ibenddefs :
  1400. break;
  1401. else
  1402. WriteLn('!! Skipping unsupported PPU Entry in definitions: ',b);
  1403. end;
  1404. if not EndOfEntry then
  1405. Writeln('!! Entry has more information stored');
  1406. until false;
  1407. if (totaldefs<>-1) and (defcnt<>totaldefs) then
  1408. Writeln('!! Only read ',defcnt,' of ',totaldefs,' definitions');
  1409. end;
  1410. end;
  1411. {****************************************************************************
  1412. Read General Part
  1413. ****************************************************************************}
  1414. procedure readinterface;
  1415. var
  1416. b : byte;
  1417. sourcenumber : longint;
  1418. begin
  1419. with ppufile do
  1420. begin
  1421. repeat
  1422. b:=readentry;
  1423. case b of
  1424. ibmodulename :
  1425. Writeln('Module Name: ',getstring);
  1426. ibsourcefiles :
  1427. begin
  1428. sourcenumber:=1;
  1429. while not EndOfEntry do
  1430. begin
  1431. Writeln('Source file ',sourcenumber,' : ',getstring,' ',filetimestring(getlongint));
  1432. inc(sourcenumber);
  1433. end;
  1434. end;
  1435. ibusedmacros :
  1436. begin
  1437. while not EndOfEntry do
  1438. begin
  1439. Write('Conditional ',getstring);
  1440. b:=getbyte;
  1441. if boolean(b)=true then
  1442. write(' defined at startup')
  1443. else
  1444. write(' not defined at startup');
  1445. b:=getbyte;
  1446. if boolean(b)=true then
  1447. writeln(' was used')
  1448. else
  1449. writeln;
  1450. end;
  1451. end;
  1452. ibloadunit :
  1453. ReadLoadUnit;
  1454. iblinkunitofiles :
  1455. ReadLinkContainer('Link unit object file: ');
  1456. iblinkunitstaticlibs :
  1457. ReadLinkContainer('Link unit static lib: ');
  1458. iblinkunitsharedlibs :
  1459. ReadLinkContainer('Link unit shared lib: ');
  1460. iblinkotherofiles :
  1461. ReadLinkContainer('Link other object file: ');
  1462. iblinkotherstaticlibs :
  1463. ReadLinkContainer('Link other static lib: ');
  1464. iblinkothersharedlibs :
  1465. ReadLinkContainer('Link other shared lib: ');
  1466. ibderefdata :
  1467. ReadDerefData;
  1468. iberror :
  1469. begin
  1470. Writeln('Error in PPU');
  1471. exit;
  1472. end;
  1473. ibendinterface :
  1474. break;
  1475. else
  1476. WriteLn('!! Skipping unsupported PPU Entry in General Part: ',b);
  1477. end;
  1478. until false;
  1479. end;
  1480. end;
  1481. {****************************************************************************
  1482. Read Implementation Part
  1483. ****************************************************************************}
  1484. procedure readimplementation;
  1485. var
  1486. b : byte;
  1487. begin
  1488. with ppufile do
  1489. begin
  1490. repeat
  1491. b:=readentry;
  1492. case b of
  1493. ibasmsymbols :
  1494. ReadAsmSymbols;
  1495. ibloadunit :
  1496. ReadLoadUnit;
  1497. iberror :
  1498. begin
  1499. Writeln('Error in PPU');
  1500. exit;
  1501. end;
  1502. ibendimplementation :
  1503. break;
  1504. else
  1505. WriteLn('!! Skipping unsupported PPU Entry in Implementation: ',b);
  1506. end;
  1507. until false;
  1508. end;
  1509. end;
  1510. {****************************************************************************
  1511. Read Browser Part
  1512. ****************************************************************************}
  1513. procedure readbrowser;
  1514. var
  1515. b : byte;
  1516. const indent : string = '';
  1517. begin
  1518. Writeln(indent,'Start of symtable browser');
  1519. indent:=indent+'**';
  1520. with ppufile do
  1521. begin
  1522. repeat
  1523. b:=readentry;
  1524. case b of
  1525. ibbeginsymtablebrowser :
  1526. begin
  1527. { here we must read object and record symtables !! }
  1528. indent:=indent+' ';
  1529. Writeln(indent,'Record/Object symtable');
  1530. readbrowser;
  1531. Indent:=Copy(Indent,1,Length(Indent)-2);
  1532. end;
  1533. ibsymref :
  1534. begin
  1535. readderef;
  1536. readref;
  1537. end;
  1538. ibdefref :
  1539. begin
  1540. readderef;
  1541. readref;
  1542. if ((ppufile.header.flags and uf_local_browser)<>0) and
  1543. (UnitIndex=0) then
  1544. begin
  1545. { parast and localst }
  1546. indent:=indent+' ';
  1547. b:=ppufile.readentry;
  1548. if b=ibbeginsymtablebrowser then
  1549. readbrowser;
  1550. b:=ppufile.readentry;
  1551. if b=ibbeginsymtablebrowser then
  1552. readbrowser;
  1553. Indent:=Copy(Indent,1,Length(Indent)-2);
  1554. end;
  1555. end;
  1556. iberror :
  1557. begin
  1558. Writeln('Error in PPU');
  1559. exit;
  1560. end;
  1561. ibendsymtablebrowser :
  1562. break;
  1563. else
  1564. begin
  1565. WriteLn('!! Skipping unsupported PPU Entry in Browser: ',b);
  1566. Halt;
  1567. end;
  1568. end;
  1569. until false;
  1570. end;
  1571. Indent:=Copy(Indent,1,Length(Indent)-2);
  1572. Writeln(Indent,'End of symtable browser');
  1573. end;
  1574. procedure dofile (filename : string);
  1575. var
  1576. b : byte;
  1577. begin
  1578. { reset }
  1579. space:='';
  1580. { fix filename }
  1581. if pos('.',filename)=0 then
  1582. filename:=filename+'.ppu';
  1583. ppufile:=tppufile.create(filename);
  1584. if not ppufile.openfile then
  1585. begin
  1586. writeln ('IO-Error when opening : ',filename,', Skipping');
  1587. exit;
  1588. end;
  1589. { PPU File is open, check for PPU Id }
  1590. if not ppufile.CheckPPUID then
  1591. begin
  1592. writeln(Filename,' : Not a valid PPU file, Skipping');
  1593. exit;
  1594. end;
  1595. { Check PPU Version }
  1596. Writeln('Analyzing ',filename,' (v',ppufile.GetPPUVersion,')');
  1597. if ppufile.GetPPUVersion<16 then
  1598. begin
  1599. writeln(Filename,' : Old PPU Formats (<v16) are not supported, Skipping');
  1600. exit;
  1601. end;
  1602. { Write PPU Header Information }
  1603. if (verbose and v_header)<>0 then
  1604. begin
  1605. Writeln;
  1606. Writeln('Header');
  1607. Writeln('-------');
  1608. with ppufile.header do
  1609. begin
  1610. Writeln('Compiler version : ',ppufile.header.compiler shr 14,'.',
  1611. (ppufile.header.compiler shr 7) and $7f,'.',
  1612. ppufile.header.compiler and $7f);
  1613. WriteLn('Target processor : ',Cpu2Str(cpu));
  1614. WriteLn('Target operating system : ',Target2Str(target));
  1615. Writeln('Unit flags : ',PPUFlags2Str(flags));
  1616. Writeln('FileSize (w/o header) : ',size);
  1617. Writeln('Checksum : ',hexstr(checksum,8));
  1618. Writeln('Interface Checksum : ',hexstr(interface_checksum,8));
  1619. end;
  1620. end;
  1621. {read the general stuff}
  1622. if (verbose and v_interface)<>0 then
  1623. begin
  1624. Writeln;
  1625. Writeln('Interface section');
  1626. Writeln('------------------');
  1627. readinterface;
  1628. end
  1629. else
  1630. ppufile.skipuntilentry(ibendinterface);
  1631. {read the definitions}
  1632. if (verbose and v_defs)<>0 then
  1633. begin
  1634. Writeln;
  1635. Writeln('Interface definitions');
  1636. Writeln('----------------------');
  1637. readdefinitions('interface',false);
  1638. end
  1639. else
  1640. ppufile.skipuntilentry(ibenddefs);
  1641. {read the symbols}
  1642. if (verbose and v_syms)<>0 then
  1643. begin
  1644. Writeln;
  1645. Writeln('Interface Symbols');
  1646. Writeln('------------------');
  1647. readsymbols('interface');
  1648. end
  1649. else
  1650. ppufile.skipuntilentry(ibendsyms);
  1651. {read the implementation stuff}
  1652. if (verbose and v_implementation)<>0 then
  1653. begin
  1654. Writeln;
  1655. Writeln('Implementation section');
  1656. Writeln('-----------------------');
  1657. readimplementation;
  1658. end
  1659. else
  1660. ppufile.skipuntilentry(ibendimplementation);
  1661. {read the static browser units stuff}
  1662. if (ppufile.header.flags and uf_local_browser)<>0 then
  1663. begin
  1664. if (verbose and v_defs)<>0 then
  1665. begin
  1666. Writeln;
  1667. Writeln('Static definitions');
  1668. Writeln('----------------------');
  1669. readdefinitions('implementation',false);
  1670. end
  1671. else
  1672. ppufile.skipuntilentry(ibenddefs);
  1673. {read the symbols}
  1674. if (verbose and v_syms)<>0 then
  1675. begin
  1676. Writeln;
  1677. Writeln('Static Symbols');
  1678. Writeln('------------------');
  1679. readsymbols('implementation');
  1680. end;
  1681. end;
  1682. {read the browser units stuff}
  1683. if (ppufile.header.flags and uf_has_browser)<>0 then
  1684. begin
  1685. if (verbose and v_browser)<>0 then
  1686. begin
  1687. Writeln;
  1688. Writeln('Browser section');
  1689. Writeln('---------------');
  1690. UnitIndex:=0;
  1691. repeat
  1692. b:=ppufile.readentry;
  1693. if b = ibendbrowser then break;
  1694. if b=ibbeginsymtablebrowser then
  1695. begin
  1696. Writeln('Unit ',UnitIndex);
  1697. readbrowser;
  1698. Inc(UnitIndex);
  1699. end
  1700. else
  1701. Writeln('Wrong end browser entry ',b,' should be ',ibendbrowser);
  1702. until false;
  1703. end;
  1704. end;
  1705. {read the static browser units stuff}
  1706. if (ppufile.header.flags and uf_local_browser)<>0 then
  1707. begin
  1708. if (verbose and v_browser)<>0 then
  1709. begin
  1710. Writeln;
  1711. Writeln('Static browser section');
  1712. Writeln('---------------');
  1713. UnitIndex:=0;
  1714. b:=ppufile.readentry;
  1715. if b=ibbeginsymtablebrowser then
  1716. readbrowser
  1717. else
  1718. Writeln('Wrong end browser entry ',b,' should be ',ibendbrowser);
  1719. end;
  1720. end;
  1721. {shutdown ppufile}
  1722. ppufile.closefile;
  1723. ppufile.free;
  1724. Writeln;
  1725. end;
  1726. procedure help;
  1727. begin
  1728. writeln('usage: ppudump [options] <filename1> <filename2>...');
  1729. writeln;
  1730. writeln('[options] can be:');
  1731. writeln(' -V<verbose> Set verbosity to <verbose>');
  1732. writeln(' H - Show header info');
  1733. writeln(' I - Show interface');
  1734. writeln(' M - Show implementation');
  1735. writeln(' S - Show interface symbols');
  1736. writeln(' D - Show interface definitions');
  1737. writeln(' B - Show browser info');
  1738. writeln(' A - Show all');
  1739. writeln(' -? This helpscreen');
  1740. halt;
  1741. end;
  1742. var
  1743. startpara,
  1744. nrfile,i : longint;
  1745. para : string;
  1746. begin
  1747. writeln(Title+' '+Version);
  1748. writeln(Copyright);
  1749. writeln;
  1750. if paramcount<1 then
  1751. begin
  1752. writeln('usage: dumpppu [options] <filename1> <filename2>...');
  1753. halt(1);
  1754. end;
  1755. { turn verbose on by default }
  1756. verbose:=v_all;
  1757. { read options }
  1758. startpara:=1;
  1759. while copy(paramstr(startpara),1,1)='-' do
  1760. begin
  1761. para:=paramstr(startpara);
  1762. case upcase(para[2]) of
  1763. 'V' : begin
  1764. verbose:=0;
  1765. for i:=3to length(para) do
  1766. case upcase(para[i]) of
  1767. 'H' : verbose:=verbose or v_header;
  1768. 'I' : verbose:=verbose or v_interface;
  1769. 'M' : verbose:=verbose or v_implementation;
  1770. 'D' : verbose:=verbose or v_defs;
  1771. 'S' : verbose:=verbose or v_syms;
  1772. 'B' : verbose:=verbose or v_browser;
  1773. 'A' : verbose:=verbose or v_all;
  1774. end;
  1775. end;
  1776. '?' : help;
  1777. end;
  1778. inc(startpara);
  1779. end;
  1780. { process files }
  1781. for nrfile:=startpara to paramcount do
  1782. dofile (paramstr(nrfile));
  1783. if has_errors then
  1784. Halt(1);
  1785. end.
  1786. {
  1787. $Log$
  1788. Revision 1.48 2003-11-10 22:02:52 peter
  1789. * cross unit inlining fixed
  1790. Revision 1.47 2003/10/22 20:40:00 peter
  1791. * write derefdata in a separate ppu entry
  1792. Revision 1.46 2003/07/02 22:18:04 peter
  1793. * paraloc splitted in callerparaloc,calleeparaloc
  1794. * sparc calling convention updates
  1795. Revision 1.45 2003/06/25 18:31:23 peter
  1796. * sym,def resolving partly rewritten to support also parent objects
  1797. not directly available through the uses clause
  1798. Revision 1.44 2003/06/09 12:59:00 peter
  1799. * updated for new deref info
  1800. Revision 1.43 2003/06/05 20:06:11 peter
  1801. * new procoptions
  1802. Revision 1.42 2003/05/09 17:47:03 peter
  1803. * self moved to hidden parameter
  1804. * removed hdisposen,hnewn,selfn
  1805. Revision 1.41 2003/04/27 07:29:52 peter
  1806. * aktprocdef cleanup, aktprocdef is now always nil when parsing
  1807. a new procdef declaration
  1808. * aktprocsym removed
  1809. * lexlevel removed, use symtable.symtablelevel instead
  1810. * implicit init/final code uses the normal genentry/genexit
  1811. * funcret state checking updated for new funcret handling
  1812. Revision 1.39 2003/04/25 20:59:35 peter
  1813. * removed funcretn,funcretsym, function result is now in varsym
  1814. and aliases for result and function name are added using absolutesym
  1815. * vs_hidden parameter for funcret passed in parameter
  1816. * vs_hidden fixes
  1817. * writenode changed to printnode and released from extdebug
  1818. * -vp option added to generate a tree.log with the nodetree
  1819. * nicer printnode for statements, callnode
  1820. Revision 1.38 2003/04/10 17:57:53 peter
  1821. * vs_hidden released
  1822. Revision 1.37 2003/03/24 19:57:54 hajny
  1823. + emx target added
  1824. Revision 1.36 2003/03/17 15:54:22 peter
  1825. * store symoptions also for procdef
  1826. * check symoptions (private,public) when calculating possible
  1827. overload candidates
  1828. Revision 1.35 2003/01/03 22:16:29 peter
  1829. * updated for absolutesym and varsym
  1830. Revision 1.34 2002/11/17 16:32:04 carl
  1831. * memory optimization (3-4%) : cleanup of tai fields,
  1832. cleanup of tdef and tsym fields.
  1833. * make it work for m68k
  1834. Revision 1.33 2002/10/20 14:49:31 peter
  1835. * store original source time in ppu so it can be compared instead of
  1836. comparing with the ppu time
  1837. Revision 1.32 2002/10/06 12:25:53 florian
  1838. + dump of tdefoptions.df_unique
  1839. Revision 1.31 2002/09/27 21:22:04 carl
  1840. * update system information
  1841. Revision 1.30 2002/09/26 12:03:54 florian
  1842. + support of constguid and constwchar const symbols added
  1843. Revision 1.29 2002/08/20 16:54:40 peter
  1844. * write address of varsym always
  1845. Revision 1.28 2002/08/19 19:36:44 peter
  1846. * More fixes for cross unit inlining, all tnodes are now implemented
  1847. * Moved pocall_internconst to po_internconst because it is not a
  1848. calling type at all and it conflicted when inlining of these small
  1849. functions was requested
  1850. Revision 1.27 2002/08/15 15:15:56 carl
  1851. * jmpbuf size allocation for exceptions is now cpu specific (as it should)
  1852. * more generic nodes for maths
  1853. * several fixes for better m68k support
  1854. Revision 1.26 2002/08/11 13:24:20 peter
  1855. * saving of asmsymbols in ppu supported
  1856. * asmsymbollist global is removed and moved into a new class
  1857. tasmlibrarydata that will hold the info of a .a file which
  1858. corresponds with a single module. Added librarydata to tmodule
  1859. to keep the library info stored for the module. In the future the
  1860. objectfiles will also be stored to the tasmlibrarydata class
  1861. * all getlabel/newasmsymbol and friends are moved to the new class
  1862. Revision 1.25 2002/05/18 13:34:27 peter
  1863. * readded missing revisions
  1864. Revision 1.24 2002/05/16 19:46:54 carl
  1865. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  1866. + try to fix temp allocation (still in ifdef)
  1867. + generic constructor calls
  1868. + start of tassembler / tmodulebase class cleanup
  1869. Revision 1.22 2002/05/12 16:53:18 peter
  1870. * moved entry and exitcode to ncgutil and cgobj
  1871. * foreach gets extra argument for passing local data to the
  1872. iterator function
  1873. * -CR checks also class typecasts at runtime by changing them
  1874. into as
  1875. * fixed compiler to cycle with the -CR option
  1876. * fixed stabs with elf writer, finally the global variables can
  1877. be watched
  1878. * removed a lot of routines from cga unit and replaced them by
  1879. calls to cgobj
  1880. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  1881. u32bit then the other is typecasted also to u32bit without giving
  1882. a rangecheck warning/error.
  1883. * fixed pascal calling method with reversing also the high tree in
  1884. the parast, detected by tcalcst3 test
  1885. Revision 1.21 2002/04/23 13:12:58 peter
  1886. * updated for posinfo change
  1887. * updated for mangledname change
  1888. * include i386 registers, removed reference to cpubase unit that would
  1889. make ppudump dependent on the source processor
  1890. Revision 1.20 2002/04/15 19:15:09 carl
  1891. + write std_reg2str instead of gas registers
  1892. Revision 1.19 2002/04/14 17:02:19 carl
  1893. + att_reg2str -> gas_reg2str
  1894. Revision 1.18 2002/04/07 10:23:36 carl
  1895. + added vm / sparc targets
  1896. Revision 1.17 2002/04/04 19:06:14 peter
  1897. * removed unused units
  1898. * use tlocation.size in cg.a_*loc*() routines
  1899. Revision 1.16 2002/04/04 18:50:27 carl
  1900. + added wdosx support (patch from Pavel)
  1901. Revision 1.15 2002/03/31 20:26:42 jonas
  1902. + a_loadfpu_* and a_loadmm_* methods in tcg
  1903. * register allocation is now handled by a class and is mostly processor
  1904. independent (+rgobj.pas and i386/rgcpu.pas)
  1905. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  1906. * some small improvements and fixes to the optimizer
  1907. * some register allocation fixes
  1908. * some fpuvaroffset fixes in the unary minus node
  1909. * push/popusedregisters is now called rg.save/restoreusedregisters and
  1910. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  1911. also better optimizable)
  1912. * fixed and optimized register saving/restoring for new/dispose nodes
  1913. * LOC_FPU locations now also require their "register" field to be set to
  1914. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  1915. - list field removed of the tnode class because it's not used currently
  1916. and can cause hard-to-find bugs
  1917. Revision 1.14 2002/03/28 20:48:52 carl
  1918. - remove go32v1 support
  1919. Revision 1.13 2002/03/28 16:44:59 armin
  1920. + new flag if unit has local threadvars
  1921. Revision 1.12 2002/03/01 14:08:47 peter
  1922. * parasym added
  1923. Revision 1.11 2002/01/06 12:08:16 peter
  1924. * removed uauto from orddef, use new range_to_basetype generating
  1925. the correct ordinal type for a range
  1926. }