Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS call stack support #25

Closed
arizigler opened this issue May 17, 2020 · 3 comments
Closed

iOS call stack support #25

arizigler opened this issue May 17, 2020 · 3 comments

Comments

@arizigler
Copy link

Hi,

First and foremost - I find this tool amazing! Thank you so much for putting effort into it!

I Was trying to use tracy with a library I wrote in c++ in iOS environment.

It all seemed to work great except for missing call stacks.
In #8 I saw that you mentioned that it makes no sense to catch crashes on iOS as there are no symbols on the device.

I don't know about crashes (as I didn't test it yet) but for typical profiling I managed to workaround this issue by:

  1. removing the ".app" suffix from the dSYM file (currently its auto-generated name is .app.dSYM) due to macho.cpp's search path expectation (dsymsuffixdir).
  2. pushing the dSYM file alongside my app's binary (as I do for any other resource needed during runtime).

I've decided to share my findings here for my fellas iOS programmers and for you to consider adding these as side notes to the manual.

Tnx.

@wolfpld
Copy link
Owner

wolfpld commented May 17, 2020

That's a great find! But can you provide a more detailed description? For example, what is your build environment, are you using Xcode, or some sort of custom makefiles? Where can you find the dSYM file? How can it be pushed to the target device? Can this process be automated, so that Xcode builds do this automatically?

@wolfpld
Copy link
Owner

wolfpld commented May 17, 2020

Also tagging @thedmd, I'm sure he will be interested.

@arizigler
Copy link
Author

arizigler commented May 17, 2020

@wolfpld, sure.
I'm using XCode 11.4.1 and integrated the process into its Build-Phase by adding a "New Run Script Phase":
image
It's worth mentioning, though, that in order to fire up the static profiler's constructor I had to add the following lines of code in the global area:

auto const& profiler = tracy::GetProfiler();

I've verified that the above call is executed before the ObjC "main" function, as intended.

---- edit:
The copy line in the script shall be:
cp -rf ${TARGET_BUILD_DIR}/${WRAPPER_NAME}.dSYM/ ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/${PRODUCT_NAME}.dSYM
(note the asterisk (*))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants