English 中文(简体)
at湖和 d湖赢得了象征我的讲话
原标题:atos and dwarfdump won t symbolicate my address

我通过AirBrake收到坠毁报告。 无象征意义。 由于坠毁报告的格式并不完全与Ampap碰撞案一样,因此我只能像往常一样,在XCode上把它 drop倒,因此,我从我的XCode档案中抽取的正是同样的建筑,试图将其象征在指挥线上。 其结果如下:

$ atos -o kidsapp.app/kidsapp 0x0002fc4c
0x0002fc4c (in kidsapp)

I m absolutely sure I m using the same build as the crash report is from. So I also tried with dwarfdump:

$ dwarfdump --lookup 0x0002fc4c --arch armv7 kidsapp.app.dSYM
----------------------------------------------------------------------
 File: kidsapp.app.dSYM/Contents/Resources/DWARF/kidsapp (armv7)
----------------------------------------------------------------------
Looking up address: 0x000000000002fc4c in .debug_info... not found.
Looking up address: 0x000000000002fc4c in .debug_frame... not found.

也没有结果。 除了使用错误的海关档案外,还有什么东西可以错? 我知道,这是正确的,因为这是发生在AirBrake的坠毁报告中提到的版本,它存放在我的XCode档案中。

欢迎任何想法/建议。

最佳回答

首先,如果海关数据系统真的正确无误的话:

dwarfdump --uuid kidsapp.app/kidsapp
dwarfdump --uuid kidsapp.app.dSYM

Both should return the same result.

海关数据系统是否具备任何有效内容的下一次检查

dwarfdump --all kidsapp.app.dSYM

至少应当提供一些信息,但<代码>未见。

我怀疑海关是腐败的。 总的来说,你可能希望使用坠毁报告器,使你能够用所有透镜和最后例外的背后信息填写完整的坠毁报告。 我建议使用基于PLCrashReporter的某种东西,例如: QuincyKit (Open Source SDK +服务器 + signation on their mac) or HockeyApp (Open Source SDK + Paid service +有象征意义的附带) (说明:我既是开发者之一!)

问题回答

我用以下算法表示:

以及

stack address is the hex value I get from my stack dump crash report (not a .crash file, just the stack dump).

以及

<代码>slide 是LC_ 的 v。 运行<代码>otool -arch armv7 -l App_BINaire_PATH时的分数。 地雷通常为0x00001000。

以及

load address is the complicated piece. It is actually the difference between the bottommost stack address of the main thread 以及 the FIRST address of the portion of my binary that contains symbols when running dwarfdump --arch armv7 --all DSYM_BINARY_PATH. This is simply the symbolic address of the main function. So if your bottom most crash address is 0x8000 以及 your main function s symbolic address is 0x2000 then your load address is 0x6000.

Now with ALL these pieces I can calculate the symbol address 以及 put that into atos or dwarfdump: dwarfdump --lookup SYM_ADDR --arch armv7 APP_BINARY_PATH.

倾销实例(见load Address0x00003af4):

档案: /用户/用户/Desktop/MyApp.xcarchive/dSYMs/MyApp.app.dSYM/Contents/Resources/DWARF/MyApp(armv7)

0x00024:[0x00003af4 - 0x00003b4e]

0x00098: [0x00003b50 - 0x00003d8c] - [MyAppDelegate application: doFinishLaunching WithOptions:]

......倾销的其余部分

最困难的部分是认识到,我所包括的2个静态图书馆之一在与我的双手连接之前就已失去其标志! 这留下了捷克共和国的文号空白,因此,我最后只剩下我海关需要的三分之二符号。

Be sure to have the following flags set to NO in your static libraries xcode project so that when you link against it, you can pull in the symbols to your app s binary (which can later be stripped): COPY_PHASE_STRIP, DEAD_CODE_STRIPPING, 以及 STRIP_INSTALLED_PRODUCT.

Now you may ask, "what do I do if the stack dump does not include the main function since it isn t on the main thread so that I cannot get the main function s stack address?". To that I would reply, "I haven t a friggin clue!". Just cross your fingers 以及 hope you can get a stack trace that includes the symbol address or use a crash reporting system that mimics Apple s crash logs, like PLCrashReporter.

[EDIT May 26,2013] ——

提请我注意,<代码>上载实际上是双向地址。 虽然我前面描述的内容往往可以奏效,但实际上并不正确。 可以通过讲卫生运动报告获得,但答案的点是在你没有坠毁报告时提供坠毁的标志。 在希望具有象征意义时,I ve最能将load/code> 填入“<<>>,即通过确保I登录loadstack Address/code>。

I ve personally created a system for logging crashes (not crash reports) 以及 having them sent to an S3 bucket where I can retrieve them later for debugging. When I start my application I cache the slide, the load address 以及 the main function address for use if my app crashes 以及 I send up a the stack addresses.

NOTE: The dyld functions use #include <mach-o/dyld.h>

