Generate Objective-C headers from Mach-O files.
Go to file
2009-09-08 05:27:58 -06:00
class-dump.pbproj Added changes from James McIlree that make this compile and mostly 2000-06-23 23:36:02 +00:00
Nextstep Initial revision. 1999-07-31 03:32:25 +00:00
Openstep Initial revision. 1999-07-31 03:32:25 +00:00
Rhapsody Initial revision. 1999-07-31 03:32:25 +00:00
class-dump.h This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
class-dump.m This is basically version 2.1.3 that James McIlree released for OSX 2000-06-23 23:45:11 +00:00
datatypes.h This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
datatypes.m This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
gram.y This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
h.template Initial revision. 1999-07-31 03:32:25 +00:00
lexer.c This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
m.template Initial revision. 1999-07-31 03:32:25 +00:00
MappedFile.h This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
MappedFile.m This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
my_regex.c This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
my_regex.h This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
ObjcCategory.h This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
ObjcCategory.m This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
ObjcClass.h This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
ObjcClass.m This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
ObjcIvar.h This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
ObjcIvar.m This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
ObjcMethod.h This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
ObjcMethod.m This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
ObjcProtocol.h This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
ObjcProtocol.m This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
ObjcThing.h This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
ObjcThing.m This commit was manufactured by cvs2svn to create branch 'class-dump-2-1-2-branch'. 2000-06-23 23:45:11 +00:00
README This is basically version 2.1.3 that James McIlree released for OSX 2000-06-23 23:45:11 +00:00

class-dump is a utility for examining the Objective-C segment of
Mach-O files.  It generates the @interface and @protocol declarations
for classes, categories and protocols.

Version 2 is a re-implementation of Eric P. Scott's class-dump, and
works with the frameworks in Openstep 4.x.

The source compiles on Nextstep 3.3 with Foundation, Openstep, and
Rhapsody DR2, and OS X dp4. 

    class-dump-2.1.2-PI-bs.tar.gz     (Rhapsody DR2)
    class-dump.2.1.2.m.NIS.bs.tar.gz  (Openstep)
    class-dump.2.1.2.NIHS.bs.tar.gz   (Nextstep)

Compiling

    Bison is required to compile this.  There should be no warnings.

    To compile first copy the PB.project and Makefiles from one
    of the Nextstep, Openstep, Rhapsody or OSX directories into the
    main source directory and then build it.

Differences between 2.1.3 and 2.1.2

    - The OS X mach-o files keep some information in the __TEXT
      __cstring section. I've made a small set of tweeks to cause
      class-dump to look in the correct segment and section.
    - The build on OS X defines NS_TARGET_MAJOR as 5, this needs
      to be set in order to get the new code.

Differences between 2.1.1 and 2.1.2

    - Tom Hageman has provided the changes to make it work with object
      files and bundles.  In the previous version, the output was empty.
    - It shouldn't crash if there are fewer types than it expects while
      formatting a method.  This is most likely triggered by incompatible
      current versions of frameworks.

Differences between 2.1.0 and 2.1.1

    - Compiles under Rhapsody, Openstep and Foundation based Nextstep
      3.3.  Tom Hageman provided the changes to get it working with
      Nextstep 3.3 and compiled it quad-fat.
    - Under Rhapsody, the -C option now takes egrep style regular
      expressions to match categories and protocols.  It will still
      work as before with text strings, but you can, for example,
      specify -C 'View|Window' to match classes with both strings.

Differences between 2.0 and 2.1.0

    - The -a option has been split into -a, which just shows instance
      variable offsets, and -A, which shows method addresses.
      (Suggested by Charles Lloyd.)
    - Protocol definitions are all printed at the beginning of the
      output for each file.  Duplicate protocol definitions are no
      longer shown.
    - New option, -S, to sort the output.  Protocols are sorted by
      name.  Classes and categories are sorted by name.  Class and
      instance methods are each sorted by name.  (Suggested by
      Charles Lloyd.)
    - When the -S option is not used, the method definitions are
      printed out reversed from the order they are found in the
      Mach-O file.  This should reflect the order they are declared
      in the original source file.
    - The effect of the -C option has changed.  It now matches
      category and protocol names instead of just class names.
      (Carl Lindberg pointed out that categories should also be matched.)
    - Corrected output when the target file doesn't have an
      Objective-C segment.
    - An 'id *' type  should now be printed correctly.
    - Fixed printing of pointers to arrays.
    - Fixed printing of multi-dimensional arrays.
    - Made #ifdefs of LC_PREBOUND_DYLIB and LC_LOAD_DYLIB independant
      for compiling under 3.3 (Suggested by Carl Lindberg.)
    - This now uses the Foundation framework, so it may not work with
      Nextstep 3.x.
    - flex is no longer required.
    - The version number of class-dump is now included in the output.

Visible differences between version 2 and version 1

    - class-dump works with framework based files (the whole point of this
      exercise!)
    - The class declaration shows the adopted protocols.
    - Protocol definitions are shown before (rather than after) the class
      declaration.
    - New option, -r, to recursively expand frameworks and fixed VM
      shared libraries.
    - A comment is generated to show the file where the classes are
      defined.  This is helpful when using the -r option.
    - New option, -s, to use "char *" instead of "STR".

Known problems

    - The Nexttime bundles under 4.1 seem to have invalid pointers for some of
      the method names (they point into the __meth_var_types section instead of
      the __meth_var_names section) and therefore generate errors.  This may be
      caused from being compiled against a different "current version" of a
      framework than what is available on the current system.  For example:

        4.1 Nexttime bundles: compatibility version 129.0.0, current version 153.0.0
        4.1 Foundation framework: compatibility version 129.0.0, current version 154.0.0

      This also shows up in the AppleMenuOptions.app under Rhapsody DR2.
    - A couple old applications have type strings that the parser can't handle.

Comments and suggestions are welcomed.

Steve Nygard <nygard@telusplanet.net>