ppudump.pp 60 KB

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