ianlancetaylor / libbacktrace

A C library that may be linked into a C/C++ program to produce symbolic backtraces
Other
939 stars 219 forks source link

dSYM files are not found for applications/packages #126

Open pdoane opened 3 months ago

pdoane commented 3 months ago

I am successfully using libbacktrace for simple mach-o executables but the logic to find the .dSYM file is not working for application bundles. For example, the filename for macho_add_dsym looks like:

<app_name>.app/Contents/MacOS/<app_name>

and it should be looking to find the .dSYM file here:

<app_name>.app.dSYM/Contents/Resources/DWARF/<app_name>

but instead looks here:

<app_name>.app/Contents/MacOS/<app_name>.dSYM/Contents/Resources/DWARF/<app_name>

I did a quick test to generate the path as suggested above and that resolves the issue.

ianlancetaylor commented 1 month ago

It's not clear to me why the current code isn't working. In libbacktrace/macho.c in macho_add_dsym I see that it strips everything after the last slash when assembling the dsym name. Can you post the patch that you are using the get the correct dsym path? Thanks.