agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8024760 Sdiff agent/src/share/classes/sun/jvm/hotspot

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

Print this page




1196                                 step = oop.getObjectSize();
1197                             } catch (UnknownOopException ex) {
1198                                 // ok
1199                             } catch (RuntimeException ex) {
1200                                 ex.printStackTrace();
1201                             }
1202                         }
1203                         base = base.addOffsetTo(step);
1204                     }
1205                 }
1206             }
1207         },
1208         new Command("intConstant", "intConstant [ name [ value ] ]", true) {
1209             public void doit(Tokens t) {
1210                 if (t.countTokens() != 1 && t.countTokens() != 0 && t.countTokens() != 2) {
1211                     usage();
1212                     return;
1213                 }
1214                 HotSpotTypeDataBase db = (HotSpotTypeDataBase)agent.getTypeDataBase();
1215                 if (t.countTokens() == 1) {

1216                     out.println("intConstant " + name + " " + db.lookupIntConstant(name));
1217                 } else if (t.countTokens() == 0) {
1218                     Iterator i = db.getIntConstants();
1219                     while (i.hasNext()) {
1220                         String name = (String)i.next();
1221                         out.println("intConstant " + name + " " + db.lookupIntConstant(name));
1222                     }
1223                 } else if (t.countTokens() == 2) {
1224                     String name = t.nextToken();
1225                     Integer value = Integer.valueOf(t.nextToken());
1226                     db.addIntConstant(name, value);
1227                 }
1228             }
1229         },
1230         new Command("longConstant", "longConstant [ name [ value ] ]", true) {
1231             public void doit(Tokens t) {
1232                 if (t.countTokens() != 1 && t.countTokens() != 0 && t.countTokens() != 2) {
1233                     usage();
1234                     return;
1235                 }
1236                 HotSpotTypeDataBase db = (HotSpotTypeDataBase)agent.getTypeDataBase();
1237                 if (t.countTokens() == 1) {

1238                     out.println("longConstant " + name + " " + db.lookupLongConstant(name));
1239                 } else if (t.countTokens() == 0) {
1240                     Iterator i = db.getLongConstants();
1241                     while (i.hasNext()) {
1242                         String name = (String)i.next();
1243                         out.println("longConstant " + name + " " + db.lookupLongConstant(name));
1244                     }
1245                 } else if (t.countTokens() == 2) {
1246                     String name = t.nextToken();
1247                     Long value = Long.valueOf(t.nextToken());
1248                     db.addLongConstant(name, value);
1249                 }
1250             }
1251         },
1252         new Command("field", "field [ type [ name fieldtype isStatic offset address ] ]", true) {
1253             public void doit(Tokens t) {
1254                 if (t.countTokens() != 1 && t.countTokens() != 0 && t.countTokens() != 6) {
1255                     usage();
1256                     return;
1257                 }




1196                                 step = oop.getObjectSize();
1197                             } catch (UnknownOopException ex) {
1198                                 // ok
1199                             } catch (RuntimeException ex) {
1200                                 ex.printStackTrace();
1201                             }
1202                         }
1203                         base = base.addOffsetTo(step);
1204                     }
1205                 }
1206             }
1207         },
1208         new Command("intConstant", "intConstant [ name [ value ] ]", true) {
1209             public void doit(Tokens t) {
1210                 if (t.countTokens() != 1 && t.countTokens() != 0 && t.countTokens() != 2) {
1211                     usage();
1212                     return;
1213                 }
1214                 HotSpotTypeDataBase db = (HotSpotTypeDataBase)agent.getTypeDataBase();
1215                 if (t.countTokens() == 1) {
1216                     String name = t.nextToken();
1217                     out.println("intConstant " + name + " " + db.lookupIntConstant(name));
1218                 } else if (t.countTokens() == 0) {
1219                     Iterator i = db.getIntConstants();
1220                     while (i.hasNext()) {
1221                         String name = (String)i.next();
1222                         out.println("intConstant " + name + " " + db.lookupIntConstant(name));
1223                     }
1224                 } else if (t.countTokens() == 2) {
1225                     String name = t.nextToken();
1226                     Integer value = Integer.valueOf(t.nextToken());
1227                     db.addIntConstant(name, value);
1228                 }
1229             }
1230         },
1231         new Command("longConstant", "longConstant [ name [ value ] ]", true) {
1232             public void doit(Tokens t) {
1233                 if (t.countTokens() != 1 && t.countTokens() != 0 && t.countTokens() != 2) {
1234                     usage();
1235                     return;
1236                 }
1237                 HotSpotTypeDataBase db = (HotSpotTypeDataBase)agent.getTypeDataBase();
1238                 if (t.countTokens() == 1) {
1239                     String name = t.nextToken();
1240                     out.println("longConstant " + name + " " + db.lookupLongConstant(name));
1241                 } else if (t.countTokens() == 0) {
1242                     Iterator i = db.getLongConstants();
1243                     while (i.hasNext()) {
1244                         String name = (String)i.next();
1245                         out.println("longConstant " + name + " " + db.lookupLongConstant(name));
1246                     }
1247                 } else if (t.countTokens() == 2) {
1248                     String name = t.nextToken();
1249                     Long value = Long.valueOf(t.nextToken());
1250                     db.addLongConstant(name, value);
1251                 }
1252             }
1253         },
1254         new Command("field", "field [ type [ name fieldtype isStatic offset address ] ]", true) {
1255             public void doit(Tokens t) {
1256                 if (t.countTokens() != 1 && t.countTokens() != 0 && t.countTokens() != 6) {
1257                     usage();
1258                     return;
1259                 }


agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File