Line number from JPDA/JDI JVM

N

neogguy

Does anyone know how to get which lines in a peice of code has been
executed.

Lets say I have a programme of 20 lines and only line 10 to 15 have
been executed, is there anyway of finding out those lines from the JVM
with JPDA/JDI or something.

Thanks
 
T

toxa26

There is. You'll need jdk 1.4, which supports profiling, and a
profiling tool. Google around for java profiling tools. There are
tons of them.
 
J

Jamie

but I'm trying to write a programme that will do that.

lets say I have a programme like this

1 int x=2;
2 int y=3;
3 int z=0;
4 z=x+y;
5 for(int m=0; m<0; m++)
6 {do something;
7 }

I want to write a programme that will give an output of
1
2
3
4

as line 5 to 7 will never run, but 1 to 4 did.

Thanks

J.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top