File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1695,3 +1695,21 @@ uint64_t jl_getUnwindInfo(uint64_t dwAddr)
16951695 uv_rwlock_rdunlock (&threadsafe);
16961696 return ipstart;
16971697}
1698+
1699+ extern " C"
1700+ uint64_t jl_trygetUnwindInfo (uint64_t dwAddr)
1701+ {
1702+ // Might be called from unmanaged thread
1703+ Optional<std::map<size_t , ObjectInfo, revcomp>*> maybeobjmap = jl_jit_events->trygetObjectMap ();
1704+ if (maybeobjmap) {
1705+ std::map<size_t , ObjectInfo, revcomp> &objmap = **maybeobjmap;
1706+ std::map<size_t , ObjectInfo, revcomp>::iterator it = objmap.lower_bound (dwAddr);
1707+ uint64_t ipstart = 0 ; // ip of the start of the section (if found)
1708+ if (it != objmap.end () && dwAddr < it->first + it->second .SectionSize ) {
1709+ ipstart = (uint64_t )(uintptr_t )(*it).first ;
1710+ }
1711+ uv_rwlock_rdunlock (&threadsafe);
1712+ return ipstart;
1713+ }
1714+ return 0 ;
1715+ }
Original file line number Diff line number Diff line change @@ -758,6 +758,7 @@ typedef struct {
758758
759759// Might be called from unmanaged thread
760760uint64_t jl_getUnwindInfo (uint64_t dwBase );
761+ uint64_t jl_trygetUnwindInfo (uint64_t dwBase );
761762#ifdef _OS_WINDOWS_
762763#include <dbghelp.h>
763764JL_DLLEXPORT EXCEPTION_DISPOSITION __julia_personality (
You can’t perform that action at this time.
0 commit comments