Merge pull request #11 from mike-lischke/master

Overhaul of the app + icon - boost and more
This fixes #2 #3 #4 and #9
This commit is contained in:
Konrad Windszus 2016-11-20 16:19:29 +01:00 committed by GitHub
commit 11f1738f0f
66 changed files with 2676 additions and 5551 deletions

3
.travis.yml Normal file
View File

@ -0,0 +1,3 @@
language: objective-c
xcode_project: MacDependency/MacDependency.xcodeproj
xcode_scheme: MacDependency

View File

@ -40,15 +40,9 @@
return self;
}
- (void)dealloc {
[symbolEntries release];
[machOModel release];
[super dealloc];
}
- (NSArray*) rootModel {
// always reload model (for error messages)
[machOModel release];
machOModel = [[MachOModel alloc]initWithFile:file document:document architecture:architecture loadChildren:YES];
NSArray* rootModel = [NSArray arrayWithObject:machOModel];
return rootModel;
@ -86,7 +80,7 @@
CFUUIDRef uuid = CFUUIDCreateFromUUIDBytes(kCFAllocatorDefault, *((CFUUIDBytes*)architecture->getUuid()));
CFStringRef result = CFUUIDCreateString(kCFAllocatorDefault, uuid);
CFRelease(uuid);
return (NSString*) result;
return (NSString*) CFBridgingRelease(result);
}
- (NSString*) fileType {
@ -147,9 +141,9 @@
}
- (NSString*) rpath {
std::vector<string*> rpaths = architecture->getRpaths(false);
std::vector<std::string*> rpaths = architecture->getRpaths(false);
NSMutableString* rpath = [NSMutableString string];
for (std::vector<string*>::iterator it = rpaths.begin();
for (std::vector<std::string*>::iterator it = rpaths.begin();
it != rpaths.end();
++it)
{
@ -197,7 +191,7 @@
NSDate* date = [NSDate dateWithTimeIntervalSince1970:timestamp];
// this date formatter should be identical to NSDateFormatter in IB
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
[dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
@ -212,7 +206,6 @@
compatibleVersion];
}
}
[versionFormatter release];
} else {
version = [machOModel version];
}
@ -222,7 +215,6 @@
- (void) initSymbols {
symbolEntries = [NSMutableArray arrayWithCapacity:20];
[symbolEntries retain];
for (MachOArchitecture::LoadCommandsConstIterator lcIter = architecture->getLoadCommandsBegin();
lcIter != architecture->getLoadCommandsEnd();
++lcIter)
@ -246,13 +238,10 @@
}
- (void) setSymbols:(NSMutableArray*) newSymbolEntries {
[newSymbolEntries retain];
[symbolEntries release];
symbolEntries = symbolEntries;
symbolEntries = newSymbolEntries;
}
- (void) refreshSymbols {
[symbolEntries release];
[self initSymbols];
[self setSymbols:symbolEntries];
}

View File

@ -24,10 +24,6 @@
return self;
}
- (void)dealloc
{
[super dealloc];
}
- (void)awakeFromNib

View File

@ -31,8 +31,8 @@ CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingUTF32LE);
char* data = (char*)ws.data();
size_t size = ws.size() * sizeof(wchar_t);
NSString* result = [[[NSString alloc] initWithBytes:data length:size
encoding:kEncoding_wchar_t] autorelease];
NSString* result = [[NSString alloc] initWithBytes:data length:size
encoding:kEncoding_wchar_t];
return result;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16@2x.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32@2x.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128@2x.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256@2x.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 KiB

View File

@ -25,10 +25,8 @@
</array>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.googlecode.${PRODUCT_NAME:identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

View File

@ -3,10 +3,11 @@
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
27817EA41DE0C139000AA552 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 27817EA31DE0C139000AA552 /* Images.xcassets */; };
8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; };
8E1314FA100F7BFC00367510 /* MyDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8E1314F9100F7BFC00367510 /* MyDocument.mm */; };
8E1314FC100F7C0C00367510 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E1314FB100F7C0C00367510 /* main.m */; };
@ -17,7 +18,7 @@
8E1315C5100F8F1400367510 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8E1315C3100F8F1400367510 /* Localizable.strings */; };
8E212D84101212FF0078924A /* SymbolTableEntryTypeFormatter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8E212D83101212FF0078924A /* SymbolTableEntryTypeFormatter.mm */; };
8E49358B100A5714004B7E53 /* MachO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E493565100A53DA004B7E53 /* MachO.framework */; };
8E493597100A5871004B7E53 /* MachO.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 8E493565100A53DA004B7E53 /* MachO.framework */; };
8E493597100A5871004B7E53 /* MachO.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 8E493565100A53DA004B7E53 /* MachO.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
8EAEBA2310126AB100E1D5D2 /* SymbolTableController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8EAEBA2210126AB100E1D5D2 /* SymbolTableController.mm */; };
8EB56272104EA241006A44CD /* TreeControllerExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 8EB56271104EA241006A44CD /* TreeControllerExtension.m */; };
8EB5640E104FE62F006A44CD /* AutoExpandOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8EB5640D104FE62F006A44CD /* AutoExpandOutlineView.m */; };
@ -65,45 +66,46 @@
/* Begin PBXFileReference section */
1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FBA07B3F13500E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
27817EA31DE0C139000AA552 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
32DBCF750370BD2300C91783 /* MacDependency_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacDependency_Prefix.pch; sourceTree = "<group>"; };
32DBCF750370BD2300C91783 /* MacDependency_Prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacDependency_Prefix.h; sourceTree = "<group>"; };
8D15AC370486D014006FF6A4 /* MacDependency.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MacDependency.app; sourceTree = BUILT_PRODUCTS_DIR; };
8E1314F8100F7BFC00367510 /* MyDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDocument.h; sourceTree = "<group>"; };
8E1314F9100F7BFC00367510 /* MyDocument.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MyDocument.mm; sourceTree = "<group>"; };
8E1314FB100F7C0C00367510 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
8E1314F8100F7BFC00367510 /* MyDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDocument.h; sourceTree = "<group>"; wrapsLines = 0; };
8E1314F9100F7BFC00367510 /* MyDocument.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MyDocument.mm; sourceTree = "<group>"; wrapsLines = 0; };
8E1314FB100F7C0C00367510 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; wrapsLines = 0; };
8E1314FD100F7C1D00367510 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8E131500100F7C3C00367510 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = "<group>"; };
8E131502100F7C3C00367510 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
8E131502100F7C3C00367510 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
8E131504100F7C3C00367510 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
8E131506100F7C3C00367510 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MyDocument.xib; sourceTree = "<group>"; };
8E1315C4100F8F1400367510 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; };
8E212D82101212FF0078924A /* SymbolTableEntryTypeFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolTableEntryTypeFormatter.h; sourceTree = "<group>"; };
8E212D83101212FF0078924A /* SymbolTableEntryTypeFormatter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SymbolTableEntryTypeFormatter.mm; sourceTree = "<group>"; };
8E212D82101212FF0078924A /* SymbolTableEntryTypeFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolTableEntryTypeFormatter.h; sourceTree = "<group>"; wrapsLines = 0; };
8E212D83101212FF0078924A /* SymbolTableEntryTypeFormatter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SymbolTableEntryTypeFormatter.mm; sourceTree = "<group>"; wrapsLines = 0; };
8E493560100A53DA004B7E53 /* MachO.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MachO.xcodeproj; path = ../MachO/MachO.xcodeproj; sourceTree = SOURCE_ROOT; };
8EAEBA2110126AB100E1D5D2 /* SymbolTableController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolTableController.h; sourceTree = "<group>"; };
8EAEBA2210126AB100E1D5D2 /* SymbolTableController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SymbolTableController.mm; sourceTree = "<group>"; };
8EB56270104EA241006A44CD /* TreeControllerExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TreeControllerExtension.h; sourceTree = "<group>"; };
8EB56271104EA241006A44CD /* TreeControllerExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TreeControllerExtension.m; sourceTree = "<group>"; };
8EB56382104EF61E006A44CD /* ExtTreeModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtTreeModel.h; sourceTree = "<group>"; };
8EB5640C104FE62F006A44CD /* AutoExpandOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoExpandOutlineView.h; sourceTree = "<group>"; };
8EB5640D104FE62F006A44CD /* AutoExpandOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AutoExpandOutlineView.m; sourceTree = "<group>"; };
8EC4F15E10400F02001F9FB8 /* ArchitecturesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArchitecturesController.h; sourceTree = "<group>"; };
8EC4F15F10400F02001F9FB8 /* ArchitecturesController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ArchitecturesController.mm; sourceTree = "<group>"; };
8EC4F1681040126A001F9FB8 /* ArchitectureModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArchitectureModel.h; sourceTree = "<group>"; };
8EC4F1691040126A001F9FB8 /* ArchitectureModel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ArchitectureModel.mm; sourceTree = "<group>"; };
8ECFE3441061192D00685EDF /* PrioritySplitViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrioritySplitViewDelegate.h; sourceTree = "<group>"; };
8ECFE3451061192D00685EDF /* PrioritySplitViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PrioritySplitViewDelegate.m; sourceTree = "<group>"; };
8ED32F46100B68FF00EBF623 /* MachOModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachOModel.h; sourceTree = "<group>"; };
8ED32F47100B68FF00EBF623 /* MachOModel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MachOModel.mm; sourceTree = "<group>"; };
8ED330CC100BD19800EBF623 /* SymbolTableEntryModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolTableEntryModel.h; sourceTree = "<group>"; };
8ED330CD100BD19800EBF623 /* SymbolTableEntryModel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SymbolTableEntryModel.mm; sourceTree = "<group>"; };
8ED4567910516D6200FAC99F /* MyDocumentWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDocumentWindow.h; sourceTree = "<group>"; };
8ED4567A10516D6200FAC99F /* MyDocumentWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyDocumentWindow.m; sourceTree = "<group>"; };
8EFDEF78101007B300E4D54D /* ConversionStdString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConversionStdString.h; sourceTree = "<group>"; };
8EFDEF79101007B300E4D54D /* ConversionStdString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ConversionStdString.mm; sourceTree = "<group>"; };
8EFDEF9110100F1700E4D54D /* VersionFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VersionFormatter.h; sourceTree = "<group>"; };
8EFDEF9210100F1700E4D54D /* VersionFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VersionFormatter.m; sourceTree = "<group>"; };
8EAEBA2110126AB100E1D5D2 /* SymbolTableController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolTableController.h; sourceTree = "<group>"; wrapsLines = 0; };
8EAEBA2210126AB100E1D5D2 /* SymbolTableController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SymbolTableController.mm; sourceTree = "<group>"; wrapsLines = 0; };
8EB56270104EA241006A44CD /* TreeControllerExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TreeControllerExtension.h; sourceTree = "<group>"; wrapsLines = 0; };
8EB56271104EA241006A44CD /* TreeControllerExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TreeControllerExtension.m; sourceTree = "<group>"; wrapsLines = 0; };
8EB56382104EF61E006A44CD /* ExtTreeModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtTreeModel.h; sourceTree = "<group>"; wrapsLines = 0; };
8EB5640C104FE62F006A44CD /* AutoExpandOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoExpandOutlineView.h; sourceTree = "<group>"; wrapsLines = 0; };
8EB5640D104FE62F006A44CD /* AutoExpandOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AutoExpandOutlineView.m; sourceTree = "<group>"; wrapsLines = 0; };
8EC4F15E10400F02001F9FB8 /* ArchitecturesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArchitecturesController.h; sourceTree = "<group>"; wrapsLines = 0; };
8EC4F15F10400F02001F9FB8 /* ArchitecturesController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ArchitecturesController.mm; sourceTree = "<group>"; wrapsLines = 0; };
8EC4F1681040126A001F9FB8 /* ArchitectureModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArchitectureModel.h; sourceTree = "<group>"; wrapsLines = 0; };
8EC4F1691040126A001F9FB8 /* ArchitectureModel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ArchitectureModel.mm; sourceTree = "<group>"; wrapsLines = 0; };
8ECFE3441061192D00685EDF /* PrioritySplitViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrioritySplitViewDelegate.h; sourceTree = "<group>"; wrapsLines = 0; };
8ECFE3451061192D00685EDF /* PrioritySplitViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PrioritySplitViewDelegate.m; sourceTree = "<group>"; wrapsLines = 0; };
8ED32F46100B68FF00EBF623 /* MachOModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachOModel.h; sourceTree = "<group>"; wrapsLines = 0; };
8ED32F47100B68FF00EBF623 /* MachOModel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MachOModel.mm; sourceTree = "<group>"; wrapsLines = 0; };
8ED330CC100BD19800EBF623 /* SymbolTableEntryModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolTableEntryModel.h; sourceTree = "<group>"; wrapsLines = 0; };
8ED330CD100BD19800EBF623 /* SymbolTableEntryModel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SymbolTableEntryModel.mm; sourceTree = "<group>"; wrapsLines = 0; };
8ED4567910516D6200FAC99F /* MyDocumentWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDocumentWindow.h; sourceTree = "<group>"; wrapsLines = 0; };
8ED4567A10516D6200FAC99F /* MyDocumentWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyDocumentWindow.m; sourceTree = "<group>"; wrapsLines = 0; };
8EFDEF78101007B300E4D54D /* ConversionStdString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConversionStdString.h; sourceTree = "<group>"; wrapsLines = 0; };
8EFDEF79101007B300E4D54D /* ConversionStdString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ConversionStdString.mm; sourceTree = "<group>"; wrapsLines = 0; };
8EFDEF9110100F1700E4D54D /* VersionFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VersionFormatter.h; sourceTree = "<group>"; wrapsLines = 0; };
8EFDEF9210100F1700E4D54D /* VersionFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VersionFormatter.m; sourceTree = "<group>"; wrapsLines = 0; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -122,7 +124,6 @@
1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
8E493560100A53DA004B7E53 /* MachO.xcodeproj */,
1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
@ -149,6 +150,7 @@
2A37F4AAFDCFA73011CA2CEA /* MacDependency */ = {
isa = PBXGroup;
children = (
8E493560100A53DA004B7E53 /* MachO.xcodeproj */,
2A37F4ABFDCFA73011CA2CEA /* Classes */,
2A37F4AFFDCFA73011CA2CEA /* Other Sources */,
2A37F4B8FDCFA73011CA2CEA /* Resources */,
@ -196,7 +198,7 @@
isa = PBXGroup;
children = (
8E1314FB100F7C0C00367510 /* main.m */,
32DBCF750370BD2300C91783 /* MacDependency_Prefix.pch */,
32DBCF750370BD2300C91783 /* MacDependency_Prefix.h */,
);
name = "Other Sources";
sourceTree = "<group>";
@ -204,6 +206,7 @@
2A37F4B8FDCFA73011CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
27817EA31DE0C139000AA552 /* Images.xcassets */,
8E1314FF100F7C3C00367510 /* Credits.rtf */,
8E131501100F7C3C00367510 /* InfoPlist.strings */,
8E131503100F7C3C00367510 /* MainMenu.xib */,
@ -260,10 +263,11 @@
2A37F4A9FDCFA73011CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0810;
ORGANIZATIONNAME = "Konrad Windszus";
};
buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "MacDependency" */;
compatibilityVersion = "Xcode 3.1";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@ -302,6 +306,7 @@
8E131507100F7C3C00367510 /* Credits.rtf in Resources */,
8E131508100F7C3C00367510 /* InfoPlist.strings in Resources */,
8E131509100F7C3C00367510 /* MainMenu.xib in Resources */,
27817EA41DE0C139000AA552 /* Images.xcassets in Resources */,
8E13150A100F7C3C00367510 /* MyDocument.xib in Resources */,
8E1315C5100F8F1400367510 /* Localizable.strings in Resources */,
);
@ -388,54 +393,56 @@
C05733C808A9546B00998B17 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../MachO/build/Debug\"",
);
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = MacDependency_Prefix.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_BUNDLE_IDENTIFIER = "com.googlecode.${PRODUCT_NAME:identifier}";
PRODUCT_NAME = MacDependency;
SDKROOT = macosx10.6;
SDKROOT = macosx;
};
name = Debug;
};
C05733C908A9546B00998B17 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_OBJC_ARC = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../MachO/build/Release\"",
);
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = MacDependency_Prefix.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_BUNDLE_IDENTIFIER = "com.googlecode.${PRODUCT_NAME:identifier}";
PRODUCT_NAME = MacDependency;
SDKROOT = macosx10.6;
SDKROOT = macosx;
};
name = Release;
};
C05733CC08A9546B00998B17 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = MacDependency_Prefix.h;
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_VERSION = "";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
@ -447,28 +454,45 @@
GCC_WARN_SHADOW = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.5;
HEADER_SEARCH_PATHS = /opt/local/include;
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx10.5;
SDKROOT = macosx;
};
name = Debug;
};
C05733CD08A9546B00998B17 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_VERSION = "";
GCC_NO_COMMON_BLOCKS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = MacDependency_Prefix.h;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.5;
HEADER_SEARCH_PATHS = /opt/local/include;
MACOSX_DEPLOYMENT_TARGET = 10.7;
PREBINDING = NO;
SDKROOT = macosx10.5;
SDKROOT = macosx;
};
name = Release;
};

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D15AC270486D014006FF6A4"
BuildableName = "MacDependency.app"
BlueprintName = "MacDependency"
ReferencedContainer = "container:MacDependency.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D15AC270486D014006FF6A4"
BuildableName = "MacDependency.app"
BlueprintName = "MacDependency"
ReferencedContainer = "container:MacDependency.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D15AC270486D014006FF6A4"
BuildableName = "MacDependency.app"
BlueprintName = "MacDependency"
ReferencedContainer = "container:MacDependency.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D15AC270486D014006FF6A4"
BuildableName = "MacDependency.app"
BlueprintName = "MacDependency"
ReferencedContainer = "container:MacDependency.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,22 @@
//
// Prefix header for all source files of the 'MacDependency' target in the 'MacDependency' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
#ifdef __cplusplus
#include <string>
#include <vector>
#include <sstream>
#include <fstream>
#include <list>
#include <assert.h>
#include <map>
#include <mach-o/loader.h>
#include <mach-o/nlist.h>
#endif

