Line number from JPDA/JDI JVM

Discussion in 'Java' started by neogguy@yahoo.co.uk, Feb 10, 2005.

  1. Guest

    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
     
    , Feb 10, 2005
    #1
    1. Advertising

  2. Guest

    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.
     
    , Feb 10, 2005
    #2
    1. Advertising

  3. Jamie Guest

    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.
     
    Jamie, Feb 11, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. NOBODY
    Replies:
    3
    Views:
    577
    Larry Barowski
    Feb 4, 2004
  2. Ben War

    JPDA Trace access to object

    Ben War, May 7, 2004, in forum: Java
    Replies:
    2
    Views:
    442
    Ben War
    May 11, 2004
  3. Marco Lorenzini
    Replies:
    0
    Views:
    390
    Marco Lorenzini
    May 13, 2004
  4. Ken Blau  Original Author

    Tomcat jpda JWSDPLaunchFilter.class jwsdp

    Ken Blau Original Author, Jul 18, 2004, in forum: Java
    Replies:
    0
    Views:
    397
    Ken Blau Original Author
    Jul 18, 2004
  5. Ken.C
    Replies:
    1
    Views:
    558
    Chris Uppal
    Feb 7, 2007
Loading...

Share This Page