1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

libbacktrace: Add support for Mach-O (dSYM)

`macho.cpp` was backported from official libbacktrace repository.
This commit is contained in:
thedmd
2019-11-29 12:04:47 +01:00
parent 5b83ae4381
commit a1e2c533f6
4 changed files with 1454 additions and 128 deletions
+22 -4
View File
@@ -45,6 +45,10 @@ POSSIBILITY OF SUCH DAMAGE. */
# include <limits.h>
#endif
#ifdef __APPLE__
# include <mach-o/dyld.h>
#endif
#include "backtrace.hpp"
#include "internal.hpp"
@@ -73,10 +77,24 @@ getexecname(void)
return rc ? NULL : execname;
}
# endif
#else
# ifndef HAVE_GETEXECNAME
# define getexecname() NULL
# endif
#endif
#if !defined HAVE_GETEXECNAME && defined __APPLE__
# define HAVE_GETEXECNAME
static char execname[PATH_MAX + 1];
static const char *
getexecname(void)
{
uint32_t size = sizeof(execname);
if (_NSGetExecutablePath(execname, &size) == 0)
return execname;
else
return NULL;
}
#endif
#ifndef HAVE_GETEXECNAME
# define getexecname() NULL
#endif
namespace tracy