hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java

Print this page
rev 611 : Merge
   1 /*
   2  * Copyright 2002-2004 Sun Microsystems, Inc.  All Rights Reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  20  * CA 95054 USA or visit www.sun.com if you need additional information or
  21  * have any questions.
  22  *  


  68         threadFactory = new RemoteAMD64ThreadFactory(this);
  69         cachePageSize = 4096;
  70         cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
  71         unalignedAccessesOkay = true;
  72       } else {
  73         throw new DebuggerException("Thread access for CPU architecture " + cpu + " not yet supported");
  74       }
  75 
  76       // Cache portion of the remote process's address space.
  77       initCache(cachePageSize, cacheNumPages);
  78 
  79       jbooleanSize = remoteDebugger.getJBooleanSize();
  80       jbyteSize    = remoteDebugger.getJByteSize();
  81       jcharSize    = remoteDebugger.getJCharSize();
  82       jdoubleSize  = remoteDebugger.getJDoubleSize();
  83       jfloatSize   = remoteDebugger.getJFloatSize();
  84       jintSize     = remoteDebugger.getJIntSize();
  85       jlongSize    = remoteDebugger.getJLongSize();
  86       jshortSize   = remoteDebugger.getJShortSize();
  87       javaPrimitiveTypesConfigured = true;



  88     }
  89     catch (RemoteException e) {
  90       throw new DebuggerException(e);
  91     }
  92   }
  93 
  94   public long[] getThreadIntegerRegisterSet(Address addr) {
  95     try {
  96       return remoteDebugger.getThreadIntegerRegisterSet(getAddressValue(addr), true);
  97     }
  98     catch (RemoteException e) {
  99       throw new DebuggerException(e);
 100     }
 101   }
 102 
 103   public long[] getThreadIntegerRegisterSet(long id) {
 104     try {
 105       return remoteDebugger.getThreadIntegerRegisterSet(id, false);
 106     }
 107     catch (RemoteException e) {


 281   public String addressValueToString(long addr) {
 282     return utils.addressValueToString(addr);
 283   }
 284 
 285   public long getAddressValue(Address addr) throws DebuggerException {
 286     if (addr == null) return 0;
 287     return ((RemoteAddress) addr).getValue();
 288   }
 289 
 290   public Address newAddress(long value) {
 291     if (value == 0) return null;
 292     return new RemoteAddress(this, value);
 293   }
 294 
 295   RemoteAddress readAddress(long address)
 296     throws UnmappedAddressException, UnalignedAddressException {
 297     long value = readAddressValue(address);
 298     return (value == 0 ? null : new RemoteAddress(this, value));
 299   }
 300 






 301   RemoteOopHandle readOopHandle(long address)
 302     throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
 303     long value = readAddressValue(address);
 304     return (value == 0 ? null : new RemoteOopHandle(this, value));
 305   }
 306 






 307   boolean areThreadsEqual(Address addr1, Address addr2) {
 308     try {
 309        return remoteDebugger.areThreadsEqual(getAddressValue(addr1), true,
 310                                              getAddressValue(addr2), true);
 311     } catch (RemoteException e) {
 312     }
 313     return false;
 314   }
 315 
 316   boolean areThreadsEqual(long id1, long id2) {
 317     try {
 318        return remoteDebugger.areThreadsEqual(id1, false, id2, false);
 319     } catch (RemoteException e) {
 320     }
 321     return false;
 322   }
 323 
 324   boolean areThreadsEqual(Address addr1, long id2) {
 325     try {
 326        return remoteDebugger.areThreadsEqual(getAddressValue(addr1), true, id2, false);


   1 /*
   2  * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  20  * CA 95054 USA or visit www.sun.com if you need additional information or
  21  * have any questions.
  22  *  


  68         threadFactory = new RemoteAMD64ThreadFactory(this);
  69         cachePageSize = 4096;
  70         cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
  71         unalignedAccessesOkay = true;
  72       } else {
  73         throw new DebuggerException("Thread access for CPU architecture " + cpu + " not yet supported");
  74       }
  75 
  76       // Cache portion of the remote process's address space.
  77       initCache(cachePageSize, cacheNumPages);
  78 
  79       jbooleanSize = remoteDebugger.getJBooleanSize();
  80       jbyteSize    = remoteDebugger.getJByteSize();
  81       jcharSize    = remoteDebugger.getJCharSize();
  82       jdoubleSize  = remoteDebugger.getJDoubleSize();
  83       jfloatSize   = remoteDebugger.getJFloatSize();
  84       jintSize     = remoteDebugger.getJIntSize();
  85       jlongSize    = remoteDebugger.getJLongSize();
  86       jshortSize   = remoteDebugger.getJShortSize();
  87       javaPrimitiveTypesConfigured = true;
  88       heapBase     = remoteDebugger.getHeapBase();
  89       heapOopSize  = remoteDebugger.getHeapOopSize();
  90       logMinObjAlignmentInBytes  = remoteDebugger.getLogMinObjAlignmentInBytes();
  91     }
  92     catch (RemoteException e) {
  93       throw new DebuggerException(e);
  94     }
  95   }
  96 
  97   public long[] getThreadIntegerRegisterSet(Address addr) {
  98     try {
  99       return remoteDebugger.getThreadIntegerRegisterSet(getAddressValue(addr), true);
 100     }
 101     catch (RemoteException e) {
 102       throw new DebuggerException(e);
 103     }
 104   }
 105 
 106   public long[] getThreadIntegerRegisterSet(long id) {
 107     try {
 108       return remoteDebugger.getThreadIntegerRegisterSet(id, false);
 109     }
 110     catch (RemoteException e) {


 284   public String addressValueToString(long addr) {
 285     return utils.addressValueToString(addr);
 286   }
 287 
 288   public long getAddressValue(Address addr) throws DebuggerException {
 289     if (addr == null) return 0;
 290     return ((RemoteAddress) addr).getValue();
 291   }
 292 
 293   public Address newAddress(long value) {
 294     if (value == 0) return null;
 295     return new RemoteAddress(this, value);
 296   }
 297 
 298   RemoteAddress readAddress(long address)
 299     throws UnmappedAddressException, UnalignedAddressException {
 300     long value = readAddressValue(address);
 301     return (value == 0 ? null : new RemoteAddress(this, value));
 302   }
 303 
 304   RemoteAddress readCompOopAddress(long address)
 305     throws UnmappedAddressException, UnalignedAddressException {
 306     long value = readCompOopAddressValue(address);
 307     return (value == 0 ? null : new RemoteAddress(this, value));
 308   }
 309 
 310   RemoteOopHandle readOopHandle(long address)
 311     throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
 312     long value = readAddressValue(address);
 313     return (value == 0 ? null : new RemoteOopHandle(this, value));
 314   }
 315 
 316   RemoteOopHandle readCompOopHandle(long address)
 317     throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
 318     long value = readCompOopAddressValue(address);
 319     return (value == 0 ? null : new RemoteOopHandle(this, value));
 320   }
 321 
 322   boolean areThreadsEqual(Address addr1, Address addr2) {
 323     try {
 324        return remoteDebugger.areThreadsEqual(getAddressValue(addr1), true,
 325                                              getAddressValue(addr2), true);
 326     } catch (RemoteException e) {
 327     }
 328     return false;
 329   }
 330 
 331   boolean areThreadsEqual(long id1, long id2) {
 332     try {
 333        return remoteDebugger.areThreadsEqual(id1, false, id2, false);
 334     } catch (RemoteException e) {
 335     }
 336     return false;
 337   }
 338 
 339   boolean areThreadsEqual(Address addr1, long id2) {
 340     try {
 341        return remoteDebugger.areThreadsEqual(getAddressValue(addr1), true, id2, false);