Displaying 5 results from an estimated 5 matches for "mbjit".
Did you mean:
mbit
2014 Mar 19
2
[LLVMdev] load bytecode from string for jiting problem
all of:
----
// cout << "lsr: " << lsr << "\n";
llvm::MemoryBuffer* mbjit =
llvm::MemoryBuffer::getMemBufferCopy (sr);
------
string lsr = sr.str();
// cout << "lsr: " << lsr << "\n";
llvm::MemoryBuffer* mbjit =...
2014 Mar 20
2
[LLVMdev] load bytecode from string for jiting problem
...if (sr.str()[2] == (char) 0xc0)
std::cout << "0xc0 ok\n";
if (sr.str()[3] == (char) 0xde)
std::cout << "0xde ok\n";
llvm::MemoryBuffer* mbjit = llvm::MemoryBuffer::getMemBufferCopy (sr);
llvm::ErrorOr<llvm::Module*> ModuleOrErr = llvm::parseBitcodeFile (mbjit, context);
if (llvm::error_code EC = ModuleOrErr.getError()) {
std::cout << ModuleOrErr.getError().message() << "\n";
}
Module* Mjit = ModuleOrEr...
2014 Mar 20
2
[LLVMdev] load bytecode from string for jiting problem
...c0 and 0xde are in correct order. In
your case, the first byte is read as 37 (= 0x25). I wonder why? When you
check the bytes yourself, you get expected results. When the same bytes are
read from Stream object, you get a different result (maybe garbage). I
would suggest that you put a watchpoint on mbjit->getBufferStart() and
single step your program to make sure it is not freed, over written
somewhere.
thx
Vikas.
=======
On Thu, Mar 20, 2014 at 7:50 AM, Willy WOLFF <willy.wolff at etu.unistra.fr>wrote:
> The stack trace is:
> (gdb) bt
> #0 0x00000000004fa8c8 in llvm::Bitstr...
2014 Mar 19
2
[LLVMdev] load bytecode from string for jiting problem
...lt;< "C ok\n";
>> if (sr.str()[2] == (char) 0xc0)
>> std::cout << "0xc0 ok\n";
>> if (sr.str()[3] == (char) 0xde)
>> std::cout << "0xde ok\n";
>>
>> 3) I try to parse the gv by
>> MemoryBuffer* mbjit = MemoryBuffer::getMemBuffer (sr.str());
>
> Not sure if this is your issue, but should be fixed anyway:
>
> The std::string created by "sr.str()" ends its lifetime in this
> statement, and MemoryBuffer for efficiency reasons
> avoids copying data it doesn't have to...
2014 Mar 13
2
[LLVMdev] load bytecode from string for jiting problem
...uot;B ok\n";
if (sr.str()[1] == 'C')
std::cout << "C ok\n";
if (sr.str()[2] == (char) 0xc0)
std::cout << "0xc0 ok\n";
if (sr.str()[3] == (char) 0xde)
std::cout << "0xde ok\n";
3) I try to parse the gv by
MemoryBuffer* mbjit = MemoryBuffer::getMemBuffer (sr.str());
LLVMContext& context = getGlobalContext();
ErrorOr<Module*> ModuleOrErr = parseBitcodeFile (mbjit, context);
if (error_code EC = ModuleOrErr.getError())
{
std::cout << ModuleOrErr.getError().message() << "\n";...