Symbolizing addresses programmatically

I am looking for a way to symbolize external application symbols (iOS) inside my own application (macOS), assuming I have DSYM and system symbols.

Xcode symbolizes both the addresses of applications and the addresses of system systems (UIKit, Foundation, etc.), atos requires an image file and can symbolize addresses from this image.

I want to symbolize a large number of addresses in my own application. Addresses are stack traces at different points in time. I would also like to symbolize the addresses of the system.

I found atosl that uses dwarf.h and libdwarf.h to override atos to varying degrees of success, however this seems like a very low-level approach.

Is there another way to simultaneously symbolize a large number of addresses?

+5
source share
1 answer

Here are symbols that I use in the tests (required XCTest): https://github.com/avito-tech/Mixbox/blob/db3206c95b71f35ae6032ff9b0baff13026608f4/Frameworks/TestsFoundation/Reporting/FileLineForFailureProvider/SteckTromTraceTerTaceTraceTraceTraceTraceTraceTraceTraceTraceTraceTraceTraceTraceTraceTraceTraceTrace

I use code to highlight test failures in Xcode, without requiring testers to pass file: StaticString = #file, line: UInt = #line everywhere. The code is less readable with this sample, and there is also no particular reason for such a sample, because ideally Xcode should be able to isolate the stack trace if testing fails ...

Please note that there is a problem. If you do not have sources on the computer that is executing the code, this does not symbolize. Maybe this can be fixed quickly, I didn’t even try.

Also in the code there are comments about other options: atos, lldb, CoreSymbolication. I think CoreSymbolication is what you want to use. The solution I gave you is simple, more XCTest dependent, less customizable, has some other disadvantages.

0
source

Source: https://habr.com/ru/post/1271148/


All Articles