Skip to content

Commit

Permalink
Merge pull request JuliaLang#15616 from JuliaLang/kf/putbackgetfptr
Browse files Browse the repository at this point in the history
Two more tweaks for the debugger
  • Loading branch information
JeffBezanson committed Mar 24, 2016
2 parents bee7ba4 + 8d0a9d1 commit 77936d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,12 @@ static uint64_t getAddressForFunction(llvm::Function *llvmf)
#endif
}

extern "C" JL_DLLEXPORT
uint64_t jl_get_llvm_fptr(llvm::Function *llvmf)
{
return getAddressForFunction(llvmf);
}

// this assumes that jl_compile_linfo has already been called
// and forces compilation of the lambda info
extern "C" void jl_generate_fptr(jl_lambda_info_t *li)
Expand Down
9 changes: 8 additions & 1 deletion src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ typedef struct {
int64_t slide;
int64_t section_slide;
} objfileentry_t;
typedef std::map<uint64_t, objfileentry_t> obfiletype;
typedef std::map<uint64_t, objfileentry_t, revcomp> obfiletype;
static obfiletype objfilemap;

#ifdef _OS_DARWIN_
Expand Down Expand Up @@ -1056,6 +1056,13 @@ JL_DLLEXPORT uint64_t jl_get_section_start(uint64_t fptr)
uint64_t ret = 0;
if (fit != objmap.end() && fptr < fit->first + fit->second.SectionSize) {
ret = fit->first;
} else {
obfiletype::iterator objit = objfilemap.lower_bound(fptr);
// Ideally we'd have a containment check here, but we can't really
// get the shared library size easily.
if (objit != objfilemap.end()) {
ret = objit->first;
}
}
uv_rwlock_rdunlock(&threadsafe);
return ret;
Expand Down

0 comments on commit 77936d0

Please sign in to comment.