home *** CD-ROM | disk | FTP | other *** search
- head 1.10;
- branch ;
- access ;
- symbols ;
- locks ediger:1.10;
- comment @ * @;
-
-
- 1.10
- date 94.05.04.11.20.18; author ediger; state Exp;
- branches ;
- next 1.9;
-
- 1.9
- date 94.05.01.17.32.04; author ediger; state Exp;
- branches ;
- next 1.8;
-
- 1.8
- date 94.02.07.21.21.01; author ediger; state Exp;
- branches ;
- next 1.7;
-
- 1.7
- date 94.01.30.16.28.52; author ediger; state Exp;
- branches ;
- next 1.6;
-
- 1.6
- date 93.12.18.22.48.44; author ediger; state Exp;
- branches ;
- next 1.5;
-
- 1.5
- date 93.12.07.23.30.53; author ediger; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 93.12.02.00.27.53; author ediger; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 93.10.31.21.33.54; author ediger; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 93.10.27.23.43.42; author ediger; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 93.10.25.18.00.25; author ediger; state Exp;
- branches ;
- next ;
-
-
- desc
- @MachOFile object interface and declaration
- @
-
-
- 1.10
- log
- @support for finding which segment a thread's pc is in
- @
- text
- @/*
- * $Id: MachOFile.h,v 1.9 94/05/01 17:32:04 ediger Exp Locker: ediger $
- * $Log: MachOFile.h,v $
- * Revision 1.9 94/05/01 17:32:04 ediger
- * added - (struct section *)sectionNamed:: method
- *
- * Revision 1.8 94/02/07 21:21:01 ediger
- * added methods and instance vars to allow an already-mapped file
- * to be represented by the MachOFile object instance.
- *
- * Revision 1.7 94/01/30 16:28:52 ediger
- * add support for threads
- *
- * Revision 1.6 93/12/18 22:48:44 ediger
- * -initFromFileNamed: method renamed to -fillFromFileNamed:
- *
- * Revision 1.5 93/12/07 23:30:53 ediger
- * added cpuType and cpuSubtype methods
- * split error number return between lastErrno and lastKernReturn inst vars
- *
- * Revision 1.4 93/12/02 00:27:53 ediger
- * added -(char *)fileType method declaration
- *
- * Revision 1.3 93/10/31 21:33:54 ediger
- * removed declarations of -printSegments and +new
- *
- * Revision 1.2 93/10/27 23:43:42 ediger
- * Definition of MachOFile object that uses LoadCommand subclasses
- *
- */
- #import <stdlib.h>
- #import <libc.h>
- #import <sys/types.h>
- #import <sys/stat.h>
- #import <fcntl.h>
- #import <assert.h>
- #import <objc/Object.h>
- #import <mach/mach.h>
- #import <mach/mach_error.h>
- #import <mach-o/loader.h>
- #import <errno.h>
- #import <mach/mach_error.h>
-
- #import <objc/List.h>
- #import <SortedList.h>
- #import <LoadCommand.h>
-
- @@interface MachOFile: Object
- {
- SortedList *mappedSegmentList;
- List *unmappedSegmentList;
- List *threadList;
- int *threadSegment;
-
- struct mach_header *fileHeader;
-
- vm_offset_t mappedFileAddress;
- vm_size_t mappedFileSize;
- int fileDescriptor;
-
- BOOL mapsFile;
- BOOL addMappedFiles;
-
- int lastErrno;
- kern_return_t lastKernReturn;
- }
-
- - free;
- - init;
-
- // do the rest of the initialization
- - fillFromFileNamed: (char *)filename;
- - fillFromAddress: (char *)address;
-
- // internal use method
- - (int)mapFile: (char *)filename;
-
- // count of segments or threads
- - (int)mappedSegments;
- - (int)unmappedSegments;
- - (int)threads;
-
- - (int)segmentOfThread:(int)threadNumber;
-
- // actually gives back LoadCommand subclass
- - mappedSegment: (int)segmentNumber;
- - unmappedSegment: (int)segmentNumber;
- - thread: (int)threadNumber;
-
- // give back a pointer to a piece of an LC_SEGMENT
- - (struct section *)sectionNamed:(char *)sectName inSegNamed:(char *)segName;
-
- // printable strings about the file.
- - (char *)fileType;
- - (char *)cpuType;
- - (char *)cpuSubtype;
-
- // change how object views the file
- - considerMappedFiles;
- - unconsiderMappedFiles;
- - removeSegment:aLoadCommand;
-
- @@end
- @
-
-
- 1.9
- log
- @added - (struct section *)sectionNamed:: method
- @
- text
- @d2 1
- a2 1
- * $Id: MachOFile.h,v 1.8 94/02/07 21:21:01 ediger Exp Locker: ediger $
- d4 3
- d53 1
- d82 2
- @
-
-
- 1.8
- log
- @added methods and instance vars to allow an already-mapped file
- to be represented by the MachOFile object instance.
- @
- text
- @d2 1
- a2 1
- * $Id: MachOFile.h,v 1.7 94/01/30 16:28:52 ediger Exp Locker: ediger $
- d4 4
- d50 1
- d52 1
- a52 2
- BOOL mapsFile;
- int fileDescriptor;
- d55 3
- d59 1
- a64 1
-
- d67 1
- a68 1
-
- d71 1
- d74 1
- a75 1
-
- a76 1
-
- d79 1
- a80 1
-
- a81 1
-
- d84 2
- a85 1
- - considerMappedFiles;
- d87 1
- a87 4
- - unconsiderMappedFiles;
-
- - removeSegment:aLoadCommand;
-
- d91 5
- @
-
-
- 1.7
- log
- @add support for threads
- @
- text
- @d2 1
- a2 1
- * $Id: MachOFile.h,v 1.6 93/12/18 22:48:44 ediger Exp Locker: ediger $
- d4 3
- d47 1
- d61 2
- @
-
-
- 1.6
- log
- @-initFromFileNamed: method renamed to -fillFromFileNamed:
- @
- text
- @d2 1
- a2 1
- * $Id: MachOFile.h,v 1.5 93/12/07 23:30:53 ediger Exp Locker: ediger $
- d4 3
- d42 1
- d64 2
- d69 2
- @
-
-
- 1.5
- log
- @added cpuType and cpuSubtype methods
- split error number return between lastErrno and lastKernReturn inst vars
- @
- text
- @d2 1
- a2 1
- * $Id: MachOFile.h,v 1.4 93/12/02 00:27:53 ediger Exp Locker: ediger $
- d4 4
- d52 1
- a52 1
- - initFromFileNamed: (char *) filename;
- d54 1
- a54 1
- - (int)mapFile: (char *) filename;
- d60 1
- a60 1
- - mappedSegment:(int)segmentNumber;
- d62 1
- a62 1
- - unmappedSegment:(int)segmentNumber;
- @
-
-
- 1.4
- log
- @added -(char *)fileType method declaration
- @
- text
- @d2 1
- a2 1
- * $Id: MachOFile.h,v 1.3 93/10/31 21:33:54 ediger Exp Locker: ediger $
- d4 3
- d19 1
- d24 2
- d40 2
- d67 2
- @
-
-
- 1.3
- log
- @removed declarations of -printSegments and +new
- @
- text
- @d2 1
- a2 1
- * $Id: MachOFile.h,v 1.2 93/10/27 23:43:42 ediger Exp Locker: ediger $
- d4 3
- d40 1
- a40 1
- - initFromFile: (char *) filename;
- d57 2
- @
-
-
- 1.2
- log
- @Definition of MachOFile object that uses LoadCommand subclasses
- @
- text
- @d2 5
- a6 2
- * $Id$
- * $Log$
- a32 2
- + new;
-
- a51 2
-
- - printSegments;
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d1 8
- a8 4
- #include <stdlib.h>
- #include <libc.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- d15 1
- d21 2
- a22 1
- SortedList *segmentList;
- d27 1
- d36 1
- a36 1
- -initFromFile: (char *) filename;
- d38 1
- a38 1
- -(int)mapFile: (char *) filename;
- d40 15
- a54 1
- -printSegments;
- @
-