View File

@ -1,7 +0,0 @@
//
// Prefix header for all source files of the 'MacDependency' target in the 'MacDependency' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif

View File

@ -15,7 +15,7 @@
@class MyDocument;
typedef enum State{
enum State {
StateNormal,
StateWarning,
StateError

View File

@ -30,7 +30,7 @@
- (id) initWithFile:(MachO*)aFile document:(MyDocument*)aDocument architecture:(MachOArchitecture*)anArchitecture loadChildren:(BOOL)loadChildren {
state = StateNormal;
[self initWithFile:aFile command:nil document:aDocument parent:nil architecture:anArchitecture];
if (!(self = [self initWithFile:aFile command:nil document:aDocument parent:nil architecture:anArchitecture])) return nil;
if (loadChildren) {
[self initChildren];
}
@ -40,8 +40,8 @@
// called by initChildren (calls initWithFile internally)
- (id) initWithFilename:(std::string&)filename command:(DylibCommand*)aCommand document:(MyDocument*)aDocument parent:(MachOModel*)aParent {
BOOL isWeakReference = (command && !command->isNecessary());
MachO* aFile;
MachOArchitecture* anArchitecture;
MachO* aFile = nullptr;
MachOArchitecture* anArchitecture = nullptr;
state = StateNormal;
try {
aFile = [aDocument cache]->getFile(filename, aParent->file); // throws exception in case file is not found
@ -59,7 +59,7 @@
// distinguish between weak and strong. In both cases append to tree with a status color
}
[aDocument incrementNumDependencies];
[self initWithFile:aFile command:aCommand document:aDocument parent:aParent architecture:anArchitecture];
if (!(self = [self initWithFile:aFile command:aCommand document:aDocument parent:aParent architecture:anArchitecture])) return nil;
return self;
}
@ -82,10 +82,6 @@
} return self;
}
- (void)dealloc {
[children release];
[super dealloc];
}
- (void) setStateWithWarning:(BOOL)isWarning {
State newState = StateError;
@ -139,7 +135,6 @@
}
// TODO: check for relative paths, since they can lead to problems
[versionFormatter release];
}
- (NSArray*)children {
@ -152,7 +147,6 @@
- (void) initChildren {
// TODO: tweak capacity
children = [NSMutableArray arrayWithCapacity:20];
[children retain];
if (architecture) {
std::string workingDirectory = [[document workingDirectory] stdString];
for (MachOArchitecture::LoadCommandsConstIterator it = architecture->getLoadCommandsBegin();
@ -164,11 +158,8 @@
DylibCommand* dylibCommand = dynamic_cast<DylibCommand*> (childLoadCommand);
if (dylibCommand != NULL && !dylibCommand->isId()) {
std::string filename = architecture->getResolvedName(dylibCommand->getName(), workingDirectory);
MachOModel* child = [MachOModel alloc];
[children addObject:child]; // must add children before initializing them, because in init we rely on parent children being correct
[child initWithFilename:filename command:dylibCommand document:document parent:self];
[child release];
[children addObject: [[MachOModel alloc] initWithFilename: filename command: dylibCommand document: document parent: self]];
}
}
}
@ -211,12 +202,9 @@
}
- (NSNumber*) size {
NSNumber* size = [NSNumber alloc];
if (file)
[size initWithUnsignedLongLong:file->getSize()];
else
[size initWithInt:0];
return size;
if (file != nullptr)
return @(file->getSize());
return @(0);
}
- (NSString*) name {
@ -285,7 +273,6 @@
[architectures addObject:currentArchitecture]; // insert at end
}
[currentArchitecture release];
}
}
return architectures;

View File

