Java Reference
In-Depth Information
$ java starting.Buggy
Exception in thread "main" java.lang.NullPointerException
at Buggy.main(Compiled Code)
$ jdb starting/Buggy
Initializing jdb...
0xb2:class(Buggy)
> run
run Buggy
running ...
main[1]
Uncaught exception: java.lang.NullPointerException
at Buggy.main(Buggy.java:6)
at sun.tools.agent.MainThread.runMain(Native Method)
at sun.tools.agent.MainThread.run(MainThread.java:49)
main[1] list
2 public class Buggy {
3 static String name;
4
5 public static void main(String[] args) {
6 => int n = name.length( ); // bug # 1
7
8 System.out.println(n);
9
10 name += "; The end."; // bug #2
main[1] print Buggy.name
Buggy.name = null
main[1] help
** command list **
threads [threadgroup] -- list threads
thread <thread id> -- set default thread
suspend [thread id(s)] -- suspend threads (default: all)
resume [thread id(s)] -- resume threads (default: all)
where [thread id] | all -- dump a thread's stack
wherei [thread id] | all -- dump a thread's stack, with pc info
threadgroups -- list threadgroups
threadgroup <name> -- set current threadgroup
print <id> [id(s)] -- print object or field
dump <id> [id(s)] -- print all object information
locals -- print all local variables in current stack frame
classes -- list currently known classes
methods <class id> -- list a class's methods
Search WWH ::




Custom Search