vlmillet / llvm-jit-pdb Goto Github PK
View Code? Open in Web Editor NEWDebugging LLVM JIT code inside Visual Studio with PDB
License: Apache License 2.0
Debugging LLVM JIT code inside Visual Studio with PDB
License: Apache License 2.0
Hi, thank you very much for releasing the code for this library. I found a link pointing to here from some LLVM mailing list.
I managed to make it work with clang EmitLLVMOnlyAction+MCJIT. I figured out that your code makes a fundamental assumption about the module passed to it that each section (.text, .debug$T/S, etc) is only emitted once. With a handwritten module like the one in your example code it might be true. However, comprehensive codegen like clang emits every global symbol marked as COMDAT, which allows the linker to erase unused code from the final object. Consequently, each global symbol creates a dedicated section in the output COFF object stream, which is not handled in your code.
I found that this can be overcome by removing the COMDAT pointer from each global symbol and manually update their linking type (otherwise they all become weak symbols) before passing the module to ExecutionEngine, so that when emitting object, the sections will be reused.
for(auto &o : module->globals())
{
o.setComdat(nullptr);
o.setLinkage(llvm::GlobalValue::ExternalLinkage);
}
for(auto &o : module->global_objects())
{
o.setComdat(nullptr);
o.setLinkage(llvm::GlobalValue::ExternalLinkage);
}
for(auto &o : module->functions())
{
o.setComdat(nullptr);
o.setLinkage(llvm::GlobalValue::ExternalLinkage);
}
I would like to try out your tool with a 32-bit process. Can you post the source code for jitmemgen.exe? Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.