[kaffe] Debugging
Pinaki Mukherjee
pinaki2003 at yahoo.com
Tue Nov 23 17:08:42 PST 2004
My understanding is that, for each JVM instruction, one iteration of the loop inside the function runVirtualMachine is executed. Inside this loop, it executes the case block in kaffe.def for that particular instruction. Once the case block finishes execution, control goes back to the loop inside runVirtualMachine and only then the next JVM instruction can execute.
Here I am seeing that while executing inside the block for ALOAD_n, it jumps to the block for GETSTATIC and then JSR_W. I think that even if the instructions GETSTATIC and JSR_W are scheduled by the compiler in this order, even then after executing the case block for ALOAD_n in kaffe.def, it should go back to the loop inside runVirtualMachine and only after that the subsequent instructions can execute. But this is not happening.
I don't know if it's a bug in the debugger. Any explanation?
Michael Franz <mvfranz at gmail.com> wrote:
I was told that this is because the compiler optimzes the instructions
into a different order. This can be over-come by changing the CFLAGS
in config.frag to include -O0
On Mon, 22 Nov 2004 19:59:25 -0800 (PST), Pinaki Mukherjee
wrote:
>
> Hi,
>
> I am trying to step through the JVM instructions in a simple program. I
> start stepping through from the beginning and note the following order of
> instructions getting executed: NEW, DUP, INVOKESPECIAL, ALOAD_n. At this
> point, I am inside kaffe.def (the debugger just shows the file name and line
> number here). Now all of a sudden, from inside the ALOAD_n block in
> kaffe.def, the control jumps to GETSTATIC (instead of going back to
> runVirtualMachine) and then to JSR_W. I am not understanding it. How can
> this happen?
>
> Thanks,
> Pinaki
>
>
>
>
> Pinaki Mukherjee
wrote:
>
> Please, can somenody answer this one...
>
> Thanks.
>
>
> Pinaki Mukherjee
wrote:
>
> Hi,
>
> I modified kaffe.def for each instruction and want to test whether they are
> correct. I want to step through each JVM instruction that is executed in
> Kaffe. I think this consists of instructions for VM creation, the actual
> application execution and the VM destruction. How do I do this?
>
> I tried the following:
> 1. First put a breakpoint in the function runVirtualMachine and then run.
> After the breakpoint is hit, it will run the instructions for VM creation
> until function main2 is hit (is that right?). But I do not have a list of
> the instructions executed for VM creation, so this is difficult.
> 2. I put a breakpoint in main2 and ran upto this point. After that, I put a
> breakpoint in runVirtualMachine. I think after this point the VM will
> execute instructions from the actual application. But when I step inside
> kaffe.def, the first instruction executed (LDC1) is different from the first
> instruction in main (ALOAD_0). I don't understand why this is happening.
>
> Thank you.
>
> Pinaki
>
> ________________________________
> Do you Yahoo!?
> The all-new My Yahoo! â Get yours free!
> _______________________________________________
> kaffe mailing list
> kaffe at kaffe.org
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe
>
>
>
>
> ________________________________
> Do you Yahoo!?
> The all-new My Yahoo! â Get yours free!
>
>
>
> ________________________________
> Do you Yahoo!?
> Discover all that's new in My Yahoo!
>
>
> _______________________________________________
> kaffe mailing list
> kaffe at kaffe.org
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe
>
>
>
---------------------------------
Do you Yahoo!?
Meet the all-new My Yahoo! Try it today!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://kaffe.org/pipermail/kaffe/attachments/20041123/ddd4ce4c/attachment-0006.htm
More information about the kaffe
mailing list