home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / Apps / DevTools / MachOViewer / Source / RCS / MachOView.h,v < prev    next >
Encoding:
Text File  |  1994-05-29  |  8.5 KB  |  493 lines

  1. head     1.13;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ediger:1.13;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.13
  10. date     94.05.29.14.59.23;  author ediger;  state Exp;
  11. branches ;
  12. next     1.12;
  13.  
  14. 1.12
  15. date     94.05.23.20.32.37;  author ediger;  state Exp;
  16. branches ;
  17. next     1.11;
  18.  
  19. 1.11
  20. date     94.05.17.23.08.53;  author ediger;  state Exp;
  21. branches ;
  22. next     1.10;
  23.  
  24. 1.10
  25. date     94.05.10.22.41.28;  author ediger;  state Exp;
  26. branches ;
  27. next     1.9;
  28.  
  29. 1.9
  30. date     94.05.04.11.20.40;  author ediger;  state Exp;
  31. branches ;
  32. next     1.8;
  33.  
  34. 1.8
  35. date     94.05.01.17.33.12;  author ediger;  state Exp;
  36. branches ;
  37. next     1.7;
  38.  
  39. 1.7
  40. date     94.02.07.21.21.39;  author ediger;  state Exp;
  41. branches ;
  42. next     1.6;
  43.  
  44. 1.6
  45. date     94.01.30.21.29.39;  author ediger;  state Exp;
  46. branches ;
  47. next     1.5;
  48.  
  49. 1.5
  50. date     94.01.30.16.29.04;  author ediger;  state Exp;
  51. branches ;
  52. next     1.4;
  53.  
  54. 1.4
  55. date     94.01.01.23.02.51;  author ediger;  state Exp;
  56. branches ;
  57. next     1.3;
  58.  
  59. 1.3
  60. date     93.12.30.19.01.09;  author ediger;  state Exp;
  61. branches ;
  62. next     1.2;
  63.  
  64. 1.2
  65. date     93.12.19.14.31.21;  author ediger;  state Exp;
  66. branches ;
  67. next     1.1;
  68.  
  69. 1.1
  70. date     93.12.19.12.59.49;  author ediger;  state Exp;
  71. branches ;
  72. next     ;
  73.  
  74.  
  75. desc
  76. @Header file for a 'MachOView', subclass of View that knows a bit
  77. about Mach-O files, and how to display a representation of them.
  78. @
  79.  
  80.  
  81. 1.13
  82. log
  83. @added support for drawing in section names
  84. @
  85. text
  86. @
  87. #import <appkit/appkit.h>
  88. #import <MachOFile.h>
  89. #import <MappedFile.h>
  90. #import <Queue.h>
  91. #import <MachOViewwraps.h>
  92.  
  93. /* $Id: MachOView.h,v 1.12 94/05/23 20:32:37 ediger Exp Locker: ediger $ */
  94. /* $Log:    MachOView.h,v $
  95.  * Revision 1.12  94/05/23  20:32:37  ediger
  96.  * stuff to support address bracket zoom-in
  97.  * 
  98.  * Revision 1.11  94/05/17  23:08:53  ediger
  99.  * support for stacking of zoomed address ranges, changed types of
  100.  * some instance vars from id to pointer to that kind of object.
  101.  * 
  102.  * Revision 1.10  94/05/10  22:41:28  ediger
  103.  * support for showing a "zooming box" by mouse-down dragging
  104.  * 
  105.  * Revision 1.9  94/05/04  11:20:40  ediger
  106.  * support for drawing thread's program counter(s)
  107.  * 
  108.  * Revision 1.8  94/05/01  17:33:12  ediger
  109.  * efficiency improvements
  110.  * 
  111.  * Revision 1.7  94/02/07  21:21:39  ediger
  112.  * added instance var to hold a memory-mapped file.
  113.  * added methods and change struct addressMapping so that segment names
  114.  * can be displayed.
  115.  * 
  116.  * Revision 1.6  94/01/30  21:29:39  ediger
  117.  * ditched doFont pswrap function, added theFont Font object instance
  118.  * to get the benefits of using a Font.
  119.  * 
  120.  * Revision 1.5  94/01/30  16:29:04  ediger
  121.  * some magic numbers relating to address label printing
  122.  * 
  123.  * Revision 1.4  94/01/01  23:02:51  ediger
  124.  * broke address label spacing calcs into separate method.
  125.  * 
  126.  * Revision 1.3  93/12/30  19:01:09  ediger
  127.  * support for showing upper and lower addresses of memor
  128.  * mapped segments
  129.  * 
  130.  * Revision 1.2  93/12/19  14:31:21  ediger
  131.  * corrected scaling and inclusion of mapped segments of library files
  132.  * 
  133.  * Revision 1.1  93/12/19  12:59:49  ediger
  134.  * Initial revision
  135.  * 
  136. */
  137.  
  138. struct addressMapping {
  139.     float         yCoordBaseLabel;
  140.     float         yCoordTopLabel;
  141.  
  142.     float         nameXcoord;
  143.     float         nameYcoord;
  144.  
  145.     unsigned long baseAddress;
  146.     unsigned long endAddress;
  147.     char         *segmentName;
  148.  
  149.     float         yCoordBase;
  150.     float         yCoordTop;
  151.  
  152.     struct sectionNameMapping *sectionMap;
  153. };
  154.  
  155. struct sectionNameMapping {
  156.     float nameYcoord;
  157.  
  158.     unsigned long sectionAddress;
  159.     char *sectionName;
  160. };
  161.  
  162. struct zoomAddress {
  163.     unsigned long hiAddr;
  164.     unsigned long loAddr;
  165.     unsigned long sumAddr;
  166. };
  167.  
  168. /* some magic numbers relating to drawing */
  169. #define LABEL_HT      12.0
  170. #define LABEL_LEADING  1.0
  171. #define LABEL_MARGIN   2.0
  172. #define LINE_WDTH      5.0
  173. #define LINE_STAGGER   7.0
  174. #define SEGMENT_GAP    2.0
  175. #define VERT_MARGIN    5.0
  176.  
  177. @@interface MachOView:View
  178. {
  179.     // ids to store "connections" built by Interface Builder
  180.     id    theWindow;
  181.     id    theFont;
  182.     id  cpuType;
  183.     id  cpuSubtype;
  184.     id  maxAddress;
  185.     id  minAddress;
  186.     id  zoomButton;
  187.     id  unzoomButton;
  188.     id  showSectionsButton;
  189.  
  190.     // ids to store objects used by MachOView to do stuff
  191.     MachOFile  *theFile;     // represents Mach-O object file.
  192.     MappedFile *mappedFile;  // manages memory mapping/unmapping, Mach style.
  193.     Queue      *zoomStack;   // stack of addresses that have been zoomed to.
  194.  
  195.     unsigned long hiAddr, hiAddrZoom;
  196.     unsigned long loAddr, loAddrZoom;
  197.     unsigned long sumAddr;
  198.  
  199.     char *currentFileName;
  200.  
  201.     float                      scaleSlope, scaleYintercept;
  202.     float                      smashedSlope, smashedYintercept;
  203.     struct addressMapping     *addressMap;
  204.     struct sectionNameMapping *sectionNames;
  205.  
  206.     // display options boolean state variables
  207.     BOOL toScale;
  208.     BOOL showLibraries;
  209.     BOOL showAddresses;
  210.     BOOL showNames;
  211.     BOOL showThreads;
  212.     BOOL showSectionNames;
  213.  
  214.     // drag out a rectangle for address zooming
  215.     NXPoint  sMouseDown, sFirstMouseDown;
  216.     BOOL yLooping;
  217. }
  218.  
  219. - free;
  220. - freeInternals;
  221. - findSizes;
  222. - rescale;
  223. - openFileNamed:(char *)fileName;
  224. - windowWillClose:sender;
  225. - initFrame:(const NXRect *)frameRect;
  226. - drawSelf:(NXRect *)rects :(int)rectCount;
  227. - mouseDown:(NXEvent *)theEvent;
  228. - drawThreads;
  229. - drawAddresses;
  230. - drawSegmentNames;
  231. - drawSectionNames;
  232. - show:sender;
  233.  
  234. - (char *)fileType;
  235.  
  236. - toggleScaling:sender;
  237. - toggleLibraries:sender;
  238. - toggleAddresses:sender;
  239. - toggleNames:sender;
  240. - toggleThreads:sender;
  241. - toggleSections:sender;
  242.  
  243. - zoom:sender;
  244. - unzoom:sender;
  245.  
  246. - spaceLabels;
  247. - spaceNames;
  248. - spaceSectionNames;
  249.  
  250. @@end
  251. @
  252.  
  253.  
  254. 1.12
  255. log
  256. @stuff to support address bracket zoom-in
  257. @
  258. text
  259. @d8 1
  260. a8 1
  261. /* $Id: MachOView.h,v 1.11 94/05/17 23:08:53 ediger Exp Locker: ediger $ */
  262. d10 3
  263. d66 2
  264. d70 7
  265. d103 1
  266. d116 4
  267. a119 3
  268.     float scaleSlope, scaleYintercept;
  269.     float smashedSlope, smashedYintercept;
  270.     struct addressMapping *addressMap;
  271. d121 1
  272. d129 1
  273. d146 1
  274. d163 1
  275. @
  276.  
  277.  
  278. 1.11
  279. log
  280. @support for stacking of zoomed address ranges, changed types of
  281. some instance vars from id to pointer to that kind of object.
  282. @
  283. text
  284. @d8 1
  285. a8 1
  286. /* $Id: MachOView.h,v 1.10 94/05/10 22:41:28 ediger Exp Locker: ediger $ */
  287. d10 4
  288. d68 1
  289. d78 1
  290. d93 3
  291. a95 3
  292.     MachOFile  *theFile;     // represents Mach-O object file
  293.     MappedFile *mappedFile;  // manages memory mapping/unmapping, Mach style
  294.     Queue      *zoomStack;   // stack of addresses that have been zoomed to
  295. @
  296.  
  297.  
  298. 1.10
  299. log
  300. @support for showing a "zooming box" by mouse-down dragging
  301. @
  302. text
  303. @d5 1
  304. d8 1
  305. a8 1
  306. /* $Id: MachOView.h,v 1.9 94/05/04 11:20:40 ediger Exp Locker: ediger $ */
  307. d10 3
  308. a45 7
  309. #undef DEBUG
  310. #ifdef DEBUG
  311. #define D(c) c
  312. #else
  313. #define D(c)
  314. #endif
  315.  
  316. d61 5
  317. d76 1
  318. a76 2
  319.     id    theFile;
  320.     id    mappedFile;
  321. d81 4
  322. d86 7
  323. a92 2
  324.     unsigned long hiAddr;
  325.     unsigned long loAddr;
  326. d113 1
  327. d134 3
  328. @
  329.  
  330.  
  331. 1.9
  332. log
  333. @support for drawing thread's program counter(s)
  334. @
  335. text
  336. @d7 1
  337. a7 1
  338. /* $Id: MachOView.h,v 1.8 94/05/01 17:33:12 ediger Exp Locker: ediger $ */
  339. d9 3
  340. d97 3
  341. d109 1
  342. @
  343.  
  344.  
  345. 1.8
  346. log
  347. @efficiency improvements
  348. @
  349. text
  350. @d7 1
  351. a7 1
  352. /* $Id: MachOView.h,v 1.7 94/02/07 21:21:39 ediger Exp Locker: ediger $ */
  353. d9 3
  354. a58 2
  355.  
  356.     unsigned long *threadPC;
  357. d92 2
  358. d103 3
  359. d114 2
  360. @
  361.  
  362.  
  363. 1.7
  364. log
  365. @added instance var to hold a memory-mapped file.
  366. added methods and change struct addressMapping so that segment names
  367. can be displayed.
  368. @
  369. text
  370. @d7 1
  371. a7 1
  372. /* $Id: MachOView.h,v 1.6 94/01/30 21:29:39 ediger Exp Locker: ediger $ */
  373. d9 5
  374. d56 2
  375. d85 1
  376. d109 2
  377. a110 2
  378. - spaceLabels:(struct addressMapping *)addrMap;
  379. - spaceNames:(struct addressMapping *)addrMap;
  380. @
  381.  
  382.  
  383. 1.6
  384. log
  385. @ditched doFont pswrap function, added theFont Font object instance
  386. to get the benefits of using a Font.
  387. @
  388. text
  389. @d4 1
  390. d7 1
  391. a7 1
  392. /* $Id: MachOView.h,v 1.5 94/01/30 16:29:04 ediger Exp Locker: ediger $ */
  393. d9 4
  394. d42 3
  395. d47 1
  396. d64 1
  397. d82 1
  398. a84 1
  399. - init;
  400. a88 1
  401. /*- windowDidResize:sender;*/
  402. d99 1
  403. d102 1
  404. @
  405.  
  406.  
  407. 1.5
  408. log
  409. @some magic numbers relating to address label printing
  410. @
  411. text
  412. @d6 1
  413. a6 1
  414. /* $Id: MachOView.h,v 1.4 94/01/01 23:02:51 ediger Exp Locker: ediger $ */
  415. d8 3
  416. d56 1
  417. @
  418.  
  419.  
  420. 1.4
  421. log
  422. @broke address label spacing calcs into separate method.
  423. @
  424. text
  425. @d6 1
  426. a6 1
  427. /* $Id: MachOView.h,v 1.3 93/12/30 19:01:09 ediger Exp Locker: ediger $ */
  428. d8 3
  429. d41 7
  430. a47 1
  431. #define LABEL_HT 10.0
  432. @
  433.  
  434.  
  435. 1.3
  436. log
  437. @support for showing upper and lower addresses of memor
  438. mapped segments
  439. @
  440. text
  441. @d6 1
  442. a6 1
  443. /* $Id: MachOView.h,v 1.2 93/12/19 14:31:21 ediger Exp Locker: ediger $ */
  444. d8 4
  445. d28 3
  446. d33 3
  447. a35 2
  448.     float         yCoord;
  449.     float         yCoord2;
  450. d38 2
  451. d64 1
  452. d66 1
  453. a66 1
  454. - windowDidResize:sender;
  455. d71 1
  456. d73 1
  457. d77 2
  458. @
  459.  
  460.  
  461. 1.2
  462. log
  463. @corrected scaling and inclusion of mapped segments of library files
  464. @
  465. text
  466. @d4 1
  467. d6 1
  468. a6 1
  469. /* $Id: MachOView.h,v 1.1 93/12/19 12:59:49 ediger Exp Locker: ediger $ */
  470. d8 3
  471. d16 1
  472. a16 1
  473. #define DEBUG
  474. d23 7
  475. d48 1
  476. d63 1
  477. @
  478.  
  479.  
  480. 1.1
  481. log
  482. @Initial revision
  483. @
  484. text
  485. @d5 5
  486. a9 2
  487. /* $Id$ */
  488. /* $Log$
  489. d32 2
  490. a33 1
  491.     float slope, yintercept;
  492. @
  493.