Objective c 如何计算二进制中用于atos的真实符号地址?
我一直在试图找出一种方法,如何从崩溃报告中得到的堆栈地址计算出准确的符号地址。我发现了以下公式: 并尝试使用我发现的工具为我计算地址: 但是这两种方法都不起作用,尽管误差相对较小——大约比实际发生误差的行早3-4行 我故意使应用程序崩溃,超出了NSArray对象的界限。这是我的结果: 事故报告:Objective c 如何计算二进制中用于atos的真实符号地址?,objective-c,xcode,pointers,llvm,atoi,Objective C,Xcode,Pointers,Llvm,Atoi,我一直在试图找出一种方法,如何从崩溃报告中得到的堆栈地址计算出准确的符号地址。我发现了以下公式: 并尝试使用我发现的工具为我计算地址: 但是这两种方法都不起作用,尽管误差相对较小——大约比实际发生误差的行早3-4行 我故意使应用程序崩溃,超出了NSArray对象的界限。这是我的结果: 事故报告: 0 CoreFoundation 0x36bf688f __exceptionPreprocess + 163 1 libobjc.A.dylib
0 CoreFoundation 0x36bf688f __exceptionPreprocess + 163
1 libobjc.A.dylib 0x3300d259 objc_exception_throw + 33
2 CoreFoundation 0x36b4e23d -[__NSArrayI objectAtIndex:] + 165
3 SomeApp 0x0013cea3 -[DashboardTableViewController tableView:didSelectRowAtIndexPath:] (DashboardTableViewController.m:970)
4 UIKit 0x34e7993d -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 945
5 UIKit 0x34ef3627 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 159
6 Foundation 0x32829933 __NSFireDelayedPerform + 415
7 CoreFoundation 0x36bcaa33 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 15
8 CoreFoundation 0x36bca699 __CFRunLoopDoTimer + 365
9 CoreFoundation 0x36bc926f __CFRunLoopRun + 1207
10 CoreFoundation 0x36b4c4a5 CFRunLoopRunSpecific + 301
11 CoreFoundation 0x36b4c36d CFRunLoopRunInMode + 105
12 GraphicsServices 0x34d13439 GSEventRunModal + 137
13 UIKit 0x34df5cd5 UIApplicationMain + 1081
14 SomeApp 0x00146587 main (main.m:17)
15 SomeApp 0x00102008 start + 40
natos输出:
Main Stack Address == 0x146587
Target Stack Address == 0x13cea3
Slide == 0x1000
Main Symbol Address == 0x4751c
Load Address == 0x10006b
Target Symbol Address == 0x3de38
dwarfdump output:
(null)
atos output:
-[DashboardTableViewController tableView:viewForHeaderInSection:] (in SomeApp) (DashboardTableViewController.m:966)
正如苹果崩溃报告所说,代码行实际上是970而不是966。我想知道是什么导致了这个错误,应该用什么来正确计算地址。你能用这个吗:?作为旁注,当我使用addr2line时,GCC似乎总是一条线…你解决了你的问题了吗?我还没有找到。我只是用PLCrashReporter来解决我的问题。你能用这个吗?作为旁注,当我使用addr2line时,GCC似乎总是一条线…你解决了你的问题了吗?我还没有找到。我只是用PLCrashReporter来解决我的问题。()