home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Id: LoadCommand.h,v 1.6 94/05/29 14:58:55 ediger Exp Locker: ediger $
- * $Log: LoadCommand.h,v $
- * Revision 1.6 94/05/29 14:58:55 ediger
- * added - (struct load_command *)loadCommandAddress; to interface
- *
- * Revision 1.5 94/01/30 16:28:26 ediger
- * add support for getting pc of thread load commands
- *
- * Revision 1.4 93/10/31 21:34:32 ediger
- * removed declarations of +new and -printSections
- *
- * Revision 1.3 93/10/28 00:07:34 ediger
- * ditch an unused, unnecessary instance variable
- *
- * Revision 1.2 93/10/27 23:42:43 ediger
- * changed to one subclass per type of load command
- *
- */
- #import <objc/Object.h>
- #import <sys/types.h>
- #import <mach-o/loader.h>
- #import <mach/m68k/thread_status.h>
- #import <mach/i386/thread_status.h>
- #import <stdio.h>
- #import <libc.h>
- #import <assert.h>
-
- #import <MachOFile.h>
-
- @interface LoadCommand: Object
- {
- struct load_command *loadCommand;
- BOOL mapped; // subclasses set as appropriate
- BOOL otherFile; // load command represents another file
- }
-
-
- + new:(caddr_t)loadCommandAddress;
-
- - free;
-
- - (unsigned long)commandSize;
-
- - (BOOL)isThread;
-
- - (BOOL)isMapped;
-
- - (BOOL)representsMappedFile;
-
- - (struct load_command *)loadCommandAddress;
-
- // subclasses need to override some or all of these:
- - init;
-
- - setLoadCommand: (caddr_t)loadCommandAddress;
-
- - (unsigned long)getBaseAddress;
-
- - (unsigned long)getUpperAddress;
-
- - (char *)commandName;
-
- - (int)numberOfSections;
-
- @end
-
- // LC_SEGMENT load command has to implement a few
- // extra methods because of the array of "struct section"
- // things it carries around.
- @interface SegmentCommand: LoadCommand
- {
- struct segment_command *segmentCommand;
- struct section **sections;
- }
-
- - fillSections;
-
- - (struct section *)getSection:(int)sectionNumber;
-
- @end
-
- @interface LoadFVMLibCommand: LoadCommand
- {
- struct fvmlib_command *fvmlibCommand;
- id theOtherFile;
- }
- - loadOtherFile;
- - otherFile;
- @end
-
- @interface IdFVMLibCommand: LoadFVMLibCommand
- {
- char *namebuf;
- }
- @end
-
- @interface IdentCommand: LoadCommand
- {
- }
- @end
-
- @interface FVMFileCommand: LoadCommand
- {
- struct fvmfile_command *fvmFileCommand;
- }
- @end
-
- @interface SymTabCommand: LoadCommand
- {
- struct symtab_command *symTabCommand;
- }
- @end
-
- @interface SymSegCommand: LoadCommand
- {
- struct symseg_command *symSegCommand;
- }
- @end
-
- @interface ThreadCommand: LoadCommand
- {
- struct thread_command *threadCommand;
- }
- - (unsigned long)pc;
- @end
-
- @interface UnixThreadCommand: ThreadCommand
- {
- }
- - (char *)commandName;
- @end
-