ppudump.pp 60 KB

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