Dynamic Tracing on Java Exceptions
Embodiments of the invention provide a method and system for tracing Java bytecode. The system provides a user interface for selecting the methods, both primary and secondary, that the user desires to monitor. The user can record the execution of the program and playback the execution of the program while monitoring each of the designated methods and the variables and similar data related to those methods in order to identify a cause of an exception or error in the program.
1 . A method for data access comprising:
receiving an indicator of a method to trace;
inserting a trace instruction into bytecode of the method; and
displaying trace data of the method.
2 . The method for data access of claim 1 , further comprising:
recording execution of a program including the method.
3 . The method for data access of claim 1 , further comprising:
retrieving an execution stack to generate a list of methods; and
displaying the list of methods.
4 . The method for data access of claim 1 , further comprising:
retrieving static information about each method of a stack trace.
5 . The method for data access of claim 4 , further comprising:
collecting dynamic trace information for the method.
6 . The method for data access of claim 1 , further comprising:
playing back a recorded execution of a program including the method.
7 . The method of claim 1 , further comprising:
generate a list of methods that read fields of the method.
8 . The method of claim 6 , further comprising:
displaying a change in variable value in a program with each step through playback.
9 . The method of claim 1 , wherein the trace instruction provides a variable value or path location with the method.
10 . A system for debugging a program in bytecode format comprising:
a user interface module to display a list of methods of the program and receive a selection of a method; and
a program modification module to insert a trace instruction into the program to generate trace data for the method.
11 . The system for debugging a program of claim 10 , further comprising:
a monitor program to control execution of the program and detect an error.
12 . The system for debugging a program of claim 10 , further comprising:
a recording module to track execution of the program.
13 . The system for debugging a program of claim 10 , further comprising:
a playback module to manage execution of the program.
14 . A computer readable medium having stored therein a set of instructions, which when executed, cause the computer to perform a set of operations comprising:
inserting a trace instruction into bytecode of a program; and
monitoring trace data from the trace instruction during execution of the program.
15 . The computer readable medium of claim 14 , having stored therein a further set of instructions, which when executed cause the computer to perform a further set of operations comprising:
displaying a set of methods from a stack trace; and
receiving a selection of a method from the set of methods.
16 . The computer readable medium of claim 14 , having stored therein a further set of instructions, which when executed cause the computer to perform a further set of operations comprising:
recording execution of the program.
17 . The computer readable medium of claim 14 , having stored therein a further set of instructions, which when executed cause the computer to perform a further set of operations comprising:
generating a list of methods that read fields of a method identified in a stack trace.
18 . The computer readable medium of claim 14 , having stored therein a further set of instructions, which when executed cause the computer to perform a further set of operations comprising:
collecting trace data including static and dynamic data for a method.
19 . The computer readable medium of claim 14 , having stored therein a further set of instructions, which when executed cause the computer to perform a further set of operations comprising:
displaying updated trace data for each execution step of the program.
20 . The computer readable medium of claim 14 , having stored therein a further set of instructions, which when executed cause the computer to perform a further set of operations comprising:
identifying an error in program execution.