< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java

Print this page




 532                 // Not an address
 533                 boolean all = name.equals("-a");
 534                 Threads threads = VM.getVM().getThreads();
 535                 for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
 536                     ByteArrayOutputStream bos = new ByteArrayOutputStream();
 537                     thread.printThreadIDOn(new PrintStream(bos));
 538                     if (all || bos.toString().equals(name)) {
 539                         if (thread instanceof CompilerThread) {
 540                             CompilerThread ct = (CompilerThread)thread;
 541                             ciEnv env = ct.env();
 542                             if (env != null) {
 543                                env.dumpReplayData(out);
 544                             }
 545                         }
 546                     }
 547                 }
 548             }
 549         },
 550         new Command("buildreplayjars", "buildreplayjars [ all | app | boot ]  | [ prefix ]", false) {
 551             // This is used to dump jar files of all the classes
 552             // loaded in the core.  Everything on the bootclasspath
 553             // will go in boot.jar and everything else will go in
 554             // app.jar.  Then the classes can be loaded by the replay
 555             // jvm using -Xbootclasspath/p:boot.jar -cp app.jar. boot.jar usually
 556             // not needed, unless changed by jvmti.
 557             public void doit(Tokens t) {
 558                 int tcount = t.countTokens();
 559                 if (tcount > 2) {
 560                     usage();
 561                     return;
 562                 }
 563                 try {
 564                    String prefix = "";
 565                    String option = "all"; // default
 566                    switch(tcount) {
 567                        case 0:
 568                            break;
 569                        case 1:
 570                            option = t.nextToken();
 571                            if (!option.equalsIgnoreCase("all") && !option.equalsIgnoreCase("app") &&
 572                                !option.equalsIgnoreCase("root")) {
 573                               prefix = option;
 574                               option = "all";
 575                            }
 576                            break;




 532                 // Not an address
 533                 boolean all = name.equals("-a");
 534                 Threads threads = VM.getVM().getThreads();
 535                 for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
 536                     ByteArrayOutputStream bos = new ByteArrayOutputStream();
 537                     thread.printThreadIDOn(new PrintStream(bos));
 538                     if (all || bos.toString().equals(name)) {
 539                         if (thread instanceof CompilerThread) {
 540                             CompilerThread ct = (CompilerThread)thread;
 541                             ciEnv env = ct.env();
 542                             if (env != null) {
 543                                env.dumpReplayData(out);
 544                             }
 545                         }
 546                     }
 547                 }
 548             }
 549         },
 550         new Command("buildreplayjars", "buildreplayjars [ all | app | boot ]  | [ prefix ]", false) {
 551             // This is used to dump jar files of all the classes
 552             // loaded in the core.  Everything with null classloader 
 553             // will go in boot.jar and everything else will go in
 554             // app.jar. boot.jar usually not needed, unless changed by jvmti.


 555             public void doit(Tokens t) {
 556                 int tcount = t.countTokens();
 557                 if (tcount > 2) {
 558                     usage();
 559                     return;
 560                 }
 561                 try {
 562                    String prefix = "";
 563                    String option = "all"; // default
 564                    switch(tcount) {
 565                        case 0:
 566                            break;
 567                        case 1:
 568                            option = t.nextToken();
 569                            if (!option.equalsIgnoreCase("all") && !option.equalsIgnoreCase("app") &&
 570                                !option.equalsIgnoreCase("root")) {
 571                               prefix = option;
 572                               option = "all";
 573                            }
 574                            break;


< prev index next >