JDB supporting reverse watchpoint (jdb-rw)
Last modified: 2003/08/21 15:17:35
Japanese is here.
Overview
Our JDB, jdb-rw, supports reverse watchpoint. The implemented commands are the same as ones of gdb-wrapper.pl of gcc-pg2, except two points: (1) restarting a debuggee occurs only if it needs, (2) jdb-rw caches the positions in pass 1 of revwatch.
Requirements
How to use
- Download BCEL. The latest version is v5.1/bcel-5.1.tar.gz at Aug., 2003.
- Download jdb-rw.jar (about 150kB).
- Convert a program to be debugged, debuggee, in order to add the timestamp system. Please change the path of tools.jar properly.
java -classpath jdb-rw.jar:bcel-5.1.jar:/usr/java/j2sdk1.4.2/lib/tools.jar Convert debuggee.class
- Invoke jdb-rw. Note that jdb-rw.jar must be on the left of tools.jar.
java -classpath jdb-rw.jar:/usr/java/j2sdk1.4.2/lib/tools.jar com.sun.tools.example.debug.tty.TTY debuggee args...
Commands of jdb-rw
- mark
- Mark a position. With no arguments, print the list of marked positions.
mark [<timestamp> [<ClassID:LineNum>]]
- unmark
- Unmark a marked position. The argument is the number of the position.
unmark [<PosNum>]
- jump
- Move the control point of the debuggee to a designated position. If the position is prior to the current one, it will be restarted. The argument is the number of the position.
jump [<PosNum>]
- revwatch
- Move the control point to the last position where a designated field was assigned. The argument is the same as one of normal "watch" command.
revwatch <ClassID.FieldName>
Known bugs
- After "jump" is executed, "print" sometimes causes "Internal exception during operation".
-> Wait a moment and "print" again...
- "revwatch" cannot watch fields of individual objects.
-> Original JDB does not support it. We can use "Instance Filters", which is added since J2SE-1.4.1, for it, but we don't implement it yet...
- "mark", "jump", and "revwatch" cannot be applied to multi-threaded Java programs, because they require deterministic execution of debuggees.
-> Record and replay mechanisms (future work).
Future work
- Record and replay mechanisms for multi-threaded Java programs.
Kazutaka Maruyama <kazutaka_(!!at-mark!!)_sanpo-lab.jp> (anti-spammed)