Open Quuxplusone opened 11 years ago
Attached manual_i386.s
(32841 bytes, text/plain): assembly file for the code
Eric - this was the bug I was mentioning a few days ago.
I haven't looked into/tried to reproduce it yet, but figured one of us will get to it sooner or later
Was this compiled with -O0 or some optimization?
it was compiled using -O0.
In the above case, we see that the operator+ function's return value is
returned in register edx. But gdb expects the return value in eax.
http://stackoverflow.com/questions/267674/inspect-the-return-value-of-a-function-in-gdb
so if we add the assembly instruction: movl %edx, %eax just before
.loc 1 22 2 instruction in the assembly file and then compile with clang++ and
run the executable, we get the desired results in gdb.
So probably this could be the reason. If this is it we might need to add
another machine instruction. Just needs to be verified properly.
Still a problem for 32-bit.
manual_i386.s
(32841 bytes, text/plain)