ppudump.pp 60 KB

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