Skip to content

Commit

Permalink
fix backtrace line numbers on win64 on llvm35+
Browse files Browse the repository at this point in the history
perhaps we can restore this optimization in the future, for HMODULE addresses from LoadLibrary (rather than the system linker), but that is untested now
  • Loading branch information
vtjnash committed Feb 25, 2015
1 parent de4d81a commit ee316f2
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<MemoryBuffer> membuf = MemoryBuffer::getMemBuffer(
StringRef((const char *)fbase, msize), "", false);
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ee316f2

Please sign in to comment.