From ee316f219758c72398926d207c092b46ef9c2abd Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 24 Feb 2015 21:43:01 -0500 Subject: [PATCH] fix backtrace line numbers on win64 on llvm35+ perhaps we can restore this optimization in the future, for HMODULE addresses from LoadLibrary (rather than the system linker), but that is untested now --- src/debuginfo.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/debuginfo.cpp b/src/debuginfo.cpp index eb9af5866fbbf..21e491386440c 100644 --- a/src/debuginfo.cpp +++ b/src/debuginfo.cpp @@ -504,9 +504,6 @@ void jl_getDylibFunctionInfo(const char **name, size_t *line, const char **filen if (isvalid) { char *fname = ModuleInfo.LoadedImageName; DWORD64 fbase = ModuleInfo.BaseOfImage; -#ifdef LLVM35 - size_t msize = ModuleInfo.ImageSize; -#endif *fromC = (fbase != jl_sysimage_base); if (skipC && *fromC) { return; @@ -566,10 +563,7 @@ void jl_getDylibFunctionInfo(const char **name, size_t *line, const char **filen obfiletype::iterator it = objfilemap.find(fbase); llvm::object::ObjectFile *obj = NULL; if (it == objfilemap.end()) { -#if defined(_OS_DARWIN_) || defined(_OS_WINDOWS_) -#if defined(_OS_WINDOWS_) -#define origerrorobj errorobj -#endif +#if defined(_OS_DARWIN_) #ifdef LLVM36 std::unique_ptr membuf = MemoryBuffer::getMemBuffer( StringRef((const char *)fbase, msize), "", false); @@ -587,7 +581,6 @@ void jl_getDylibFunctionInfo(const char **name, size_t *line, const char **filen llvm::object::ObjectFile *origerrorobj = llvm::object::ObjectFile::createObjectFile( membuf); #endif -#if defined(_OS_DARWIN_) if (!origerrorobj) { objfileentry_t entry = {obj,context,slide}; objfilemap[fbase] = entry; @@ -622,8 +615,7 @@ void jl_getDylibFunctionInfo(const char **name, size_t *line, const char **filen #else llvm::object::ObjectFile *errorobj = llvm::object::ObjectFile::createObjectFile(dsympath); #endif -#endif // ifdef _OS_DARWIN_ -#else // ifdef _OS_DARWIN_ || _OS_WINDOWS_ +#else // ifdef _OS_DARWIN_ // On Linux systems we need to mmap another copy because of the permissions on the mmap'ed shared library. #ifdef LLVM35 auto errorobj = llvm::object::ObjectFile::createObjectFile(fname);