main function address = the last address in [NSThread callStackReturnAddresses] when called on the main thread

At crash time I m sure to log [NSThread callStackReturnAddresses] 以及 [NSThread callStackSymbols] as well as the architecture which can be retrieve by having this method:

- (NSString*) arch
{
    NSString* arch =
#ifdef _ARM_ARCH_7
        @"armv7";
#elif defined (_ARM_ARCH_6)
        @"armv6";
#else
        nil;
#endif

    return arch;
}

I don t yet know how to differentiate between armv7 以及 armv7s though.

So this may help in the future. I plan on taking everything I ve learned 以及 turning this into a simple crash tool - better than the natos tool (probably natos v2).

I ve updated natos to support supplying the load address manually: https://github.com/NSProgrammer/natos

某些时候对“Load Address”有价值:

Jan 14 11:02:39 Dennins-iPhone AppName[584] <Critical>: Stack Trace: (
    0   CoreFoundation                      0x2c3084b7 <redacted> + 150
    1   libobjc.A.dylib                     0x39abec8b objc_exception_throw + 38
    2   CoreFoundation                      0x2c21cc35 CFRunLoopRemoveTimer + 0
    3   AppName                             0x0005a7db AppName + 272347  

我创造了一个简单的篮子,帮助我解冻:

#! /bin/bash
read -p "[Path] [App Name] [Stack Address] [Relative Address] " path appName runtimeAddress relativeAddress
loadAddress=`echo "obase=16;ibase=10;$((runtimeAddress-relativeAddress))" | bc`
atos -o $path/Payload/$appName.app/$appName -l $loadAddress $runtimeAddress -arch armv7

It just reads the path for the app, the app name, the runtime address, and the value after "+" signal (the decimal value) and then find the value for load address to run atos command.

So my case: I m receiving the crash strings out of the NSException.callStackSymbols.

坠毁的痕迹就是这样:

2   AppName                               0x00000001006c75b4 AppName + 2356660
3   AppName                               0x00000001004f5cfc AppName + 449788
4   UIKit                               0x000000018c0a8968 u003credactedu003e + 108
5   UIKit      0x000000018c0a9328 u003credactedu003e + 28
6   UIKit                               0x000000018beea250 u003credactedu003e + 1320
7   UIKit                               0x000000018beede98 u003credactedu003e + 188
8   UIKit                               0x000000018bcb5820 u003credactedu003e + 116
9   UIKit                               0x000000018bbdec88 u003credactedu003e + 760
10  UIKit                               0x000000018bbde610 u003credactedu003e + 312
11  UIKit                               0x000000018bbde31c u003credactedu003e + 296
12  UIKit                               0x000000018bbde3bc u003credactedu003e + 456
13  QuartzCore                          0x0000000185b93b7c u003credactedu003e + 284
14  libdispatch.dylib                   0x00000001811a8a2c u003credactedu003e + 16
15  libdispatch.dylib                   0x00000001811b5654 u003credactedu003e + 1012
16  CoreFoundation                      0x0000000181851650 u003credactedu003e + 12
17  CoreFoundation                      0x000000018184f1a8 u003credactedu003e + 2272
18  CoreFoundation                      0x000000018176f488 CFRunLoopRunSpecific + 552
19  GraphicsServices                    0x0000000183735020 GSEventRunModal + 100
20  UIKit         0x000000018bc09cc0 UIApplicationMain + 236
21  AppName                               0x000000010048f714 AppName + 30484
22  libdyld.dylib 0x000000018120dfc0 u003credactedu003e + 4

Don t include bitcode, as Apple can recompile your code, and dsym files from your archive in Organizer won t match. enter image description here

携带这种印本:

#!/bin/bash
appName=AppName
runtimeAddress=0x00000001006c75b4
relativeAddress=2356660
loadAddress=`echo "obase=16;ibase=10;$((runtimeAddress-relativeAddress))" | bc`
atos -o $appName.app/$appName -l $loadAddress $runtimeAddress -arch arm64

假定,你会创造检验标准。 如果由于许可问题而无法进行切除(/测试.sh):现在,需要工作。 并产生结果。

“在此处的影像描述”/</a

也可使用AppName.app.dSYM档案象征坠毁案:

#!/bin/bash
appName=AppName
runtimeAddress=0x00000001006c75b4
relativeAddress=2356660
loadAddress=`echo "obase=16;ibase=10;$((runtimeAddress-relativeAddress))" | bc`
atos -o $appName.app.dSYM/Contents/Resources/DWARF/$appName -l $loadAddress $runtimeAddress -arch arm64

I think this post may help you, https://stackoverflow.com/a/12559150/1773317. Joe s commit soled my problem.

原因是我的app和.。 海关数据系统档案可以按光灯索引,因此,我的XCode能够准确地象征坠毁信息。

您可尝试使用我写的供象征性使用的文字atos。 指挥:

https://github.com/IdoTene/MacosSymbolicateCrash





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...