< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java

Print this page

458   }
459 
460   protected long readAddressValue(long address)
461     throws UnmappedAddressException, UnalignedAddressException {
462     return readCInteger(address, machDesc.getAddressSize(), true);
463   }
464 
465   protected long readCompOopAddressValue(long address)
466     throws UnmappedAddressException, UnalignedAddressException {
467     long value = readCInteger(address, getHeapOopSize(), true);
468     if (value != 0) {
469       // See oop.inline.hpp decode_heap_oop
470       value = (long)(narrowOopBase + (long)(value << narrowOopShift));
471     }
472     return value;
473   }
474 
475   protected long readCompKlassAddressValue(long address)
476     throws UnmappedAddressException, UnalignedAddressException {
477     long value = readCInteger(address, getKlassPtrSize(), true);





478     if (value != 0) {
479       value = (long)(narrowKlassBase + (long)(value << narrowKlassShift));
480     }
481     return value;
482   }
483 
484   protected void writeAddressValue(long address, long value)
485     throws UnmappedAddressException, UnalignedAddressException {
486     writeCInteger(address, machDesc.getAddressSize(), value);
487   }
488 
489   /** Can be called by subclasses but can not be overridden */
490   protected final void checkConfigured() {
491     if (machDesc == null) {
492       throw new RuntimeException("MachineDescription must have been set by this point");
493     }
494     if (utils == null) {
495       throw new RuntimeException("DebuggerUtilities must have been set by this point");
496     }
497   }

458   }
459 
460   protected long readAddressValue(long address)
461     throws UnmappedAddressException, UnalignedAddressException {
462     return readCInteger(address, machDesc.getAddressSize(), true);
463   }
464 
465   protected long readCompOopAddressValue(long address)
466     throws UnmappedAddressException, UnalignedAddressException {
467     long value = readCInteger(address, getHeapOopSize(), true);
468     if (value != 0) {
469       // See oop.inline.hpp decode_heap_oop
470       value = (long)(narrowOopBase + (long)(value << narrowOopShift));
471     }
472     return value;
473   }
474 
475   protected long readCompKlassAddressValue(long address)
476     throws UnmappedAddressException, UnalignedAddressException {
477     long value = readCInteger(address, getKlassPtrSize(), true);
478     // Todo: Lilliput: this is a hack. The real problem is the assumption that size
479     //  of a narrow Klass pointer can be expressed in number of bytes (getKlassPtrSize).
480     //  That assumption is present in a number of files here. Better would be
481     //  to change this to getKlassPtrSizeInBits, or to do it some other way.
482     value &= (1 << 22) - 1; // narrow klass pointer size is 22 bits.
483     if (value != 0) {
484       value = (long)(narrowKlassBase + (long)(value << narrowKlassShift));
485     }
486     return value;
487   }
488 
489   protected void writeAddressValue(long address, long value)
490     throws UnmappedAddressException, UnalignedAddressException {
491     writeCInteger(address, machDesc.getAddressSize(), value);
492   }
493 
494   /** Can be called by subclasses but can not be overridden */
495   protected final void checkConfigured() {
496     if (machDesc == null) {
497       throw new RuntimeException("MachineDescription must have been set by this point");
498     }
499     if (utils == null) {
500       throw new RuntimeException("DebuggerUtilities must have been set by this point");
501     }
502   }
< prev index next >