Displaying 5 results from an estimated 5 matches for "debugint".
Did you mean:
debuging
2017 Jun 05
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...;debugPointer", ptr);
// Set class pointer
auto c = ctx.bld.CreateExtractValue(val, 0, "class");
auto cp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 0);
auto cx = ctx.bld.CreatePtrToInt(cp, ctx.Int32Type());
ctx.EmitCall1("debugInt", cx);
ctx.bld.CreateStore(c, cp);
// Set datum
auto d = ctx.bld.CreateExtractValue(val, 1, "datum");
auto dp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 1);
auto dx = ctx.bld.CreatePtrToInt(dp, ctx.Int32Type());
ct...
2017 Jun 06
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...>
This looks like a bug in the handling of constant GEP's. Specifically the
`getelementptr inbounds ({ i8*, i32 }, { i8*, i32 }* @foo, i32 0, i32 1)`
used to calculate the address of the integer inside the struct. Your
observation "The bizarre thing is that even this looks correct: the
debugInt is called first with @foo, then @foo+4, and the stores seem to be
going to the right addresses as well: @foo and @foo+4!" at the level of the
MachineInstr dump rules out problems before that.
After MachineInstr comes MC to emit the object file, but `foo+4` is one of
the most basic relocation...
2017 Jun 06
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...00000019: IMAGE_REL_I386_DIR32 _foo
> 1d: 89 44 24 3c movl %eax, 60(%esp)
> 21: 89 54 24 38 movl %edx, 56(%esp)
> 25: e8 00 00 00 00 calll 0 <_setfoo+0x26>
> 00000026: IMAGE_REL_I386_REL32 _debugInt
> 2a: c7 05 00 00 00 00 00 00 00 00 movl $0, 0
> 0000002c: IMAGE_REL_I386_DIR32 _foo
> 00000030: IMAGE_REL_I386_DIR32 _JazzFixnumClass
> 34: b9 00 00 00 00 movl $0, %ecx
> 00000...
2017 Jun 07
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...L_I386_DIR32 _foo
>>> 1d: 89 44 24 3c movl %eax, 60(%esp)
>>> 21: 89 54 24 38 movl %edx, 56(%esp)
>>> 25: e8 00 00 00 00 calll 0 <_setfoo+0x26>
>>> 00000026: IMAGE_REL_I386_REL32 _debugInt
>>> 2a: c7 05 00 00 00 00 00 00 00 00 movl $0, 0
>>> 0000002c: IMAGE_REL_I386_DIR32 _foo
>>> 00000030: IMAGE_REL_I386_DIR32 _JazzFixnumClass
>>> 34: b9 00 00 00 00 movl $0, %ecx
&g...
2017 Jun 04
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
Emitting calls to these functions (written in an .ll file linked in) works
fine, and does the right thing.
%Any = type { i8*, i32 }
define dllexport void @setGlobal(%Any* %ptr, %Any %value) {
store %Any %value, %Any* %ptr
ret void
}
define dllexport %Any @getGlobal(%Any* %ptr) {
%val = load %Any, %Any* %ptr
ret %Any %val
}
Trying to replace the setGlobal call with what should be