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

  1. head     1.6;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ediger:1.6;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.6
  10. date     94.05.29.14.58.55;  author ediger;  state Exp;
  11. branches ;
  12. next     1.5;
  13.  
  14. 1.5
  15. date     94.01.30.16.28.26;  author ediger;  state Exp;
  16. branches ;
  17. next     1.4;
  18.  
  19. 1.4
  20. date     93.10.31.21.34.32;  author ediger;  state Exp;
  21. branches ;
  22. next     1.3;
  23.  
  24. 1.3
  25. date     93.10.28.00.07.34;  author ediger;  state Exp;
  26. branches ;
  27. next     1.2;
  28.  
  29. 1.2
  30. date     93.10.27.23.42.43;  author ediger;  state Exp;
  31. branches ;
  32. next     1.1;
  33.  
  34. 1.1
  35. date     93.10.25.18.00.10;  author ediger;  state Exp;
  36. branches ;
  37. next     ;
  38.  
  39.  
  40. desc
  41. @LoadCommand object interface and declaration
  42. @
  43.  
  44.  
  45. 1.6
  46. log
  47. @added - (struct load_command *)loadCommandAddress; to interface
  48. @
  49. text
  50. @/*
  51.  * $Id: LoadCommand.h,v 1.5 94/01/30 16:28:26 ediger Exp Locker: ediger $
  52.  * $Log:    LoadCommand.h,v $
  53.  * Revision 1.5  94/01/30  16:28:26  ediger
  54.  * add support for getting pc of thread load commands
  55.  * 
  56.  * Revision 1.4  93/10/31  21:34:32  ediger
  57.  * removed declarations of +new and -printSections
  58.  * 
  59.  * Revision 1.3  93/10/28  00:07:34  ediger
  60.  * ditch an unused, unnecessary instance variable
  61.  * 
  62.  * Revision 1.2  93/10/27  23:42:43  ediger
  63.  * changed to one subclass per type of load command
  64.  * 
  65.  */
  66. #import <objc/Object.h>
  67. #import <sys/types.h>
  68. #import <mach-o/loader.h>
  69. #import <mach/m68k/thread_status.h>
  70. #import <mach/i386/thread_status.h>
  71. #import <stdio.h>
  72. #import <libc.h>
  73. #import <assert.h>
  74.  
  75. #import <MachOFile.h>
  76.  
  77. @@interface LoadCommand: Object
  78. {
  79.     struct load_command *loadCommand;
  80.     BOOL                 mapped;      // subclasses set as appropriate
  81.     BOOL                 otherFile;   // load command represents another file
  82. }
  83.  
  84.  
  85. + new:(caddr_t)loadCommandAddress;
  86.  
  87. - free;
  88.  
  89. - (unsigned long)commandSize;
  90.  
  91. - (BOOL)isThread;
  92.  
  93. - (BOOL)isMapped;
  94.  
  95. - (BOOL)representsMappedFile;
  96.  
  97. - (struct load_command *)loadCommandAddress;
  98.  
  99. // subclasses need to override some or all of these:
  100. - init;
  101.  
  102. - setLoadCommand: (caddr_t)loadCommandAddress;
  103.  
  104. - (unsigned long)getBaseAddress;
  105.  
  106. - (unsigned long)getUpperAddress;
  107.  
  108. - (char *)commandName;
  109.  
  110. - (int)numberOfSections;
  111.  
  112. @@end
  113.  
  114. // LC_SEGMENT load command has to implement a few
  115. // extra methods because of the array of "struct section"
  116. // things it carries around.
  117. @@interface SegmentCommand: LoadCommand
  118. {
  119.     struct segment_command *segmentCommand;
  120.     struct section        **sections;
  121. }
  122.  
  123. - fillSections;
  124.  
  125. - (struct section *)getSection:(int)sectionNumber;
  126.  
  127. @@end
  128.  
  129. @@interface LoadFVMLibCommand: LoadCommand
  130. {
  131.     struct fvmlib_command *fvmlibCommand;
  132.     id                     theOtherFile;
  133. }
  134. - loadOtherFile;
  135. - otherFile;
  136. @@end
  137.  
  138. @@interface IdFVMLibCommand: LoadFVMLibCommand
  139. {
  140.     char *namebuf;
  141. }
  142. @@end
  143.  
  144. @@interface IdentCommand: LoadCommand
  145. {
  146. }
  147. @@end
  148.  
  149. @@interface FVMFileCommand: LoadCommand
  150. {
  151.     struct fvmfile_command *fvmFileCommand;
  152. }
  153. @@end
  154.  
  155. @@interface SymTabCommand: LoadCommand
  156. {
  157.     struct symtab_command *symTabCommand;
  158. }
  159. @@end
  160.  
  161. @@interface SymSegCommand: LoadCommand
  162. {
  163.     struct symseg_command *symSegCommand;
  164. }
  165. @@end
  166.  
  167. @@interface ThreadCommand: LoadCommand
  168. {
  169.     struct thread_command *threadCommand;
  170. }
  171. - (unsigned long)pc;
  172. @@end
  173.  
  174. @@interface UnixThreadCommand: ThreadCommand
  175. {
  176. }
  177. - (char *)commandName;
  178. @@end
  179. @
  180.  
  181.  
  182. 1.5
  183. log
  184. @add support for getting pc of thread load commands
  185. @
  186. text
  187. @d2 1
  188. a2 1
  189.  * $Id: LoadCommand.h,v 1.4 93/10/31 21:34:32 ediger Exp Locker: ediger $
  190. d4 3
  191. d47 2
  192. @
  193.  
  194.  
  195. 1.4
  196. log
  197. @removed declarations of +new and -printSections
  198. @
  199. text
  200. @d2 1
  201. a2 1
  202.  * $Id: LoadCommand.h,v 1.3 93/10/28 00:07:34 ediger Exp Locker: ediger $
  203. d4 3
  204. d17 2
  205. d21 1
  206. d39 2
  207. d117 1
  208. @
  209.  
  210.  
  211. 1.3
  212. log
  213. @ditch an unused, unnecessary instance variable
  214. @
  215. text
  216. @d2 1
  217. a2 1
  218.  * $Id: LoadCommand.h,v 1.2 93/10/27 23:42:43 ediger Exp Locker: ediger $
  219. d4 3
  220. a39 2
  221. + new;
  222.  
  223. a59 2
  224.  
  225. - printSections;
  226. @
  227.  
  228.  
  229. 1.2
  230. log
  231. @changed to one subclass per type of load command
  232. @
  233. text
  234. @d2 5
  235. a6 2
  236.  * $Id$
  237.  * $Log$
  238. d19 2
  239. a20 2
  240.     BOOL                 mapped;  // subclasses set as appropriate
  241.     BOOL                 otherFile;  // load command represents another file
  242. d34 1
  243. a34 1
  244. // subclasses need to override these:
  245. d51 3
  246. a57 1
  247.     int                     nextSection;
  248. @
  249.  
  250.  
  251. 1.1
  252. log
  253. @Initial revision
  254. @
  255. text
  256. @d1 4
  257. d8 1
  258. d11 1
  259. a11 10
  260. union segment_hdr {
  261.     struct load_command    lc;
  262.     struct segment_command segmentc;
  263.     struct fvmlib_command  fvmlibc;
  264.     struct thread_command  threadc;
  265.     struct symtab_command  symtabc;
  266.     struct symseg_command  symsegc;
  267.     struct ident_command   idc;
  268.     struct fvmfile_command fvmfilec;
  269. };
  270. d15 3
  271. a17 2
  272.     union segment_hdr *loadCommand;
  273.     struct section    **sections;
  274. a19 1
  275. + new;
  276. d21 2
  277. d25 7
  278. d34 1
  279. a34 1
  280. - fillSections;
  281. a35 2
  282. - (unsigned long)getBaseAddress;
  283.  
  284. d40 2
  285. d44 1
  286. a44 1
  287. - (unsigned long)commandSize;
  288. d46 9
  289. d57 1
  290. a57 1
  291. //- (int)compareBaseAddress:anotherSegment;
  292. d59 52
  293. @
  294.