@ -43,10 +43,6 @@
- (void) dealloc
{
delete cache;
[splitViewDelegate release];
[contents release];
[log release];
[super dealloc];
}
@ -123,15 +119,12 @@
}
- (void)setLog:(NSAttributedString *)newLog {
[newLog retain];
[log release];
log = newLog;
}
- (void)clearLog {
NSAttributedString* newLog = [[NSAttributedString alloc] initWithString:@""];
[self setLog:newLog];
[newLog release];
}
- (void)appendLogLine:(NSString *)line withModel:(MachOModel*)model state:(State)state {
@ -160,9 +153,7 @@
NSAttributedString* newLogLine = [[NSAttributedString alloc]initWithString:newLine attributes:attributes];
[newLog appendAttributedString:newLogLine];
[newLogLine release];
[self setLog:newLog];
[newLog release];
}
- (NSString*) workingDirectory {
@ -175,13 +166,13 @@
- (NSString*) serializeIndexPath:(NSIndexPath*)indexPath {
NSMutableString* link = [NSMutableString stringWithCapacity:20];
for (int depth = 0; depth < [indexPath length]; depth++) {
[link appendFormat:@"%d;", [indexPath indexAtPosition:depth]];
[link appendFormat: @"%ld;", [indexPath indexAtPosition: depth]];
}
return link;
}
- (NSIndexPath*) deserializeIndexPath:(NSString*)link {
NSIndexPath* indexPath;
NSIndexPath* indexPath = nil;
// tokenize string
NSArray* indices = [link componentsSeparatedByString:@";"];
@ -190,7 +181,7 @@
NSEnumerator *enumerator = [indices objectEnumerator];
NSString* token = [enumerator nextObject];
if (token) {
indexPath = [NSIndexPath indexPathWithIndex:[token intValue]];
indexPath = [NSIndexPath indexPathWithIndex: [token intValue]];
while ((token = [enumerator nextObject])) {
if ([token length] > 0)
indexPath = [indexPath indexPathByAddingIndex:[token intValue]];
@ -202,7 +193,7 @@
// delegate method
- (BOOL)textView:(NSTextView *)aTextView clickedOnLink:(id)link atIndex:(NSUInteger)charIndex {
[dependenciesController setSelectedObject:link];
[dependenciesController setSelectedObject: link];
// we need no further processing of the link
return YES;
@ -232,7 +223,6 @@
[architectures addObject:currentArchitecture]; // insert at end
}
[currentArchitecture release];
}
}
return architectures;
@ -241,8 +231,7 @@
- (IBAction)clickRevealInFinder:(id)sender {
NSString* filename = [textFieldFilename stringValue];
[[NSWorkspace sharedWorkspace] selectFile:filename
inFileViewerRootedAtPath:nil];
[[NSWorkspace sharedWorkspace] selectFile: filename inFileViewerRootedAtPath: @""];
}

View File

@ -8,7 +8,7 @@
#import <Cocoa/Cocoa.h>
@interface PrioritySplitViewDelegate : NSObject
@interface PrioritySplitViewDelegate : NSObject <NSSplitViewDelegate>
{
NSMutableDictionary *lengthsByViewIndex;
NSMutableDictionary *viewIndicesByPriority;

View File

@ -6,7 +6,6 @@
// Copyright 2009 Konrad Windszus. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@class MyDocument;
@interface SymbolTableController : NSArrayController {
@ -24,6 +23,6 @@
- (BOOL)demangleNames;
- (BOOL*)demangleNamesPtr;
- (void)setDemangleNames:(BOOL)demangleNames;
- (void)setDemangleNames:(BOOL)demangle;
@end

View File

@ -63,8 +63,6 @@ const int TYPE[] = {SymbolTableEntry::TypeExported, SymbolTableEntry::TypeImport
- (void)setNameFilter:(NSPredicate*) newNameFilter {
[newNameFilter retain];
[nameFilter release];
nameFilter = newNameFilter;
[self setFilter];
}
@ -93,8 +91,8 @@ const int TYPE[] = {SymbolTableEntry::TypeExported, SymbolTableEntry::TypeImport
return &demangleNames;
}
- (void)setDemangleNames:(BOOL)demangleNames {
self->demangleNames = demangleNames;
- (void)setDemangleNames:(BOOL)demangle {
self->demangleNames = demangle;
// refresh
[self rearrangeObjects];

View File

@ -14,11 +14,11 @@
@implementation SymbolTableEntryModel
- (id) initWithEntry:(const SymbolTableEntry*)anEntry demangleNamesPtr:(BOOL*)demangleNames document:(MyDocument*)aDocument {
- (id) initWithEntry:(const SymbolTableEntry*)anEntry demangleNamesPtr:(BOOL*)demangle document:(MyDocument*)aDocument {
self = [super init];
if (self) {
entry = anEntry;
self->demangleNames = demangleNames;
self->demangleNames = demangle;
document = aDocument;
}
return self;
@ -26,7 +26,7 @@
- (NSString*) name {
try {
return [NSString stringWithStdString:entry->getName(*demangleNames)];
return [NSString stringWithStdString: entry->getName(*demangleNames)];
} catch (MachODemangleException& e) {
// in case of demangling problems (probably c++filt not installed)
NSString* error = NSLocalizedString(@"ERR_NO_DEMANGLER", nil);

View File

@ -6,14 +6,14 @@
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.googlecode.${PRODUCT_NAME:identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSignature</key>

View File

@ -3,116 +3,110 @@
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
8E131535100F7C6B00367510 /* demangler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131512100F7C6B00367510 /* demangler.cpp */; };
8E131536100F7C6B00367510 /* demangler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E131513100F7C6B00367510 /* demangler.h */; settings = {ATTRIBUTES = (); }; };
8E131537100F7C6B00367510 /* dylibcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131514100F7C6B00367510 /* dylibcommand.cpp */; };
8E131537100F7C6B00367510 /* dylibcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131514100F7C6B00367510 /* dylibcommand.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E131538100F7C6B00367510 /* dylibcommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E131515100F7C6B00367510 /* dylibcommand.h */; settings = {ATTRIBUTES = (Public, ); }; };
8E131539100F7C6B00367510 /* dynamicloader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131516100F7C6B00367510 /* dynamicloader.cpp */; };
8E131539100F7C6B00367510 /* dynamicloader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131516100F7C6B00367510 /* dynamicloader.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E13153A100F7C6B00367510 /* dynamicloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E131517100F7C6B00367510 /* dynamicloader.h */; };
8E13153B100F7C6B00367510 /* genericcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131518100F7C6B00367510 /* genericcommand.cpp */; };
8E13153B100F7C6B00367510 /* genericcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131518100F7C6B00367510 /* genericcommand.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E13153C100F7C6B00367510 /* genericcommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E131519100F7C6B00367510 /* genericcommand.h */; settings = {ATTRIBUTES = (Public, ); }; };
8E13153D100F7C6B00367510 /* internalfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13151A100F7C6B00367510 /* internalfile.cpp */; };
8E13153D100F7C6B00367510 /* internalfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13151A100F7C6B00367510 /* internalfile.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E13153E100F7C6B00367510 /* internalfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E13151B100F7C6B00367510 /* internalfile.h */; };
8E13153F100F7C6B00367510 /* loadcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13151C100F7C6B00367510 /* loadcommand.cpp */; };
8E13153F100F7C6B00367510 /* loadcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13151C100F7C6B00367510 /* loadcommand.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E131540100F7C6B00367510 /* loadcommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E13151D100F7C6B00367510 /* loadcommand.h */; settings = {ATTRIBUTES = (Public, ); }; };
8E131541100F7C6B00367510 /* macho.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13151E100F7C6B00367510 /* macho.cpp */; };
8E131541100F7C6B00367510 /* macho.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13151E100F7C6B00367510 /* macho.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E131542100F7C6B00367510 /* macho.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E13151F100F7C6B00367510 /* macho.h */; settings = {ATTRIBUTES = (Public, ); }; };
8E131543100F7C6B00367510 /* macho32header.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131520100F7C6B00367510 /* macho32header.cpp */; };
8E131543100F7C6B00367510 /* macho32header.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131520100F7C6B00367510 /* macho32header.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E131544100F7C6B00367510 /* macho32header.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E131521100F7C6B00367510 /* macho32header.h */; };
8E131545100F7C6B00367510 /* macho64header.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131522100F7C6B00367510 /* macho64header.cpp */; };
8E131545100F7C6B00367510 /* macho64header.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131522100F7C6B00367510 /* macho64header.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E131546100F7C6B00367510 /* macho64header.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E131523100F7C6B00367510 /* macho64header.h */; };
8E131547100F7C6B00367510 /* macho_global.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E131524100F7C6B00367510 /* macho_global.h */; settings = {ATTRIBUTES = (Public, ); }; };
8E131548100F7C6B00367510 /* machoarchitecture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131525100F7C6B00367510 /* machoarchitecture.cpp */; };
8E131548100F7C6B00367510 /* machoarchitecture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131525100F7C6B00367510 /* machoarchitecture.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E131549100F7C6B00367510 /* machoarchitecture.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E131526100F7C6B00367510 /* machoarchitecture.h */; settings = {ATTRIBUTES = (Public, ); }; };
8E13154A100F7C6B00367510 /* machoexception.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131527100F7C6B00367510 /* machoexception.cpp */; };
8E13154A100F7C6B00367510 /* machoexception.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131527100F7C6B00367510 /* machoexception.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E13154B100F7C6B00367510 /* machoexception.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E131528100F7C6B00367510 /* machoexception.h */; settings = {ATTRIBUTES = (Public, ); }; };
8E13154C100F7C6B00367510 /* machofile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131529100F7C6B00367510 /* machofile.cpp */; };
8E13154C100F7C6B00367510 /* machofile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131529100F7C6B00367510 /* machofile.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E13154D100F7C6B00367510 /* machofile.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E13152A100F7C6B00367510 /* machofile.h */; settings = {ATTRIBUTES = (Public, ); }; };
8E13154E100F7C6B00367510 /* machoheader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13152B100F7C6B00367510 /* machoheader.cpp */; };
8E13154E100F7C6B00367510 /* machoheader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13152B100F7C6B00367510 /* machoheader.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E13154F100F7C6B00367510 /* machoheader.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E13152C100F7C6B00367510 /* machoheader.h */; settings = {ATTRIBUTES = (Public, ); }; };
8E131550100F7C6B00367510 /* rpathcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13152D100F7C6B00367510 /* rpathcommand.cpp */; };
8E131550100F7C6B00367510 /* rpathcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13152D100F7C6B00367510 /* rpathcommand.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E131551100F7C6B00367510 /* rpathcommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E13152E100F7C6B00367510 /* rpathcommand.h */; };
8E131552100F7C6B00367510 /* symboltablecommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13152F100F7C6B00367510 /* symboltablecommand.cpp */; };
8E131552100F7C6B00367510 /* symboltablecommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13152F100F7C6B00367510 /* symboltablecommand.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E131553100F7C6B00367510 /* symboltablecommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E131530100F7C6B00367510 /* symboltablecommand.h */; settings = {ATTRIBUTES = (Public, ); }; };
8E131554100F7C6B00367510 /* symboltableentry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131531100F7C6B00367510 /* symboltableentry.cpp */; };
8E131554100F7C6B00367510 /* symboltableentry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131531100F7C6B00367510 /* symboltableentry.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E131555100F7C6B00367510 /* symboltableentry.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E131532100F7C6B00367510 /* symboltableentry.h */; settings = {ATTRIBUTES = (Public, ); }; };
8E131556100F7C6B00367510 /* symboltableentry32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131533100F7C6B00367510 /* symboltableentry32.cpp */; };
8E131556100F7C6B00367510 /* symboltableentry32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E131533100F7C6B00367510 /* symboltableentry32.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E131557100F7C6B00367510 /* symboltableentry32.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E131534100F7C6B00367510 /* symboltableentry32.h */; };
8E131571100F7DB600367510 /* symboltableentry64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13156F100F7DB600367510 /* symboltableentry64.cpp */; };
8E131571100F7DB600367510 /* symboltableentry64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E13156F100F7DB600367510 /* symboltableentry64.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E131572100F7DB600367510 /* symboltableentry64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E131570100F7DB600367510 /* symboltableentry64.h */; };
8E212E93101237A50078924A /* machodemangleexception.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E212E91101237A50078924A /* machodemangleexception.h */; settings = {ATTRIBUTES = (Public, ); }; };
8E212E94101237A50078924A /* machodemangleexception.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E212E92101237A50078924A /* machodemangleexception.cpp */; };
8E212E94101237A50078924A /* machodemangleexception.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E212E92101237A50078924A /* machodemangleexception.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8E49393F100AA468004B7E53 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E49393E100AA468004B7E53 /* CoreFoundation.framework */; };
8E8C73E1106AA95D0037CF19 /* libboost_filesystem.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E8C73DF106AA95D0037CF19 /* libboost_filesystem.a */; };
8E8C73E2106AA95D0037CF19 /* libboost_system.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E8C73E0106AA95D0037CF19 /* libboost_system.a */; };
8EA3DFF411AFD3790093CD87 /* uuidcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EA3DFF211AFD3790093CD87 /* uuidcommand.cpp */; };
8EA3DFF411AFD3790093CD87 /* uuidcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EA3DFF211AFD3790093CD87 /* uuidcommand.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8EA3DFF511AFD3790093CD87 /* uuidcommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EA3DFF311AFD3790093CD87 /* uuidcommand.h */; };
8EA3E17A11B12B5A0093CD87 /* dylinkercommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EA3E17811B12B5A0093CD87 /* dylinkercommand.cpp */; };
8EA3E17A11B12B5A0093CD87 /* dylinkercommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EA3E17811B12B5A0093CD87 /* dylinkercommand.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
8EA3E17B11B12B5A0093CD87 /* dylinkercommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EA3E17911B12B5A0093CD87 /* dylinkercommand.h */; };
8ED32FDE100B99EC00EBF623 /* machocache.h in Headers */ = {isa = PBXBuildFile; fileRef = 8ED32FDC100B99EC00EBF623 /* machocache.h */; settings = {ATTRIBUTES = (Public, ); }; };
8ED32FDF100B99EC00EBF623 /* machocache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8ED32FDD100B99EC00EBF623 /* machocache.cpp */; };
8ED32FDF100B99EC00EBF623 /* machocache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8ED32FDD100B99EC00EBF623 /* machocache.cpp */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
32DBCF5E0370ADEE00C91783 /* MachO_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachO_Prefix.pch; sourceTree = "<group>"; };
32DBCF5E0370ADEE00C91783 /* MachO_Prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachO_Prefix.h; sourceTree = "<group>"; wrapsLines = 0; };
8DC2EF5B0486A6940098B216 /* MachO.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MachO.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8E131512100F7C6B00367510 /* demangler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = demangler.cpp; sourceTree = "<group>"; };
8E131513100F7C6B00367510 /* demangler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = demangler.h; sourceTree = "<group>"; };
8E131514100F7C6B00367510 /* dylibcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dylibcommand.cpp; sourceTree = "<group>"; };
8E131515100F7C6B00367510 /* dylibcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dylibcommand.h; sourceTree = "<group>"; };
8E131516100F7C6B00367510 /* dynamicloader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dynamicloader.cpp; sourceTree = "<group>"; };
8E131517100F7C6B00367510 /* dynamicloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dynamicloader.h; sourceTree = "<group>"; };
8E131518100F7C6B00367510 /* genericcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = genericcommand.cpp; sourceTree = "<group>"; };
8E131519100F7C6B00367510 /* genericcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = genericcommand.h; sourceTree = "<group>"; };
8E13151A100F7C6B00367510 /* internalfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = internalfile.cpp; sourceTree = "<group>"; };
8E13151B100F7C6B00367510 /* internalfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internalfile.h; sourceTree = "<group>"; };
8E13151C100F7C6B00367510 /* loadcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = loadcommand.cpp; sourceTree = "<group>"; };
8E13151D100F7C6B00367510 /* loadcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = loadcommand.h; sourceTree = "<group>"; };
8E13151E100F7C6B00367510 /* macho.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macho.cpp; sourceTree = "<group>"; };
8E13151F100F7C6B00367510 /* macho.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macho.h; sourceTree = "<group>"; };
8E131520100F7C6B00367510 /* macho32header.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macho32header.cpp; sourceTree = "<group>"; };
8E131521100F7C6B00367510 /* macho32header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macho32header.h; sourceTree = "<group>"; };
8E131522100F7C6B00367510 /* macho64header.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macho64header.cpp; sourceTree = "<group>"; };
8E131523100F7C6B00367510 /* macho64header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macho64header.h; sourceTree = "<group>"; };
8E131524100F7C6B00367510 /* macho_global.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macho_global.h; sourceTree = "<group>"; };
8E131525100F7C6B00367510 /* machoarchitecture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = machoarchitecture.cpp; sourceTree = "<group>"; };
8E131526100F7C6B00367510 /* machoarchitecture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machoarchitecture.h; sourceTree = "<group>"; };
8E131527100F7C6B00367510 /* machoexception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = machoexception.cpp; sourceTree = "<group>"; };
8E131528100F7C6B00367510 /* machoexception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machoexception.h; sourceTree = "<group>"; };
8E131529100F7C6B00367510 /* machofile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = machofile.cpp; sourceTree = "<group>"; };
8E13152A100F7C6B00367510 /* machofile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machofile.h; sourceTree = "<group>"; };
8E13152B100F7C6B00367510 /* machoheader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = machoheader.cpp; sourceTree = "<group>"; };
8E13152C100F7C6B00367510 /* machoheader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machoheader.h; sourceTree = "<group>"; };
8E13152D100F7C6B00367510 /* rpathcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rpathcommand.cpp; sourceTree = "<group>"; };
8E13152E100F7C6B00367510 /* rpathcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpathcommand.h; sourceTree = "<group>"; };
8E13152F100F7C6B00367510 /* symboltablecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = symboltablecommand.cpp; sourceTree = "<group>"; };
8E131530100F7C6B00367510 /* symboltablecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = symboltablecommand.h; sourceTree = "<group>"; };
8E131531100F7C6B00367510 /* symboltableentry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = symboltableentry.cpp; sourceTree = "<group>"; };
8E131532100F7C6B00367510 /* symboltableentry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = symboltableentry.h; sourceTree = "<group>"; };
8E131533100F7C6B00367510 /* symboltableentry32.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = symboltableentry32.cpp; sourceTree = "<group>"; };
8E131534100F7C6B00367510 /* symboltableentry32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = symboltableentry32.h; sourceTree = "<group>"; };
8E131514100F7C6B00367510 /* dylibcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dylibcommand.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E131515100F7C6B00367510 /* dylibcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dylibcommand.h; sourceTree = "<group>"; wrapsLines = 0; };
8E131516100F7C6B00367510 /* dynamicloader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dynamicloader.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E131517100F7C6B00367510 /* dynamicloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dynamicloader.h; sourceTree = "<group>"; wrapsLines = 0; };
8E131518100F7C6B00367510 /* genericcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = genericcommand.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E131519100F7C6B00367510 /* genericcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = genericcommand.h; sourceTree = "<group>"; wrapsLines = 0; };
8E13151A100F7C6B00367510 /* internalfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = internalfile.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E13151B100F7C6B00367510 /* internalfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internalfile.h; sourceTree = "<group>"; wrapsLines = 0; };
8E13151C100F7C6B00367510 /* loadcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = loadcommand.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E13151D100F7C6B00367510 /* loadcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = loadcommand.h; sourceTree = "<group>"; wrapsLines = 0; };
8E13151E100F7C6B00367510 /* macho.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macho.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E13151F100F7C6B00367510 /* macho.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macho.h; sourceTree = "<group>"; wrapsLines = 0; };
8E131520100F7C6B00367510 /* macho32header.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macho32header.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E131521100F7C6B00367510 /* macho32header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macho32header.h; sourceTree = "<group>"; wrapsLines = 0; };
8E131522100F7C6B00367510 /* macho64header.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macho64header.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E131523100F7C6B00367510 /* macho64header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macho64header.h; sourceTree = "<group>"; wrapsLines = 0; };
8E131524100F7C6B00367510 /* macho_global.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macho_global.h; sourceTree = "<group>"; wrapsLines = 0; };
8E131525100F7C6B00367510 /* machoarchitecture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = machoarchitecture.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E131526100F7C6B00367510 /* machoarchitecture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machoarchitecture.h; sourceTree = "<group>"; wrapsLines = 0; };
8E131527100F7C6B00367510 /* machoexception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = machoexception.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E131528100F7C6B00367510 /* machoexception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machoexception.h; sourceTree = "<group>"; wrapsLines = 0; };
8E131529100F7C6B00367510 /* machofile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = machofile.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E13152A100F7C6B00367510 /* machofile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machofile.h; sourceTree = "<group>"; wrapsLines = 0; };
8E13152B100F7C6B00367510 /* machoheader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = machoheader.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E13152C100F7C6B00367510 /* machoheader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machoheader.h; sourceTree = "<group>"; wrapsLines = 0; };
8E13152D100F7C6B00367510 /* rpathcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rpathcommand.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E13152E100F7C6B00367510 /* rpathcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpathcommand.h; sourceTree = "<group>"; wrapsLines = 0; };
8E13152F100F7C6B00367510 /* symboltablecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = symboltablecommand.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E131530100F7C6B00367510 /* symboltablecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = symboltablecommand.h; sourceTree = "<group>"; wrapsLines = 0; };
8E131531100F7C6B00367510 /* symboltableentry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = symboltableentry.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E131532100F7C6B00367510 /* symboltableentry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = symboltableentry.h; sourceTree = "<group>"; wrapsLines = 0; };
8E131533100F7C6B00367510 /* symboltableentry32.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = symboltableentry32.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E131534100F7C6B00367510 /* symboltableentry32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = symboltableentry32.h; sourceTree = "<group>"; wrapsLines = 0; };
8E131558100F7C9200367510 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8E13156F100F7DB600367510 /* symboltableentry64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = symboltableentry64.cpp; sourceTree = "<group>"; };
8E131570100F7DB600367510 /* symboltableentry64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = symboltableentry64.h; sourceTree = "<group>"; };
8E212E91101237A50078924A /* machodemangleexception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machodemangleexception.h; sourceTree = "<group>"; };
8E212E92101237A50078924A /* machodemangleexception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = machodemangleexception.cpp; sourceTree = "<group>"; };
8E13156F100F7DB600367510 /* symboltableentry64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = symboltableentry64.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E131570100F7DB600367510 /* symboltableentry64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = symboltableentry64.h; sourceTree = "<group>"; wrapsLines = 0; };
8E212E91101237A50078924A /* machodemangleexception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machodemangleexception.h; sourceTree = "<group>"; wrapsLines = 0; };
8E212E92101237A50078924A /* machodemangleexception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = machodemangleexception.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8E49393E100AA468004B7E53 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
8E8C73DF106AA95D0037CF19 /* libboost_filesystem.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libboost_filesystem.a; path = /usr/local/lib/static/libboost_filesystem.a; sourceTree = "<absolute>"; };
8E8C73E0106AA95D0037CF19 /* libboost_system.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libboost_system.a; path = /usr/local/lib/static/libboost_system.a; sourceTree = "<absolute>"; };
8EA3DFF211AFD3790093CD87 /* uuidcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = uuidcommand.cpp; sourceTree = "<group>"; };
8EA3DFF311AFD3790093CD87 /* uuidcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uuidcommand.h; sourceTree = "<group>"; };
8EA3E17811B12B5A0093CD87 /* dylinkercommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dylinkercommand.cpp; sourceTree = "<group>"; };
8EA3E17911B12B5A0093CD87 /* dylinkercommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dylinkercommand.h; sourceTree = "<group>"; };
8ED32FDC100B99EC00EBF623 /* machocache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machocache.h; sourceTree = "<group>"; };
8ED32FDD100B99EC00EBF623 /* machocache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = machocache.cpp; sourceTree = "<group>"; };
8EA3DFF211AFD3790093CD87 /* uuidcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = uuidcommand.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8EA3DFF311AFD3790093CD87 /* uuidcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uuidcommand.h; sourceTree = "<group>"; wrapsLines = 0; };
8EA3E17811B12B5A0093CD87 /* dylinkercommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dylinkercommand.cpp; sourceTree = "<group>"; wrapsLines = 0; };
8EA3E17911B12B5A0093CD87 /* dylinkercommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dylinkercommand.h; sourceTree = "<group>"; wrapsLines = 0; };
8ED32FDC100B99EC00EBF623 /* machocache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machocache.h; sourceTree = "<group>"; wrapsLines = 0; };
8ED32FDD100B99EC00EBF623 /* machocache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = machocache.cpp; sourceTree = "<group>"; wrapsLines = 0; };
D2F7E79907B2D74100F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
@ -122,8 +116,6 @@
buildActionMask = 2147483647;
files = (
8E49393F100AA468004B7E53 /* CoreFoundation.framework in Frameworks */,
8E8C73E1106AA95D0037CF19 /* libboost_filesystem.a in Frameworks */,
8E8C73E2106AA95D0037CF19 /* libboost_system.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -175,8 +167,6 @@
8EA3E17911B12B5A0093CD87 /* dylinkercommand.h */,
8EA3DFF211AFD3790093CD87 /* uuidcommand.cpp */,
8EA3DFF311AFD3790093CD87 /* uuidcommand.h */,
8E131512100F7C6B00367510 /* demangler.cpp */,
8E131513100F7C6B00367510 /* demangler.h */,
8E131514100F7C6B00367510 /* dylibcommand.cpp */,
8E131515100F7C6B00367510 /* dylibcommand.h */,
8E131516100F7C6B00367510 /* dynamicloader.cpp */,
@ -243,7 +233,7 @@
32C88DFF0371C24200C91783 /* Other Sources */ = {
isa = PBXGroup;
children = (
32DBCF5E0370ADEE00C91783 /* MachO_Prefix.pch */,
32DBCF5E0370ADEE00C91783 /* MachO_Prefix.h */,
);
name = "Other Sources";
sourceTree = "<group>";
@ -256,7 +246,6 @@
buildActionMask = 2147483647;
files = (
8ED32FDE100B99EC00EBF623 /* machocache.h in Headers */,
8E131536100F7C6B00367510 /* demangler.h in Headers */,
8E131538100F7C6B00367510 /* dylibcommand.h in Headers */,
8E13153A100F7C6B00367510 /* dynamicloader.h in Headers */,
8E13153C100F7C6B00367510 /* genericcommand.h in Headers */,
@ -308,8 +297,11 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0810;
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "MachO" */;
compatibilityVersion = "Xcode 3.1";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@ -342,7 +334,6 @@
buildActionMask = 2147483647;
files = (
8ED32FDF100B99EC00EBF623 /* machocache.cpp in Sources */,
8E131535100F7C6B00367510 /* demangler.cpp in Sources */,
8E131537100F7C6B00367510 /* dylibcommand.cpp in Sources */,
8E131539100F7C6B00367510 /* dynamicloader.cpp in Sources */,
8E13153B100F7C6B00367510 /* genericcommand.cpp in Sources */,
@ -384,7 +375,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@ -394,20 +385,19 @@
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = MachO_Prefix.pch;
GCC_PREFIX_HEADER = MachO_Prefix.h;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES;
GCC_WARN_INHIBIT_ALL_WARNINGS = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
HEADER_SEARCH_PATHS = /usr/local/include;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "@executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = /usr/local/lib/static;
OTHER_LDFLAGS = "-Wl,-search_paths_first";
PRODUCT_BUNDLE_IDENTIFIER = "com.googlecode.${PRODUCT_NAME:identifier}";
PRODUCT_NAME = MachO;
SDKROOT = macosx10.6;
SDKROOT = macosx;
WRAPPER_EXTENSION = framework;
};
name = Debug;
@ -415,7 +405,7 @@
1DEB91AF08733DA50010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
DEAD_CODE_STRIPPING = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 1;
@ -423,14 +413,13 @@
FRAMEWORK_VERSION = A;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = MachO_Prefix.pch;
HEADER_SEARCH_PATHS = /usr/local/include;
GCC_PREFIX_HEADER = MachO_Prefix.h;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "@executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = /usr/local/lib/static;
OTHER_LDFLAGS = "-Wl,-search_paths_first";
PRODUCT_BUNDLE_IDENTIFIER = "com.googlecode.${PRODUCT_NAME:identifier}";
PRODUCT_NAME = MachO;
SDKROOT = macosx10.6;
SDKROOT = macosx;
WRAPPER_EXTENSION = framework;
};
name = Release;
@ -438,28 +427,61 @@
1DEB91B208733DA50010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DEPLOYMENT_LOCATION = NO;
GCC_C_LANGUAGE_STANDARD = c99;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx10.5;
SDKROOT = macosx;
};
name = Debug;
};
1DEB91B308733DA50010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_C_LANGUAGE_STANDARD = c99;
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
PREBINDING = NO;
SDKROOT = macosx10.5;
SDKROOT = macosx;
};
name = Release;
};

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DC2EF4F0486A6940098B216"
BuildableName = "MachO.framework"
BlueprintName = "MachO"
ReferencedContainer = "container:MachO.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DC2EF4F0486A6940098B216"
BuildableName = "MachO.framework"
BlueprintName = "MachO"
ReferencedContainer = "container:MachO.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DC2EF4F0486A6940098B216"
BuildableName = "MachO.framework"
BlueprintName = "MachO"
ReferencedContainer = "container:MachO.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

26
MachO/MachO_Prefix.h Normal file
View File

@ -0,0 +1,26 @@
//
// Prefix header for all source files of the 'MachO' target in the 'MachO' project.
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
#include <string>
#include <vector>
#include <sstream>
#include <fstream>
#include <list>
#include <assert.h>
#include <map>
#include <mach-o/loader.h>
#include <mach-o/nlist.h>
#include <cxxabi.h>
#include <stdlib.h>
#include <pwd.h>
#include <unistd.h>
#include <sys/param.h>
#include <sys/stat.h>

View File

@ -1,7 +0,0 @@
//
// Prefix header for all source files of the 'MachO' target in the 'MachO' project.
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif

View File

@ -1,50 +0,0 @@
#include "demangler.h"
#include "machodemangleexception.h"
using namespace boost::process;
/**
class for using c++flt to demangle names. Uses Boost.Process from http://www.highscore.de/cpp/process/index.html
*/
Demangler::Demangler() : child(NULL), isRunning(false)
{
init();
}
Demangler::~Demangler()
{
if (child)
child->terminate();
delete child;
}
string Demangler::demangleName(const string& name) {
if (isRunning){
(*stdin) << name << endl;
string line;
getline(*stdout, line);
return line;
} else {
throw MachODemangleException("Could not find/start process c++flt.");
}
}
void Demangler::init() {
try {
std::string exec = find_executable_in_path("c++filt");
std::vector<std::string> args;
args.push_back("--strip-underscore");
context ctx;
ctx.environment = self::get_environment();
ctx.stdout_behavior = capture_stream();
ctx.stdin_behavior = capture_stream();
child = new boost::process::child(launch(exec, args, ctx));
stdout = &child->get_stdout();
stdin = &child->get_stdin();
isRunning = true;
// TODO: check exceptions
} catch (boost::filesystem::filesystem_error& e) {
// errors during finding executable
} catch (boost::system::system_error& e2) {
// errors during starting of process
}
}

View File

@ -1,24 +0,0 @@
#ifndef DEMANGLER_H
#define DEMANGLER_H
#include "macho_global.h"
#include <boost/process.hpp>
class Demangler
{
public:
Demangler();
virtual ~Demangler();
string demangleName(const string& name);
private:
boost::process::child* child;
boost::process::pistream* stdout;
boost::process::postream* stdin;
bool isRunning;
void init();
private:
};
#endif // DEMANGLER_H

View File

