mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 17:05:59 +01:00
CrashReporter: Fix compilation with musl libc (#4805)
It can be assumed this doesn't function correctly: my 'configuration does not support execinfo.h', so I have no backtrace to test against
This commit is contained in:
parent
05dd204c5f
commit
b1e2ca04a0
1 changed files with 6 additions and 1 deletions
|
@ -108,11 +108,16 @@ void CrashReporter::createAndSaveCrash(int sig) {
|
|||
|
||||
std::string addrs = "";
|
||||
for (size_t i = 0; i < CALLSTACK.size(); ++i) {
|
||||
#ifdef __GLIBC__
|
||||
// convert in memory address to VMA address
|
||||
Dl_info info;
|
||||
struct link_map* linkMap;
|
||||
dladdr1((void*)CALLSTACK[i].adr, &info, (void**)&linkMap, RTLD_DL_LINKMAP);
|
||||
size_t vmaAddr = (size_t)CALLSTACK[i].adr - linkMap->l_addr;
|
||||
#else
|
||||
// musl doesn't define dladdr1
|
||||
size_t vmaAddr = (size_t)CALLSTACK[i].adr;
|
||||
#endif
|
||||
|
||||
addrs += std::format("0x{:x} ", vmaAddr);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue