From 4a3843b3530d34e37c86eed99997b97be7281731 Mon Sep 17 00:00:00 2001 From: mashikui <78728930@qq.com> Date: Wed, 12 Jun 2019 17:41:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=94=AF=E6=8C=81sliderAddre?= =?UTF-8?q?ss=E8=BE=93=E5=85=A5=E5=81=8F=E7=A7=BB=E9=87=8F=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UserInterfaceState.xcuserstate | Bin 0 -> 9553 bytes .../Controller/MainWindowViewController.m | 71 ++++++++++++++++-- 2 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 Objective-C/DSYMTools.xcodeproj/project.xcworkspace/xcuserdata/Don.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/Objective-C/DSYMTools.xcodeproj/project.xcworkspace/xcuserdata/Don.xcuserdatad/UserInterfaceState.xcuserstate b/Objective-C/DSYMTools.xcodeproj/project.xcworkspace/xcuserdata/Don.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..2a2c57f956b23590b56a246f6ac7ca537b1a293d GIT binary patch literal 9553 zcmd5>d3;mF_Me%XwQ2T*rCDg9R*%IG`%f>G>J(H)V|6=L{RZ5 zt{{lCpnxkPprV3;fUL@{;EsxlxbMHG{?5&9(pL2S{PWj-+I#QJnR8~&oH^%v&eR3G zo=`X=;{>6E5spZRl*l+c*RMKx4j&A8{J!dBf88wJ9S%)Nb_LxtJ=i=kIqVM@2)%jD zQ@ZzwoG6Hqn24ENP6m=eJU2GU4o z5)YY0W)m-IB0dr(&7_t5i`+~WlO^O9vW(nCR*;pXovbHMkY~vAWIK78yh;v`gX9P~ zM&2ZEk@v`F5uh2Bc*-_kak`0apxtcj^iYpl#_9CPQfWTHD}~{a|x4@ea&9)aiSz~L`C9>mKY{iIMZhHEuk8G zc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WindowViewController.m index 759066a..05c08ba 100755 --- a/Objective-C/DSYMTools/Controller/MainWindowViewController.m +++ b/Objective-C/DSYMTools/Controller/MainWindowViewController.m @@ -365,25 +365,84 @@ - (IBAction)analyse:(id)sender { if(self.selectedArchiveInfo == nil){ return; } - + if(self.selectedUUIDInfo == nil){ return; } - + if([self.defaultSlideAddressLabel.stringValue isEqualToString:@""]){ return; } - + if([self.errorMemoryAddressLabel.stringValue isEqualToString:@""]){ return; } - - NSString *commandString = [NSString stringWithFormat:@"xcrun atos -arch %@ -o \"%@\" -l %@ %@", self.selectedUUIDInfo.arch, self.selectedUUIDInfo.executableFilePath, self.defaultSlideAddressLabel.stringValue, self.errorMemoryAddressLabel.stringValue]; - NSString *result = [self runCommand:commandString]; + NSString *result = @""; + NSString *slidValueStr = self.defaultSlideAddressLabel.stringValue; + if (slidValueStr.length > 0) { + if (![slidValueStr hasPrefix:@"0x"] && ![slidValueStr hasPrefix:@"0X"]) { + NSString *memoryAddressToTen = [self sixtyToTen:self.errorMemoryAddressLabel.stringValue]; + NSInteger memoryAddressTenInt = memoryAddressToTen.integerValue; + + NSInteger slideAddressTenInt = memoryAddressTenInt - slidValueStr.integerValue; + NSString *slideAddressSixTyStr = [self tenToSixTy:slideAddressTenInt]; + + NSString *commandString = [NSString stringWithFormat:@"xcrun atos -arch %@ -o \"%@\" -l %@ %@", self.selectedUUIDInfo.arch, self.selectedUUIDInfo.executableFilePath, slideAddressSixTyStr, self.errorMemoryAddressLabel.stringValue]; + result = [self runCommand:commandString]; + + }else{ + NSString *commandString = [NSString stringWithFormat:@"xcrun atos -arch %@ -o \"%@\" -l %@ %@", self.selectedUUIDInfo.arch, self.selectedUUIDInfo.executableFilePath, self.defaultSlideAddressLabel.stringValue, self.errorMemoryAddressLabel.stringValue]; + result = [self runCommand:commandString]; + } + } [self.errorMessageView setString:result]; } + + +//将十进制转化为十六进制 +-(NSString *)tenToSixTy:(long long int)tmpid +{ + NSString *nLetterValue; + NSString *str =@""; + long long int ttmpig; + for (int i = 0; i<9; i++) { + ttmpig=tmpid%16; + tmpid=tmpid/16; + switch (ttmpig) + { + case 10: + nLetterValue =@"A";break; + case 11: + nLetterValue =@"B";break; + case 12: + nLetterValue =@"C";break; + case 13: + nLetterValue =@"D";break; + case 14: + nLetterValue =@"E";break; + case 15: + nLetterValue =@"F";break; + default:nLetterValue=[[NSString alloc]initWithFormat:@"%lli",ttmpig]; + + } + str = [nLetterValue stringByAppendingString:str]; + if (tmpid == 0) { + break; + } + + } + return str; +} +//十六进制->十进制 +-(NSString *)sixtyToTen:(NSString *)sixTyStr{ + NSString *temp10 = [NSString stringWithFormat:@"%lu",strtoul([sixTyStr UTF8String],0,16)]; + return temp10; +} + + + - (NSDragOperation)draggingEntered:(id )sender{ NSPasteboard *pboard;