Skip to content

Commit

Permalink
Fix another error in backport of #37101 impacting Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sacha0 committed Oct 22, 2020
1 parent 7285f71 commit fd03cb5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1695,3 +1695,21 @@ uint64_t jl_getUnwindInfo(uint64_t dwAddr)
uv_rwlock_rdunlock(&threadsafe);
return ipstart;
}

extern "C"
uint64_t jl_trygetUnwindInfo(uint64_t dwAddr)
{
// Might be called from unmanaged thread
Optional<std::map<size_t, ObjectInfo, revcomp>*> maybeobjmap = jl_jit_events->trygetObjectMap();
if (maybeobjmap) {
std::map<size_t, ObjectInfo, revcomp> &objmap = **maybeobjmap;
std::map<size_t, ObjectInfo, revcomp>::iterator it = objmap.lower_bound(dwAddr);
uint64_t ipstart = 0; // ip of the start of the section (if found)
if (it != objmap.end() && dwAddr < it->first + it->second.SectionSize) {
ipstart = (uint64_t)(uintptr_t)(*it).first;
}
uv_rwlock_rdunlock(&threadsafe);
return ipstart;
}
return 0;
}
1 change: 1 addition & 0 deletions src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ typedef struct {

// Might be called from unmanaged thread
uint64_t jl_getUnwindInfo(uint64_t dwBase);
uint64_t jl_trygetUnwindInfo(uint64_t dwBase);
#ifdef _OS_WINDOWS_
#include <dbghelp.h>
JL_DLLEXPORT EXCEPTION_DISPOSITION __julia_personality(
Expand Down

0 comments on commit fd03cb5

Please sign in to comment.