From ecb65fb021a0d9001c690d2c61600a4c8cc80b57 Mon Sep 17 00:00:00 2001 From: TBD Date: Sun, 6 Jan 2019 19:30:28 +0800 Subject: [PATCH 1/4] change gitignore --- .gitignore | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2e43af8..ae71a87 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ -.svn/* -build/* +.svn/ +.DS_Store +xcuserdata/ +build/ +Pods/ +.idea/ English.lproj/.svn/all-wcprops English.lproj/.svn/entries English.lproj/.svn/text-base/InfoPlist.strings.svn-base From 9eca68d8d354ef992f222d878ba7a639036eb450 Mon Sep 17 00:00:00 2001 From: TBD Date: Sun, 6 Jan 2019 19:30:49 +0800 Subject: [PATCH 2/4] Support Xcode 10 --- Info.plist | 6 +++--- machoview.xcodeproj/project.pbxproj | 8 ++------ .../project.xcworkspace/contents.xcworkspacedata | 7 +++++++ .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ 4 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 machoview.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 machoview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Info.plist b/Info.plist index d09111f..29a1c34 100644 --- a/Info.plist +++ b/Info.plist @@ -3,9 +3,9 @@ CFBuildDate - Thu Apr 23 12:18:08 WEST 2015 + Sun Jan 6 19:27:06 CST 2019 CFBuildNumber - 9121 + 9136 CFBundleDevelopmentRegion English CFBundleDocumentTypes @@ -44,7 +44,7 @@ CFBundleSignature ???? CFBundleVersion - 9121 + 9136 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/machoview.xcodeproj/project.pbxproj b/machoview.xcodeproj/project.pbxproj index afa40ac..8f2466b 100644 --- a/machoview.xcodeproj/project.pbxproj +++ b/machoview.xcodeproj/project.pbxproj @@ -685,7 +685,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; CONFIGURATION_TEMP_DIR = "$(inherited)"; @@ -726,9 +725,7 @@ ); PRIVATE_HEADERS_FOLDER_PATH = ""; PRODUCT_NAME = MachOView; - SDKROOT = macosx10.9; USER_HEADER_SEARCH_PATHS = ""; - VALID_ARCHS = "$(inherited)"; VERSIONING_SYSTEM = ""; }; name = Debug; @@ -737,7 +734,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; CONFIGURATION_TEMP_DIR = "$(inherited)"; @@ -781,10 +777,8 @@ ); PRIVATE_HEADERS_FOLDER_PATH = ""; PRODUCT_NAME = MachOView; - SDKROOT = macosx10.9; SKIP_INSTALL = NO; USER_HEADER_SEARCH_PATHS = ""; - VALID_ARCHS = "$(inherited)"; VERSIONING_SYSTEM = ""; }; name = Release; @@ -793,6 +787,7 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_OBJCPP_ARC_ABI = YES; CODE_SIGN_IDENTITY = ""; @@ -818,6 +813,7 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_OBJCPP_ARC_ABI = YES; CODE_SIGN_IDENTITY = ""; diff --git a/machoview.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/machoview.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/machoview.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/machoview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/machoview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/machoview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + From e393f594e01013725c6ea4e77fc68286b2ec2862 Mon Sep 17 00:00:00 2001 From: TBD Date: Sun, 6 Jan 2019 19:33:47 +0800 Subject: [PATCH 3/4] Fix set UI in the child thread crash --- Document.mm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Document.mm b/Document.mm index c59fbe5..ca0dd48 100644 --- a/Document.mm +++ b/Document.mm @@ -455,18 +455,22 @@ - (void)handleThreadStateChanged:(NSNotification *)notification { if (OSAtomicIncrement32(&threadCount) == 1) { - [progressIndicator setUsesThreadedAnimation:YES]; - [progressIndicator startAnimation:nil]; - [stopButton setHidden:NO]; + dispatch_async(dispatch_get_main_queue(), ^{ + [progressIndicator setUsesThreadedAnimation:YES]; + [progressIndicator startAnimation:nil]; + [stopButton setHidden:NO]; + }); } } else if ([threadState isEqualToString:MVStatusTaskTerminated] == YES) { if (OSAtomicDecrement32(&threadCount) == 0) { - [progressIndicator stopAnimation:nil]; - [statusText setStringValue:@""]; - [stopButton setHidden:YES]; + dispatch_async(dispatch_get_main_queue(), ^{ + [progressIndicator stopAnimation:nil]; + [statusText setStringValue:@""]; + [stopButton setHidden:YES]; + }); } } } From 5b4779f6f626915b1fa100f6008abdfb047f6cb9 Mon Sep 17 00:00:00 2001 From: TBD Date: Sun, 6 Jan 2019 19:34:34 +0800 Subject: [PATCH 4/4] Fix some time symbolName is NULL Crash --- DataController.mm | 3 +++ LinkEdit.mm | 3 +++ 2 files changed, 6 insertions(+) diff --git a/DataController.mm b/DataController.mm index 646d7ea..5ab84bf 100644 --- a/DataController.mm +++ b/DataController.mm @@ -163,6 +163,9 @@ -(void)replaceColoumnAtIndex:(NSUInteger)index withString:(NSString *)str //----------------------------------------------------------------------------- - (void)writeString:(NSString *)str toFile:(FILE *)pFile { + if (str == nil) { + return; + } fwrite(CSTRING(str), [str length] + 1, 1, pFile); } diff --git a/LinkEdit.mm b/LinkEdit.mm index 429cd4f..e224904 100644 --- a/LinkEdit.mm +++ b/LinkEdit.mm @@ -874,6 +874,9 @@ - (MVNode *) createSymbols64Node:parent // accumulate search info NSUInteger bookmark = node.details.rowCount; NSString * symbolName = NSSTRING(strtab + nlist_64->n_un.n_strx); + if (symbolName == nil) { + continue; + } NSColor * color = nil; /* print the symbol nr */