ppudump.pp 59 KB

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