@ -1,7 +1,6 @@
#include "dylibcommand.h"
#include "machofile.h"
#include "machoheader.h"
#include <sstream>
#define HIBYTE(x) ( (unsigned char) ((x) >> 8) )
#define LOBYTE(x) ( (unsigned char) (x) )
@ -11,38 +10,38 @@
#define MAKEVERSION(x,y,z) 0x00000000 | (x << 16) | (y << 8) | z
DylibCommand::DylibCommand(MachOHeader* header, DependencyType type) :
LoadCommand(header), type(type)
LoadCommand(header), type(type)
{
file.readBytes((char*)&command, sizeof(command));
file.readBytes((char*)&command, sizeof(command));
}
DylibCommand::~DylibCommand() {
}
unsigned int DylibCommand::getSize() const {
return file.getUint32(command.cmdsize);
return file.getUint32(command.cmdsize);
}
string DylibCommand::getName() const {
return string(getLcDataString(command.dylib.name.offset));
std::string DylibCommand::getName() const {
return getLcDataString(command.dylib.name.offset);
}
unsigned int DylibCommand::getCurrentVersion() const {
return file.getUint32(command.dylib.current_version);
return file.getUint32(command.dylib.current_version);
}
unsigned int DylibCommand::getCompatibleVersion() const {
return file.getUint32(command.dylib.compatibility_version);
return file.getUint32(command.dylib.compatibility_version);
}
time_t DylibCommand::getTimeStamp() const {
return file.getUint32(command.dylib.timestamp);
return file.getUint32(command.dylib.timestamp);
}
string DylibCommand::getVersionString(unsigned int version) {
stringstream versionString;
versionString << HIWORD(version) << "." << (unsigned short)HIBYTE(LOWORD(version)) << "." << (unsigned short)LOBYTE(LOWORD(version));
return versionString.str();
std::string DylibCommand::getVersionString(unsigned int version) {
std::stringstream versionString;
versionString << HIWORD(version) << "." << (unsigned short)HIBYTE(LOWORD(version)) << "." << (unsigned short)LOBYTE(LOWORD(version));
return versionString.str();
}

View File

@ -20,11 +20,11 @@ public:
bool isId() const { return type==DependencyId; }
bool isNecessary() const { return type!=DependencyWeak; }
DependencyType getType() const { return type; }
string getName() const;
std::string getName() const;
unsigned int getCurrentVersion() const;
unsigned int getCompatibleVersion() const;
time_t getTimeStamp() const;
static string getVersionString(unsigned int version);
static std::string getVersionString(unsigned int version);
private:
dylib_command command;

View File

@ -15,7 +15,7 @@ unsigned int DylinkerCommand::getSize() const {
return file.getUint32(command.cmdsize);
}
string DylinkerCommand::getName() const {
return string(getLcDataString(command.name.offset));
std::string DylinkerCommand::getName() const {
return getLcDataString(command.name.offset);
}

View File

@ -10,7 +10,7 @@ public:
virtual ~DylinkerCommand();
virtual unsigned int getSize() const;
virtual unsigned int getStructureSize() const { return sizeof(command); }
string getName() const;
std::string getName() const;
private:
dylinker_command command;

View File

@ -2,7 +2,6 @@
#include "machofile.h"
#include "machoarchitecture.h"
#include <boost/filesystem.hpp>
#include <pwd.h>
#include <stdlib.h>
#include <sstream>
@ -17,323 +16,321 @@
const char DynamicLoader::EnvironmentPathVariable::PATHS_SEPARATOR = ':';
DynamicLoader::EnvironmentPathVariable::EnvironmentPathVariable() {
// never call that explicitly
// never call that explicitly
}
DynamicLoader::EnvironmentPathVariable::EnvironmentPathVariable(const char* homePath, const string& name, const StringList& defaultValues)
DynamicLoader::EnvironmentPathVariable::EnvironmentPathVariable(const char* homePath, const std::string& name, const StringList& defaultValues)
{
this->homePath = homePath;
const char* envValue = getenv(name.c_str());
string values;
if (envValue) {
values = envValue;
}
if (!values.empty()) {
std::stringstream v(values);
std::string item;
while (std::getline(v, item, PATHS_SEPARATOR)) {
addPath(item);
}
} else {
setPaths(defaultValues);
this->homePath = homePath;
const char* envValue = getenv(name.c_str());
std::string values;
if (envValue) {
values = envValue;
}
if (!values.empty()) {
std::stringstream v(values);
std::string item;
while (std::getline(v, item, PATHS_SEPARATOR)) {
addPath(item);
}
} else {
setPaths(defaultValues);
}
}
void DynamicLoader::EnvironmentPathVariable::setPaths(const StringList& paths) {
this->paths = paths;
for (StringList::iterator it = this->paths.begin(); it!=this->paths.end(); ++it) {
replaceHomeDirectory(*it);
}
this->paths = paths;
for (StringList::iterator it = this->paths.begin(); it!=this->paths.end(); ++it) {
replaceHomeDirectory(*it);
}
}
void DynamicLoader::EnvironmentPathVariable::addPath(const string& path) {
paths.push_back(path);
replaceHomeDirectory(paths.back());
void DynamicLoader::EnvironmentPathVariable::addPath(const std::string& path) {
paths.push_back(path);
replaceHomeDirectory(paths.back());
}
bool DynamicLoader::EnvironmentPathVariable::replaceHomeDirectory(string& path) {
size_t homePos = path.find("~/");
if (homePos != string::npos) {
path.replace(homePos, 1, homePath);
return true;
}
return false;
bool DynamicLoader::EnvironmentPathVariable::replaceHomeDirectory(std::string& path) {
size_t homePos = path.find("~/");
if (homePos != std::string::npos) {
path.replace(homePos, 1, homePath);
return true;
}
return false;
}
bool DynamicLoader::EnvironmentPathVariable::isEmpty() const {
if (!paths.empty()) {
return paths.front().empty();
}
return true;
if (!paths.empty()) {
return paths.front().empty();
}
return true;
}
// the order must be the order of the enum!
const char* DynamicLoader::ENVIRONMENT_VARIABLE_NAMES[DynamicLoader::NumEnvironmentVariables] = {
"LD_LIBRARY_PATH",
"DYLD_FRAMEWORK_PATH",
"DYLD_LIBRARY_PATH",
"DYLD_FALLBACK_FRAMEWORK_PATH",
"DYLD_FALLBACK_LIBRARY_PATH",
"DYLD_IMAGE_SUFFIX"
"LD_LIBRARY_PATH",
"DYLD_FRAMEWORK_PATH",
"DYLD_LIBRARY_PATH",
"DYLD_FALLBACK_FRAMEWORK_PATH",
"DYLD_FALLBACK_LIBRARY_PATH",
"DYLD_IMAGE_SUFFIX"
};
const char* DynamicLoader::PLACEHOLDERS[DynamicLoader::NumPlaceholders] = {
"@executable_path",
"@loader_path",
"@rpath"
"@executable_path",
"@loader_path",
"@rpath"
};
const char* DynamicLoader::PATH_SEPARATOR = "/";
const char* DynamicLoader::DEFAULT_FRAMEWORK_PATH[] = {
"~/Library/Frameworks",
"/Library/Frameworks",
"/Network/Library/Frameworks",
"/System/Library/Frameworks"
"~/Library/Frameworks",
"/Library/Frameworks",
"/Network/Library/Frameworks",
"/System/Library/Frameworks"
};
const char* DynamicLoader::DEFAULT_LIBRARY_PATH[] = {
"~/lib",
"/usr/local/lib",
"/lib",
"/usr/lib"
"~/lib",
"/usr/local/lib",
"/lib",
"/usr/lib"
};
// unfortunately cannot make stringList const here, but treat it as const
const StringList DynamicLoader::ENVIRONMENT_VARIABLE_DEFAULT_VALUES[DynamicLoader::NumEnvironmentVariables] = {
StringList(),
StringList(),
StringList(),
StringList(DEFAULT_FRAMEWORK_PATH, DEFAULT_FRAMEWORK_PATH + sizeof(DEFAULT_FRAMEWORK_PATH) / sizeof(*DEFAULT_FRAMEWORK_PATH)),
StringList(DEFAULT_LIBRARY_PATH, DEFAULT_LIBRARY_PATH + sizeof(DEFAULT_LIBRARY_PATH) / sizeof(*DEFAULT_LIBRARY_PATH)),
StringList()
StringList(),
StringList(),
StringList(),
StringList(DEFAULT_FRAMEWORK_PATH, DEFAULT_FRAMEWORK_PATH + sizeof(DEFAULT_FRAMEWORK_PATH) / sizeof(*DEFAULT_FRAMEWORK_PATH)),
StringList(DEFAULT_LIBRARY_PATH, DEFAULT_LIBRARY_PATH + sizeof(DEFAULT_LIBRARY_PATH) / sizeof(*DEFAULT_LIBRARY_PATH)),
StringList()
};
DynamicLoader::DynamicLoader()
{
homePath = strdup(getUserHomeDirectory());
// init/read out some variables
for (unsigned int i=0; i < NumEnvironmentVariables; i++) {
environmentVariables[i] = EnvironmentPathVariable(homePath, ENVIRONMENT_VARIABLE_NAMES[i], ENVIRONMENT_VARIABLE_DEFAULT_VALUES[i]);
}
homePath = strdup(getUserHomeDirectory());
// init/read out some variables
for (unsigned int i=0; i < NumEnvironmentVariables; i++) {
environmentVariables[i] = EnvironmentPathVariable(homePath, ENVIRONMENT_VARIABLE_NAMES[i], ENVIRONMENT_VARIABLE_DEFAULT_VALUES[i]);
}
}
DynamicLoader::~DynamicLoader() {
free((void*)homePath);
free((void*)homePath);
}
const char* DynamicLoader::getUserHomeDirectory() const {
struct passwd* pwd = getpwuid(getuid());
if (pwd)
{
return pwd->pw_dir;
}
else
{
// try the $HOME environment variable
return getenv("HOME");
}
struct passwd* pwd = getpwuid(getuid());
if (pwd)
{
return pwd->pw_dir;
}
else
{
// try the $HOME environment variable
return getenv("HOME");
}
}
string DynamicLoader::replacePlaceholder(const string& name, const MachOArchitecture* architecture) const {
string resolvedName = name;
if (name.find(PLACEHOLDERS[ExecutablePath]) == 0) {
resolvedName.replace(0, strlen(PLACEHOLDERS[ExecutablePath]), architecture->getFile()->getExecutablePath());
} else if (name.find(PLACEHOLDERS[LoaderPath]) == 0) {
resolvedName.replace(0, strlen(PLACEHOLDERS[LoaderPath]), architecture->getFile()->getPath());
}
return resolvedName;
std::string DynamicLoader::replacePlaceholder(const std::string& name, const MachOArchitecture* architecture) const {
std::string resolvedName = name;
if (name.find(PLACEHOLDERS[ExecutablePath]) == 0) {
resolvedName.replace(0, strlen(PLACEHOLDERS[ExecutablePath]), architecture->getFile()->getExecutablePath());
} else if (name.find(PLACEHOLDERS[LoaderPath]) == 0) {
resolvedName.replace(0, strlen(PLACEHOLDERS[LoaderPath]), architecture->getFile()->getPath());
}
return resolvedName;
}
string DynamicLoader::getPathname(const string& name, const MachOArchitecture* architecture, const string& workingPath) const {
// simple name (only the last part of the name, after the last PATH_SEPARATOR)
size_t lastSlashPosition = name.rfind(PATH_SEPARATOR);
string simpleName;
if (lastSlashPosition != string::npos && lastSlashPosition < name.length() - 1) {
simpleName = name.substr(lastSlashPosition+1);
} else {
simpleName = name;
}
// try LD_LIBRARY_PATH
string pathName;
pathName = getExistingPathname(simpleName, environmentVariables[LdLibraryPath], workingPath);
std::string DynamicLoader::getPathname(const std::string& name, const MachOArchitecture* architecture, const std::string& workingPath) const {
// simple name (only the last part of the name, after the last PATH_SEPARATOR)
size_t lastSlashPosition = name.rfind(PATH_SEPARATOR);
std::string simpleName;
if (lastSlashPosition != std::string::npos && lastSlashPosition < name.length() - 1) {
simpleName = name.substr(lastSlashPosition+1);
} else {
simpleName = name;
}
// try LD_LIBRARY_PATH
std::string pathName;
pathName = getExistingPathname(simpleName, environmentVariables[LdLibraryPath], workingPath);
if (!pathName.empty())
return pathName;
std::string frameworkName = getFrameworkName(name);
if (!frameworkName.empty()) {
// strip the already contained suffix
pathName = getExistingPathname(frameworkName, environmentVariables[DyldFrameworkPath], workingPath);
if (!pathName.empty())
return pathName;
string frameworkName = getFrameworkName(name);
if (!frameworkName.empty()) {
// strip the already contained suffix
pathName = getExistingPathname(frameworkName, environmentVariables[DyldFrameworkPath], workingPath);
if (!pathName.empty())
return pathName;
}
pathName = getExistingPathname(simpleName, environmentVariables[DyldLibraryPath], workingPath);
return pathName;
}
pathName = getExistingPathname(simpleName, environmentVariables[DyldLibraryPath], workingPath);
if (!pathName.empty())
return pathName;
// resolve placeholder
std::string resolvedName = replacePlaceholder(name, architecture);
if (!resolvedName.empty()) {
pathName = getExistingPathname(resolvedName, workingPath);
if (!pathName.empty())
return pathName;
}
if (name.find(PLACEHOLDERS[Rpath]) == 0) {
// substitute @rpath with all -rpath paths up the load chain
std::vector<std::string*> rpaths = architecture->getRpaths();
for (std::vector<std::string*>::iterator it = rpaths.begin(); it != rpaths.end(); ++it) {
// rpath may contain @loader_path or @executable_path
std::string rpath = replacePlaceholder((**it), architecture);
resolvedName = name;
resolvedName.replace(0, strlen(PLACEHOLDERS[Rpath]), rpath);
pathName = getExistingPathname(resolvedName, workingPath);
if (!pathName.empty())
return pathName;
// resolve placeholder
string resolvedName = replacePlaceholder(name, architecture);
if (!resolvedName.empty()) {
}
// after checking against all stored rpaths substitute @rpath with LD_LIBRARY_PATH (if it is set)
EnvironmentPathVariable ldLibraryPaths = environmentVariables[LdLibraryPath];
if (!ldLibraryPaths.isEmpty()) {
for (StringList::const_iterator it = ldLibraryPaths.getPaths().begin(); it != ldLibraryPaths.getPaths().end(); ++it) {
resolvedName = name;
resolvedName.replace(0, strlen(PLACEHOLDERS[Rpath]), (*it));
pathName = getExistingPathname(resolvedName, workingPath);
if (!pathName.empty())
return pathName;
return pathName;
}
}
if (name.find(PLACEHOLDERS[Rpath]) == 0) {
// substitute @rpath with all -rpath paths up the load chain
std::vector<string*> rpaths = architecture->getRpaths();
for (std::vector<string*>::iterator it = rpaths.begin(); it != rpaths.end(); ++it) {
// rpath may contain @loader_path or @executable_path
string rpath = replacePlaceholder((**it), architecture);
resolvedName = name;
resolvedName.replace(0, strlen(PLACEHOLDERS[Rpath]), rpath);
pathName = getExistingPathname(resolvedName, workingPath);
if (!pathName.empty())
return pathName;
}
// after checking against all stored rpaths substitute @rpath with LD_LIBRARY_PATH (if it is set)
EnvironmentPathVariable ldLibraryPaths = environmentVariables[LdLibraryPath];
if (!ldLibraryPaths.isEmpty()) {
for (StringList::const_iterator it = ldLibraryPaths.getPaths().begin(); it != ldLibraryPaths.getPaths().end(); ++it) {
resolvedName = name;
resolvedName.replace(0, strlen(PLACEHOLDERS[Rpath]), (*it));
pathName = getExistingPathname(resolvedName, workingPath);
if (!pathName.empty())
return pathName;
}
}
}
// check pure path (either absolute or relative to working directory)
pathName = getExistingPathname(name, workingPath);
}
// check pure path (either absolute or relative to working directory)
pathName = getExistingPathname(name, workingPath);
if (!pathName.empty())
return pathName;
// try fallbacks (or its defaults)
if (!frameworkName.empty()) {
pathName = getExistingPathname(frameworkName, environmentVariables[DyldFallbackFrameworkPath], workingPath);
if (!pathName.empty())
return pathName;
// try fallbacks (or its defaults)
if (!frameworkName.empty()) {
pathName = getExistingPathname(frameworkName, environmentVariables[DyldFallbackFrameworkPath], workingPath);
if (!pathName.empty())
return pathName;
}
return getExistingPathname(name, environmentVariables[DyldFallbackLibraryPath], workingPath);
return pathName;
}
return getExistingPathname(name, environmentVariables[DyldFallbackLibraryPath], workingPath);
}
// returns the name is of a framework without any preceeding path information if name specifies a framework, otherwise an invalid string
string DynamicLoader::getFrameworkName(const string& name, const bool strippedSuffix) const {
// fail fast in case of dylibs
if (name.find(".framework/") == string::npos) {
return string();
std::string DynamicLoader::getFrameworkName(const std::string& name, const bool strippedSuffix) const {
// fail fast in case of dylibs
if (name.find(".framework/") == std::string::npos) {
return "";
}
/* first look for the form Foo.framework/Foo
next look for the form Foo.framework/Versions/A/Foo
A and Foo are arbitrary strings without a slash */
// get Foo (part after last slash)
size_t lastSlashPosition = name.rfind(PATH_SEPARATOR);
if (lastSlashPosition == std::string::npos || lastSlashPosition == name.length() -1) {
return "";
}
const std::string foo = name.substr(lastSlashPosition+1);
const std::string frameworkPart = foo+".framework/";
const std::string framework = frameworkPart + foo;
if (endsWith(name, framework)) {
// strip first part
return framework;
}
int startPosition = name.find(frameworkPart+"Versions/");
bool hasCorrectEnd = endsWith(name, foo);
// TODO: check between Versions/ and foo there must be no additional slash
if (startPosition != std::string::npos) {
if (hasCorrectEnd) {
return name.substr(startPosition);
} else if (strippedSuffix == false) {
// maybe we have a case, where name contains a suffix in foo (which then of course occurs only in the last foo)
// does foo already contain a suffix?
size_t suffixStart = foo.rfind("_");
if (suffixStart != std::string::npos) {
std::string newName = name;
newName.erase(lastSlashPosition+1+suffixStart);
return getFrameworkName(newName, true);
}
}
/* first look for the form Foo.framework/Foo
next look for the form Foo.framework/Versions/A/Foo
A and Foo are arbitrary strings without a slash */
// get Foo (part after last slash)
size_t lastSlashPosition = name.rfind(PATH_SEPARATOR);
if (lastSlashPosition == string::npos || lastSlashPosition == name.length() -1) {
return false;
}
const string foo = name.substr(lastSlashPosition+1);
const string frameworkPart = foo+".framework/";
const string framework = frameworkPart + foo;
if (endsWith(name, framework)) {
// strip first part
return framework;
}
int startPosition = name.find(frameworkPart+"Versions/");
bool hasCorrectEnd = endsWith(name, foo);
// TODO: check between Versions/ and foo there must be no additional slash
if (startPosition != string::npos) {
if (hasCorrectEnd) {
return name.substr(startPosition);
} else if (strippedSuffix == false) {
// maybe we have a case, where name contains a suffix in foo (which then of course occurs only in the last foo)
// does foo already contain a suffix?
size_t suffixStart = foo.rfind("_");
if (suffixStart != string::npos) {
string newName = name;
newName.erase(lastSlashPosition+1+suffixStart);
return getFrameworkName(newName, true);
}
}
}
// if we are at this part the given name was no framework
return string();
}
// if we are at this part the given name was no framework
return "";
}
string DynamicLoader::getExistingPathname(const string& name, const EnvironmentPathVariable& environmentPathVariable, const string& workingPath) const {
string result;
const StringList directories = environmentPathVariable.getPaths();
for (StringList::const_iterator it = directories.begin(); it != directories.end(); ++it) {
result = getExistingPathname(name, *it, workingPath);
if (!result.empty())
return result;
std::string DynamicLoader::getExistingPathname(const std::string& name, const EnvironmentPathVariable& environmentPathVariable, const std::string& workingPath) const {
std::string result;
const StringList directories = environmentPathVariable.getPaths();
for (StringList::const_iterator it = directories.begin(); it != directories.end(); ++it) {
result = getExistingPathname(name, *it, workingPath);
if (!result.empty())
return result;
}
return result;
}
std::string DynamicLoader::getExistingPathname(const std::string& file, const std::string& directory, const std::string& workingPath) const {
std::string name = file;
if (!directory.empty()) {
if (!endsWith(directory, "/")) {
name = directory + "/" + file;
} else {
name = directory + file;
}
return result;
}
return getExistingPathname(name, workingPath);
}
string DynamicLoader::getExistingPathname(const string& file, const string& directory, const string& workingPath) const {
string name = file;
if (!directory.empty()) {
if (!endsWith(directory, "/")) {
name = directory + "/" + file;
} else {
name = directory + file;
}
std::string DynamicLoader::getExistingPathname(const std::string& name, const std::string& workingPath, bool withSuffix) const {
// complete path
std::string usedName = name;
bool tryAgainWithoutSuffix = false;
// first try with suffix
if (withSuffix && !environmentVariables[DyldImageSuffix].isEmpty()) {
// only one suffix is considered
const std::string suffix = environmentVariables[DyldImageSuffix].getPaths().front();
// where should we append suffix?
if (endsWith(name, ".dylib")) {
usedName.insert(name.rfind("."), suffix);
} else {
usedName += suffix;
}
return getExistingPathname(name, workingPath);
tryAgainWithoutSuffix = true;
}
// complete path (with working directory)
usedName = workingPath + "/" + usedName;
struct stat buffer;
if (stat(usedName.c_str(), &buffer) == 0) {
return usedName;
} else {
// try without suffix
if (tryAgainWithoutSuffix) {
return getExistingPathname(name, workingPath, false);
}
}
return "";
}
string DynamicLoader::getExistingPathname(const string& name, const string& workingPath, bool withSuffix) const {
boost::filesystem::path path;
// complete path
string usedName = name;
bool tryAgainWithoutSuffix = false;
// first try with suffix
if (withSuffix && !environmentVariables[DyldImageSuffix].isEmpty()) {
// only one suffix is considered
const string suffix = environmentVariables[DyldImageSuffix].getPaths().front();
// where should we append suffix?
if (endsWith(name, ".dylib")) {
usedName.insert(name.rfind("."), suffix);
} else {
usedName += suffix;
}
tryAgainWithoutSuffix = true;
}
path = usedName;
// complete path (with working directory)
path = boost::filesystem::complete(path, workingPath);
if (boost::filesystem::exists(path)) {
return path.file_string();
} else {
// try without suffix
if (tryAgainWithoutSuffix) {
return getExistingPathname(name, workingPath, false);
}
}
return string();
}
bool DynamicLoader::endsWith(const string& str, const string& substr) {
size_t i = str.rfind(substr);
return (i != string::npos) && (i == (str.length() - substr.length()));
bool DynamicLoader::endsWith(const std::string& str, const std::string& substr) {
size_t i = str.rfind(substr);
return (i != std::string::npos) && (i == (str.length() - substr.length()));
}

View File

@ -3,76 +3,74 @@
#include "macho_global.h"
#include <list>
typedef list<string> StringList;
typedef std::list<std::string> StringList;
class MachOArchitecture;
class DynamicLoader
{
public:
DynamicLoader();
virtual ~DynamicLoader();
DynamicLoader();
virtual ~DynamicLoader();
string replacePlaceholder(const string& name, const MachOArchitecture* architecture) const;
string getPathname(const string& name, const MachOArchitecture* architecture, const string& workingDirectory) const;
std::string replacePlaceholder(const std::string& name, const MachOArchitecture* architecture) const;
std::string getPathname(const std::string& name, const MachOArchitecture* architecture, const std::string& workingDirectory) const;
private:
class EnvironmentPathVariable
{
public:
EnvironmentPathVariable();
EnvironmentPathVariable(const char* homePath, const string& name, const StringList& defaultValues = StringList());
class EnvironmentPathVariable
{
public:
EnvironmentPathVariable();
EnvironmentPathVariable(const char* homePath, const std::string& name, const StringList& defaultValues = StringList());
bool isEmpty() const;
const StringList& getPaths() const { return paths; }
bool isEmpty() const;
const StringList& getPaths() const { return paths; }
private:
void setPaths(const StringList& paths);
void addPath(const string& path);
bool replaceHomeDirectory(string& path);
StringList paths;
static const char PATHS_SEPARATOR;
const char* homePath;
};
private:
enum {
LdLibraryPath,
DyldFrameworkPath,
DyldLibraryPath,
DyldFallbackFrameworkPath,
DyldFallbackLibraryPath,
DyldImageSuffix,
NumEnvironmentVariables
};
enum Placeholder {
ExecutablePath,
LoaderPath,
Rpath,
NumPlaceholders
};
static const char* PLACEHOLDERS[NumPlaceholders];
static const char* ENVIRONMENT_VARIABLE_NAMES[NumEnvironmentVariables];
static const char* PATH_SEPARATOR;
static const StringList ENVIRONMENT_VARIABLE_DEFAULT_VALUES[NumEnvironmentVariables];
static const char* DEFAULT_FRAMEWORK_PATH[];
static const char* DEFAULT_LIBRARY_PATH[];
void setPaths(const StringList& paths);
void addPath(const std::string& path);
bool replaceHomeDirectory(std::string& path);
StringList paths;
static const char PATHS_SEPARATOR;
const char* homePath;
};
EnvironmentPathVariable environmentVariables[NumEnvironmentVariables];
enum {
LdLibraryPath,
DyldFrameworkPath,
DyldLibraryPath,
DyldFallbackFrameworkPath,
DyldFallbackLibraryPath,
DyldImageSuffix,
NumEnvironmentVariables
};
string getFrameworkName(const string& name, const bool strippedSuffix = false) const;
const char* getUserHomeDirectory() const;
string getExistingPathname(const string& name, const EnvironmentPathVariable& environmentPathVariable, const string& workingPath) const;
string getExistingPathname(const string& name, const string& directory, const string& workingPath) const;
string getExistingPathname(const string& name, const string& workingPath, bool withSuffix=true) const;
static bool endsWith(const string& str, const string& substr);
enum Placeholder {
ExecutablePath,
LoaderPath,
Rpath,
NumPlaceholders
};
static const char* PLACEHOLDERS[NumPlaceholders];
static const char* ENVIRONMENT_VARIABLE_NAMES[NumEnvironmentVariables];
static const char* PATH_SEPARATOR;
static const StringList ENVIRONMENT_VARIABLE_DEFAULT_VALUES[NumEnvironmentVariables];
static const char* DEFAULT_FRAMEWORK_PATH[];
static const char* DEFAULT_LIBRARY_PATH[];
const char* homePath;
EnvironmentPathVariable environmentVariables[NumEnvironmentVariables];
std::string getFrameworkName(const std::string& name, const bool strippedSuffix = false) const;
const char* getUserHomeDirectory() const;
std::string getExistingPathname(const std::string& name, const EnvironmentPathVariable& environmentPathVariable, const std::string& workingPath) const;
std::string getExistingPathname(const std::string& name, const std::string& directory, const std::string& workingPath) const;
std::string getExistingPathname(const std::string& name, const std::string& workingPath, bool withSuffix=true) const;
static bool endsWith(const std::string& str, const std::string& substr);
};
#endif // DYNAMICLOADER_H

View File

@ -1,8 +1,5 @@
#include "internalfile.h"
#include "machoexception.h"
#include <sstream>
using namespace boost::filesystem;
// use reference counting to reuse files for all used architectures
InternalFile* InternalFile::create(InternalFile* file) {
@ -10,7 +7,7 @@ InternalFile* InternalFile::create(InternalFile* file) {
return file;
}
InternalFile* InternalFile::create(const string& filename) {
InternalFile* InternalFile::create(const std::string& filename) {
return new InternalFile(filename);
}
@ -21,16 +18,22 @@ void InternalFile::release() {
}
}
InternalFile::InternalFile(const string& filename) :
InternalFile::InternalFile(const std::string& filename) :
filename(filename), counter(1)
{
// open file handle
file.open(this->filename, ios_base::in|ios_base::binary);
file.open(this->filename, std::ios_base::in | std::ios_base::binary);
if (file.fail()) {
ostringstream error;
std::ostringstream error;
error << "Couldn't open file '" << filename << "'.";
throw MachOException(error.str());
}
struct stat buffer;
if (stat(filename.c_str(), &buffer) >= 0) {
_fileSize = buffer.st_size;
_lastWriteTime = buffer.st_mtime;
}
}
// destructor is private since we use reference counting mechanism
@ -38,39 +41,32 @@ InternalFile::~InternalFile() {
file.close();
}
string InternalFile::getPath() const {
return filename.parent_path().string();
std::string InternalFile::getPath() const {
return filename;
}
/* returns whole filename (including path)*/
string InternalFile::getName() const {
/* unfortunately canonized is not available in newer versions of boost filesystem.
For the reasons see the filsystem proposal at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1889.html.
As an alternative I use realpath but I don't know if it handles unicode strings also.
*/
// try to canonicalize path
char* resolvedName = realpath(filename.file_string().c_str(), NULL);
if (!resolvedName)
return filename.file_string();
string resolvedFileName(resolvedName);
free(resolvedName);
return resolvedFileName;
std::string InternalFile::getName() const {
// Try to canonicalize path.
char buffer[PATH_MAX];
if (realpath(filename.c_str(), buffer) == nullptr)
return filename;
return buffer;
}
/* returns filename without path */
string InternalFile::getTitle() const {
return filename.filename();
std::string InternalFile::getTitle() const {
return filename;
}
unsigned long long InternalFile::getSize() const {
return file_size(filename);
return _fileSize;
}
bool InternalFile::seek(long long int position) {
file.seekg(position, ios_base::beg);
file.seekg(position, std::ios_base::beg);
if (file.fail()) {
file.clear();
return false;
@ -78,7 +74,7 @@ bool InternalFile::seek(long long int position) {
return true;
}
streamsize InternalFile::read(char* buffer, streamsize size) {
std::streamsize InternalFile::read(char* buffer, std::streamsize size) {
file.read(buffer, size);
if (file.fail()) {
file.clear();
@ -93,5 +89,5 @@ long long int InternalFile::getPosition() {
}
time_t InternalFile::getLastModificationTime() const {
return last_write_time(filename);
return _lastWriteTime;
}

View File

@ -2,32 +2,34 @@
#define INTERNALFILE_H
#include "macho_global.h"
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
class InternalFile
{
public:
static InternalFile* create(InternalFile* file);
static InternalFile* create(const string& filename);
void release();
virtual ~InternalFile();
string getPath() const;
string getName() const;
string getTitle() const;
unsigned long long getSize() const;
bool seek(long long int position);
streamsize read(char* buffer, streamsize size);
long long int getPosition();
time_t getLastModificationTime() const;
static InternalFile* create(InternalFile* file);
static InternalFile* create(const std::string& filename);
void release();
std::string getPath() const;
std::string getName() const;
std::string getTitle() const;
unsigned long long getSize() const;
bool seek(long long int position);
std::streamsize read(char* buffer, std::streamsize size);
long long int getPosition();
time_t getLastModificationTime() const;
private:
unsigned int counter;
virtual ~InternalFile();
InternalFile(const string& filename);
boost::filesystem::ifstream file;
boost::filesystem::path filename;
unsigned int counter;
InternalFile(const std::string& filename);
std::ifstream file;
std::string filename;
size_t _fileSize;
time_t _lastWriteTime;
};
#endif // INTERNALFILE_H

View File

@ -7,7 +7,7 @@
#include "dylinkercommand.h"
#include "machoexception.h"
#include "machoheader.h"
#include "/usr/include/mach-o/loader.h"
LoadCommand* LoadCommand::getLoadCommand(unsigned int cmd, MachOHeader* header) {

View File

@ -1,7 +1,6 @@
#ifndef LOADCOMMAND_H
#define LOADCOMMAND_H
#include "macho_global.h"
#include "/usr/include/mach-o/loader.h"
class MachOHeader;
class MachOFile;

View File

@ -2,7 +2,6 @@
#include "machoexception.h"
#include "machofile.h"
#include "machoarchitecture.h"
#include "demangler.h"
#include "dynamicloader.h"
#include "machoheader.h"
@ -12,26 +11,24 @@
// for MachO specification
// static variables
Demangler* MachO::demangler = 0;
DynamicLoader* MachO::dynamicLoader = 0;
int MachO::referenceCounter = 0;
MachO::MachO(const string& filename, const MachO* parent) : parent(parent), bundle(NULL)
MachO::MachO(const std::string& filename, const MachO* parent) : parent(parent), bundle(NULL)
{
// check if filename is bundle
string appFilename = getApplicationInBundle(filename);
std::string appFilename = getApplicationInBundle(filename);
init(appFilename, parent);
if (referenceCounter == 0) {
demangler = new Demangler();
dynamicLoader = new DynamicLoader();
}
referenceCounter++;
}
string MachO::getApplicationInBundle(const string& filename) {
std::string MachO::getApplicationInBundle(const std::string& filename) {
CFURLRef bundleUrl = 0;
string appFilename = filename;
std::string appFilename = filename;
bundleUrl = CFURLCreateFromFileSystemRepresentation(NULL, (const UInt8 *)filename.c_str() , filename.length(), true);
if (bundleUrl != NULL) {
bundle = CFBundleCreate(NULL, bundleUrl);
@ -50,7 +47,7 @@ string MachO::getApplicationInBundle(const string& filename) {
return appFilename;
}
void MachO::init(const string& fileName, const MachO* parent)
void MachO::init(const std::string& fileName, const MachO* parent)
{
MachOFile* parentFile = 0;
if (parent) {
@ -97,8 +94,6 @@ void MachO::init(const string& fileName, const MachO* parent)
MachO::~MachO() {
referenceCounter--;
if (referenceCounter == 0) {
delete demangler;
demangler = 0;
delete dynamicLoader;
dynamicLoader = 0;
}
@ -155,8 +150,8 @@ time_t MachO::getLastModificationTime() const {
}
// return bundle version if available, otherwise NULL string
string MachO::getVersion() const {
string version;
std::string MachO::getVersion() const {
std::string version;
if (bundle != 0) {
CFStringRef cfVersion = (CFStringRef)CFBundleGetValueForInfoDictionaryKey(bundle, kCFBundleVersionKey);
// is version available at all?
@ -167,8 +162,8 @@ string MachO::getVersion() const {
return version;
}
string MachO::getName() const {
string name;
std::string MachO::getName() const {
std::string name;
if (bundle != 0) {
CFStringRef cfBundleName = (CFStringRef)CFBundleGetValueForInfoDictionaryKey(bundle, kCFBundleNameKey);
// is version available at all?
@ -189,8 +184,8 @@ string MachO::getName() const {
return name;
}
string MachO::extractStringFromCFStringRef(CFStringRef cfStringRef) {
string string;
std::string MachO::extractStringFromCFStringRef(CFStringRef cfStringRef) {
std::string string;
const char* szString = CFStringGetCStringPtr(cfStringRef, kCFStringEncodingASCII);
if (szString == NULL) {
CFIndex stringLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfStringRef), kCFStringEncodingASCII);
@ -209,12 +204,12 @@ string MachO::extractStringFromCFStringRef(CFStringRef cfStringRef) {
return string;
}
string MachO::getPath() const {
std::string MachO::getPath() const {
return file->getPath();
}
string MachO::getFileName() const {
string filename = file->getName();
std::string MachO::getFileName() const {
std::string filename = file->getName();
return filename;
}

View File

@ -2,49 +2,46 @@
#define MACHO_H
#include "macho_global.h"
#include <list>
#include <CoreFoundation/CoreFoundation.h>
class MachOFile;
class MachOArchitecture;
class Demangler;
class DynamicLoader;
class EXPORT MachO {
private:
typedef std::list<MachOArchitecture*> MachOArchitectures;
typedef std::list<MachOArchitecture*> MachOArchitectures;
public:
MachO(const string& fileName, const MachO* parent = 0);
~MachO();
MachO(const std::string& fileName, const MachO* parent = 0);
~MachO();
string getFileName() const;
typedef MachOArchitectures::iterator MachOArchitecturesIterator;
typedef MachOArchitectures::const_iterator MachOArchitecturesConstIterator;
MachOArchitecturesIterator getArchitecturesBegin();
MachOArchitecturesIterator getArchitecturesEnd();
MachOArchitecture* getCompatibleArchitecture(MachOArchitecture* destArchitecture) const;
MachOArchitecture* getHostCompatibleArchitecture() const;
unsigned long long getSize() const;
time_t getLastModificationTime() const;
string getVersion() const;
string getName() const;
//sQIcon getIcon() const;*/
const MachO* getParent() { return parent;}
string getPath() const;
static Demangler* demangler;
static DynamicLoader* dynamicLoader;
static int referenceCounter;
std::string getFileName() const;
typedef MachOArchitectures::iterator MachOArchitecturesIterator;
typedef MachOArchitectures::const_iterator MachOArchitecturesConstIterator;
MachOArchitecturesIterator getArchitecturesBegin();
MachOArchitecturesIterator getArchitecturesEnd();
MachOArchitecture* getCompatibleArchitecture(MachOArchitecture* destArchitecture) const;
MachOArchitecture* getHostCompatibleArchitecture() const;
unsigned long long getSize() const;
time_t getLastModificationTime() const;
std::string getVersion() const;
std::string getName() const;
//sQIcon getIcon() const;*/
const MachO* getParent() { return parent;}
std::string getPath() const;
static DynamicLoader* dynamicLoader;
static int referenceCounter;
private:
const MachO* parent;
MachOFile* file;
MachOArchitectures architectures;
CFBundleRef bundle;
const MachO* parent;
MachOFile* file;
MachOArchitectures architectures;
CFBundleRef bundle;
std::string getApplicationInBundle(const std::string& bundlePath);
static std::string extractStringFromCFStringRef(CFStringRef cfStringRef);
void init(const std::string& fileName, const MachO* parent);
string getApplicationInBundle(const string& bundlePath);
static string extractStringFromCFStringRef(CFStringRef cfStringRef);
void init(const string& fileName, const MachO* parent);
};
#endif // MACHO_H

View File

@ -1,12 +1,6 @@
#ifndef MACHO_GLOBAL_H
#define MACHO_GLOBAL_H
#include <string>
using namespace std;
// TODO: use visibility options http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html
#if defined(MACHO_LIBRARY)

View File

@ -20,21 +20,21 @@ void MachOArchitecture::initParentArchitecture(const MachOArchitecture* parent)
this->parent = parent;
}
string MachOArchitecture::getResolvedName(const string& name, const string& workingPath) const {
string absoluteFileName = MachO::dynamicLoader->getPathname(name, this, workingPath);
std::string MachOArchitecture::getResolvedName(const std::string& name, const std::string& workingPath) const {
std::string absoluteFileName = MachO::dynamicLoader->getPathname(name, this, workingPath);
if (!absoluteFileName.empty())
return absoluteFileName;
// return unresolved name if it cannot be resolved to a valid absolute name
return name;
}
std::vector<string*> MachOArchitecture::getRpaths(bool recursively) const {
std::vector<std::string*> MachOArchitecture::getRpaths(bool recursively) const {
// try to get it from the parent (recursively)
std::vector<string*> prevRpaths;
std::vector<std::string*> prevRpaths;
if (recursively && parent) {
prevRpaths = parent->getRpaths(recursively);
} else {
prevRpaths = std::vector<string*>();
prevRpaths = std::vector<std::string*>();
}
// add own rpaths to the end
prevRpaths.insert(prevRpaths.end(), rpaths.begin(), rpaths.end());
@ -62,11 +62,11 @@ void MachOArchitecture::readLoadCommands() const {
RpathCommand* rpathCommand = dynamic_cast<RpathCommand*>(loadCommand);
if (rpathCommand != 0) {
// try to replace placeholder
string resolvedRpath = MachO::dynamicLoader->replacePlaceholder(rpathCommand->getPath(), this);
std::string resolvedRpath = MachO::dynamicLoader->replacePlaceholder(rpathCommand->getPath(), this);
if (resolvedRpath.empty()) {
resolvedRpath = rpathCommand->getPath();
}
rpaths.push_back(new string(resolvedRpath));
rpaths.push_back(new std::string(resolvedRpath));
}
// for uuid command...
@ -97,7 +97,7 @@ MachOArchitecture::~MachOArchitecture() {
delete *it;
}
for (std::vector<string*>::iterator it2 = rpaths.begin();
for (std::vector<std::string*>::iterator it2 = rpaths.begin();
it2 != rpaths.end();
++it2)
{

View File

@ -2,8 +2,6 @@
#define MACHOARCHITECTURE_H
#include "macho_global.h"
#include <list>
#include <vector>
class MachOFile;
class MachOHeader;
@ -13,40 +11,40 @@ class DylibCommand;
class EXPORT MachOArchitecture
{
private:
typedef std::list<LoadCommand*> LoadCommands;
typedef LoadCommands::iterator LoadCommandsIterator;
typedef std::list<LoadCommand*> LoadCommands;
typedef LoadCommands::iterator LoadCommandsIterator;
public:
typedef LoadCommands::const_iterator LoadCommandsConstIterator;
MachOArchitecture(MachOFile& file, uint32_t magic, unsigned int size);
~MachOArchitecture();
typedef LoadCommands::const_iterator LoadCommandsConstIterator;
MachOArchitecture(MachOFile& file, uint32_t magic, unsigned int size);
~MachOArchitecture();
const MachOHeader* getHeader() { return header; }
LoadCommandsConstIterator getLoadCommandsBegin() const { if(!hasReadLoadCommands) { readLoadCommands(); } return loadCommands.begin(); }
LoadCommandsConstIterator getLoadCommandsEnd() const { if(!hasReadLoadCommands) { readLoadCommands(); } return loadCommands.end(); }
DylibCommand* getDynamicLibIdCommand() const { if(!hasReadLoadCommands) { readLoadCommands(); } return dynamicLibIdCommand; }
unsigned int getSize() const;
void initParentArchitecture(const MachOArchitecture* parent);
const MachOFile* getFile() const { return &file; }
std::string getDynamicLinker() const { return dylinker; }
std::vector<std::string*> getRpaths(bool recursively = true) const;
std::string getResolvedName(const std::string& name, const std::string& workingPath) const;
const uint8_t* getUuid() const;
const MachOHeader* getHeader() { return header; }
LoadCommandsConstIterator getLoadCommandsBegin() const { if(!hasReadLoadCommands) { readLoadCommands(); } return loadCommands.begin(); }
LoadCommandsConstIterator getLoadCommandsEnd() const { if(!hasReadLoadCommands) { readLoadCommands(); } return loadCommands.end(); }
DylibCommand* getDynamicLibIdCommand() const { if(!hasReadLoadCommands) { readLoadCommands(); } return dynamicLibIdCommand; }
unsigned int getSize() const;
void initParentArchitecture(const MachOArchitecture* parent);
const MachOFile* getFile() const { return &file; }
std::string getDynamicLinker() const { return dylinker; }
std::vector<string*> getRpaths(bool recursively = true) const;
string getResolvedName(const string& name, const string& workingPath) const;
const uint8_t* getUuid() const;
private:
MachOHeader* header;
MachOFile& file;
const unsigned int size;
mutable bool hasReadLoadCommands;
void readLoadCommands() const;
const MachOArchitecture* parent; // architecture from which this architecture was loaded
MachOHeader* header;
MachOFile& file;
const unsigned int size;
mutable bool hasReadLoadCommands;
void readLoadCommands() const;
const MachOArchitecture* parent; // architecture from which this architecture was loaded
// all those are mutable, because they are initialized not in the constructor, but in the readLoadCommands method
mutable LoadCommands loadCommands;
mutable DylibCommand* dynamicLibIdCommand;
mutable std::vector<string*> rpaths;
mutable const uint8_t* uuid;
mutable std::string dylinker;
// all those are mutable, because they are initialized not in the constructor, but in the readLoadCommands method
mutable LoadCommands loadCommands;
mutable DylibCommand* dynamicLibIdCommand;
mutable std::vector<std::string*> rpaths;
mutable const uint8_t* uuid;
mutable std::string dylinker;
};
#endif // MACHOARCHITECTURE_H

View File

@ -21,7 +21,7 @@ MachOCache::~MachOCache() {
}
}
MachO* MachOCache::getFile(const string& filename, const MachO* parent) {
MachO* MachOCache::getFile(const std::string& filename, const MachO* parent) {
CacheMapIterator it = cache.find(filename);
// check if already in cache?

View File

@ -2,7 +2,6 @@
#define MACHOCACHE_H
#include "macho_global.h"
#include <map>
class MachO;
class EXPORT MachOCache
@ -10,12 +9,12 @@ class EXPORT MachOCache
public:
MachOCache();
~MachOCache();
MachO* getFile(const string& filename, const MachO* parent);
MachO* getFile(const std::string& filename, const MachO* parent);
unsigned int getNumEntries();
private:
typedef map<string, MachO*> CacheMap;
typedef std::map<std::string, MachO*> CacheMap;
typedef CacheMap::iterator CacheMapIterator;
CacheMap cache;
};
#endif // MACHOCACHE_H
#endif // MACHOCACHE_H

View File

@ -1,6 +1,6 @@
#include "machodemangleexception.h"
MachODemangleException::MachODemangleException(const string& cause) :
MachODemangleException::MachODemangleException(const std::string& cause) :
MachOException(cause)
{
}
}

View File

@ -9,7 +9,7 @@ class EXPORT MachODemangleException : public MachOException
{
public:
MachODemangleException(const string&);
MachODemangleException(const std::string&);
};
#endif // MACHODEMANGLEEXCEPTION_H

View File

@ -1,6 +1,6 @@
#include "machoexception.h"
MachOException::MachOException(const string& cause) :
cause(cause)
MachOException::MachOException(const std::string& cause) : cause(cause)
{
}

View File

@ -6,10 +6,10 @@
class EXPORT MachOException
{
public:
MachOException(const string&);
const string& getCause() { return cause; }
MachOException(const std::string&);
const std::string& getCause() { return cause; }
private:
const string cause;
const std::string cause;
};
#endif // MACHOEXCEPTION_H

View File

@ -2,7 +2,7 @@
#include "machoexception.h"
#include "internalfile.h"
MachOFile::MachOFile(const string& filename,const MachOFile* parent, bool reversedByteOrder) :
MachOFile::MachOFile(const std::string& filename,const MachOFile* parent, bool reversedByteOrder) :
file(InternalFile::create(filename)), position(0), reversedByteOrder(reversedByteOrder), parent(parent)
{
if (parent) {
@ -21,15 +21,15 @@ MachOFile::~MachOFile() {
file->release();
}
string MachOFile::getPath() const {
std::string MachOFile::getPath() const {
return file->getPath();
}
string MachOFile::getName() const {
string filename = file->getName();
std::string MachOFile::getName() const {
std::string filename = file->getName();
return filename;
}
string MachOFile::getTitle() const { return file->getTitle(); }
std::string MachOFile::getTitle() const { return file->getTitle(); }
unsigned long long MachOFile::getSize() const { return file->getSize(); }
time_t MachOFile::getLastModificationTime() const { return file->getLastModificationTime(); }

View File

@ -7,37 +7,37 @@ class InternalFile;
class MachOFile
{
public:
MachOFile(const string& filename, const MachOFile* parent, bool reversedByteOrder = false);
MachOFile(const MachOFile& file, bool reversedByteOrder);
~MachOFile();
MachOFile(const std::string& filename, const MachOFile* parent, bool reversedByteOrder = false);
MachOFile(const MachOFile& file, bool reversedByteOrder);
~MachOFile();
uint32_t readUint32();
uint32_t readUint32LE();
uint32_t readUint32BE();
uint32_t readUint32();
uint32_t readUint32LE();
uint32_t readUint32BE();
void readBytes(char* result, size_t size);
void readBytes(char* result, size_t size);
uint32_t getUint32(unsigned int data) const {return (reversedByteOrder?reverseByteOrder(data):data);}
static uint32_t getUint32LE(uint32_t data);
static uint32_t getUint32BE(uint32_t data);
string getPath() const;
string getName() const;
string getTitle() const;
unsigned long long getSize() const;
void seek(long long int offset) { position = offset; }
long long int getPosition() const { return position; }
const string& getExecutablePath() const { return executablePath; }
time_t getLastModificationTime() const;
uint32_t getUint32(unsigned int data) const {return (reversedByteOrder?reverseByteOrder(data):data);}
static uint32_t getUint32LE(uint32_t data);
static uint32_t getUint32BE(uint32_t data);
std::string getPath() const;
std::string getName() const;
std::string getTitle() const;
unsigned long long getSize() const;
void seek(long long int offset) { position = offset; }
long long int getPosition() const { return position; }
const std::string& getExecutablePath() const { return executablePath; }
time_t getLastModificationTime() const;
private:
static unsigned int convertByteOrder(char* data, bool isBigEndian, unsigned int numberOfBytes);
static unsigned int reverseByteOrder(unsigned int data);
private:
static unsigned int convertByteOrder(char* data, bool isBigEndian, unsigned int numberOfBytes);
static unsigned int reverseByteOrder(unsigned int data);
InternalFile* file;
long long int position;
const bool reversedByteOrder;
const MachOFile* parent;
string executablePath;
InternalFile* file;
long long int position;
const bool reversedByteOrder;
const MachOFile* parent;
std::string executablePath;
};

View File

@ -3,7 +3,6 @@
#include "MachO_global.h"
#include "machofile.h"
#include "/usr/include/mach-o/loader.h"
class EXPORT MachOHeader
{

View File

@ -2,14 +2,12 @@
#define SYMBOLTABLECOMMAND_H
#include "loadcommand.h"
#include <mach-o/nlist.h>
#include <list>
class SymbolTableEntry;
class EXPORT SymbolTableCommand : public LoadCommand
{
private:
typedef list<const SymbolTableEntry*> SymbolTableEntries;
typedef std::list<const SymbolTableEntry*> SymbolTableEntries;
typedef SymbolTableEntries::iterator SymbolTableEntriesIterator;
public:
typedef SymbolTableEntries::const_iterator SymbolTableEntriesConstIterator;

View File

@ -1,10 +1,9 @@
#include "symboltableentry.h"
#include "macho.h"
#include "machofile.h"
#include "demangler.h"
SymbolTableEntry::SymbolTableEntry(MachOFile& file, char* stringTable) :
file(file), stringTable(stringTable)
SymbolTableEntry::SymbolTableEntry(MachOFile& file, char* stringTable)
: file(file), stringTable(stringTable)
{
}
@ -12,37 +11,36 @@ SymbolTableEntry::~SymbolTableEntry() {
}
string SymbolTableEntry::getName(bool shouldDemangle) const {
const char* internalName = getInternalName();
if (shouldDemangle) {
return MachO::demangler->demangleName(internalName);
}
return internalName;
std::string SymbolTableEntry::getName(bool shouldDemangle) const {
const char *name = getInternalName();
std::string result = name;
if (shouldDemangle) {
int status = 0;
// Convert real name to readable string. +1 to skip the leading underscore.
char *realName = abi::__cxa_demangle(name + 1, nullptr, nullptr, &status);
if (realName != nullptr)
result = realName;
free(realName);
}
return result;
}
SymbolTableEntry::Type SymbolTableEntry::getType() const {
unsigned int type = getInternalType();
unsigned int type = getInternalType();
if (type & N_STAB) {
return TypeDebug;
}
if (type & N_PEXT) {
return TypePrivateExtern;
}
if (type & N_EXT) {
if ((type & N_TYPE) == N_UNDF)
return TypeImported;
else
return TypeExported;
}
if (type & N_STAB) {
return TypeDebug;
}
if (type & N_PEXT) {
return TypePrivateExtern;
}
if (type & N_EXT) {
if ((type & N_TYPE) == N_UNDF)
return TypeImported;
else
return TypeLocal;
return TypeExported;
}
else
return TypeLocal;
}
/*
QDebug& operator<<(QDebug& dbg, const SymbolTableEntry& symbolTable) {
unsigned int type = symbolTable.getInternalType();
dbg.nospace() << "Name:" << symbolTable.getInternalName() << "Type" << (type & N_TYPE) << "STAB" << (type & N_STAB) << "PEXT" << (type & N_PEXT) << "NTYPE" << (type & N_TYPE) << "NEXT" << (type & N_EXT);
return dbg.space();
}
*/

View File

@ -8,26 +8,26 @@ class MachOFile;
class EXPORT SymbolTableEntry
{
public:
SymbolTableEntry(MachOFile& file, char* stringTable);
virtual ~SymbolTableEntry();
string getName(bool shouldDemangle) const;
SymbolTableEntry(MachOFile& file, char* stringTable);
virtual ~SymbolTableEntry();
std::string getName(bool shouldDemangle) const;
enum Type {
TypeExported = 0,
TypeImported,
TypeLocal,
TypeDebug,
TypePrivateExtern,
NumTypes
};
enum Type {
TypeExported = 0,
TypeImported,
TypeLocal,
TypeDebug,
TypePrivateExtern,
NumTypes
};
Type getType() const;
virtual unsigned int getInternalType() const = 0;
virtual const char* getInternalName() const = 0;
Type getType() const;
virtual unsigned int getInternalType() const = 0;
virtual const char* getInternalName() const = 0;
protected:
MachOFile& file;
char* stringTable;
MachOFile& file;
char* stringTable;
};
#endif // SYMBOLTABLEENTRY_H

View File

@ -1,5 +1,7 @@
[![Build Status](https://travis-ci.org/mike-lischke/macdependency.svg?branch=master)](https://travis-ci.org/mike-lischke/macdependency)
MacDependency shows all dependent libraries and frameworks of a given executable, dynamic library or framework on Mac OS X. It is a GUI replacement for the otool command, and provides almost the same functionality as the Dependency Walker (http://www.dependencywalker.com) on Windows.
More information available in the [Wiki](https://github.com/kwin/macdependency/wiki).
More information available in the [Wiki](../../wiki).
![Screenshot](/../images/images/screenshot.jpg?raw=true)
![Screenshot](images/macdependency.png)

BIN
images/macdependency.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB