sun.jvm.hotspot.debugger.UnalignedAddressException Java Examples

The following examples show how to use sun.jvm.hotspot.debugger.UnalignedAddressException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LinuxDebuggerLocal.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** Need to override this to relax alignment checks on x86. */
public long readCInteger(long address, long numBytes, boolean isUnsigned)
    throws UnmappedAddressException, UnalignedAddressException {
    // Only slightly relaxed semantics -- this is a hack, but is
    // necessary on x86 where it seems the compiler is
    // putting some global 64-bit data on 32-bit boundaries
    if (numBytes == 8) {
        utils.checkAlignment(address, 4);
    } else {
        utils.checkAlignment(address, numBytes);
    }
    byte[] data = readBytes(address, numBytes);
    return utils.dataToCInteger(data, isUnsigned);
}
 
Example #2
Source File: LinuxDebuggerLocal.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** From the LinuxDebugger interface */
public LinuxOopHandle readOopHandle(long address)
        throws UnmappedAddressException, UnalignedAddressException,
            NotInHeapException {
    long value = readAddressValue(address);
    return (value == 0 ? null : new LinuxOopHandle(this, value));
}
 
Example #3
Source File: LinuxDebuggerLocal.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** From the LinuxDebugger interface */
public LinuxOopHandle readOopHandle(long address)
        throws UnmappedAddressException, UnalignedAddressException,
            NotInHeapException {
    long value = readAddressValue(address);
    return (value == 0 ? null : new LinuxOopHandle(this, value));
}
 
Example #4
Source File: BsdDebuggerLocal.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** From the BsdDebugger interface */
public BsdOopHandle readOopHandle(long address)
        throws UnmappedAddressException, UnalignedAddressException,
            NotInHeapException {
    long value = readAddressValue(address);
    return (value == 0 ? null : new BsdOopHandle(this, value));
}
 
Example #5
Source File: LinuxDebuggerLocal.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** From the LinuxDebugger interface */
public LinuxOopHandle readOopHandle(long address)
        throws UnmappedAddressException, UnalignedAddressException,
            NotInHeapException {
    long value = readAddressValue(address);
    return (value == 0 ? null : new LinuxOopHandle(this, value));
}
 
Example #6
Source File: LinuxDebuggerLocal.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** Need to override this to relax alignment checks on x86. */
public long readCInteger(long address, long numBytes, boolean isUnsigned)
    throws UnmappedAddressException, UnalignedAddressException {
    // Only slightly relaxed semantics -- this is a hack, but is
    // necessary on x86 where it seems the compiler is
    // putting some global 64-bit data on 32-bit boundaries
    if (numBytes == 8) {
        utils.checkAlignment(address, 4);
    } else {
        utils.checkAlignment(address, numBytes);
    }
    byte[] data = readBytes(address, numBytes);
    return utils.dataToCInteger(data, isUnsigned);
}
 
Example #7
Source File: LinuxDebuggerLocal.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** Need to override this to relax alignment checks on x86. */
public long readCInteger(long address, long numBytes, boolean isUnsigned)
    throws UnmappedAddressException, UnalignedAddressException {
    // Only slightly relaxed semantics -- this is a hack, but is
    // necessary on x86 where it seems the compiler is
    // putting some global 64-bit data on 32-bit boundaries
    if (numBytes == 8) {
        utils.checkAlignment(address, 4);
    } else {
        utils.checkAlignment(address, numBytes);
    }
    byte[] data = readBytes(address, numBytes);
    return utils.dataToCInteger(data, isUnsigned);
}
 
Example #8
Source File: BsdDebuggerLocal.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Need to override this to relax alignment checks on x86. */
public long readCInteger(long address, long numBytes, boolean isUnsigned)
    throws UnmappedAddressException, UnalignedAddressException {
    // Only slightly relaxed semantics -- this is a hack, but is
    // necessary on x86 where it seems the compiler is
    // putting some global 64-bit data on 32-bit boundaries
    if (numBytes == 8) {
        utils.checkAlignment(address, 4);
    } else {
        utils.checkAlignment(address, numBytes);
    }
    byte[] data = readBytes(address, numBytes);
    return utils.dataToCInteger(data, isUnsigned);
}
 
Example #9
Source File: BsdDebuggerLocal.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** Need to override this to relax alignment checks on x86. */
public long readCInteger(long address, long numBytes, boolean isUnsigned)
    throws UnmappedAddressException, UnalignedAddressException {
    // Only slightly relaxed semantics -- this is a hack, but is
    // necessary on x86 where it seems the compiler is
    // putting some global 64-bit data on 32-bit boundaries
    if (numBytes == 8) {
        utils.checkAlignment(address, 4);
    } else {
        utils.checkAlignment(address, numBytes);
    }
    byte[] data = readBytes(address, numBytes);
    return utils.dataToCInteger(data, isUnsigned);
}
 
Example #10
Source File: LinuxDebuggerLocal.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Need to override this to relax alignment checks on x86. */
public long readCInteger(long address, long numBytes, boolean isUnsigned)
    throws UnmappedAddressException, UnalignedAddressException {
    // Only slightly relaxed semantics -- this is a hack, but is
    // necessary on x86 where it seems the compiler is
    // putting some global 64-bit data on 32-bit boundaries
    if (numBytes == 8) {
        utils.checkAlignment(address, 4);
    } else {
        utils.checkAlignment(address, numBytes);
    }
    byte[] data = readBytes(address, numBytes);
    return utils.dataToCInteger(data, isUnsigned);
}
 
Example #11
Source File: BsdDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** From the BsdDebugger interface */
public BsdOopHandle readOopHandle(long address)
        throws UnmappedAddressException, UnalignedAddressException,
            NotInHeapException {
    long value = readAddressValue(address);
    return (value == 0 ? null : new BsdOopHandle(this, value));
}
 
Example #12
Source File: BsdDebuggerLocal.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** From the BsdDebugger interface */
public BsdOopHandle readOopHandle(long address)
        throws UnmappedAddressException, UnalignedAddressException,
            NotInHeapException {
    long value = readAddressValue(address);
    return (value == 0 ? null : new BsdOopHandle(this, value));
}
 
Example #13
Source File: BsdDebuggerLocal.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** From the BsdDebugger interface */
public BsdOopHandle readOopHandle(long address)
        throws UnmappedAddressException, UnalignedAddressException,
            NotInHeapException {
    long value = readAddressValue(address);
    return (value == 0 ? null : new BsdOopHandle(this, value));
}
 
Example #14
Source File: BsdDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** Need to override this to relax alignment checks on x86. */
public long readCInteger(long address, long numBytes, boolean isUnsigned)
    throws UnmappedAddressException, UnalignedAddressException {
    // Only slightly relaxed semantics -- this is a hack, but is
    // necessary on x86 where it seems the compiler is
    // putting some global 64-bit data on 32-bit boundaries
    if (numBytes == 8) {
        utils.checkAlignment(address, 4);
    } else {
        utils.checkAlignment(address, numBytes);
    }
    byte[] data = readBytes(address, numBytes);
    return utils.dataToCInteger(data, isUnsigned);
}
 
Example #15
Source File: BsdDebuggerLocal.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** Need to override this to relax alignment checks on x86. */
public long readCInteger(long address, long numBytes, boolean isUnsigned)
    throws UnmappedAddressException, UnalignedAddressException {
    // Only slightly relaxed semantics -- this is a hack, but is
    // necessary on x86 where it seems the compiler is
    // putting some global 64-bit data on 32-bit boundaries
    if (numBytes == 8) {
        utils.checkAlignment(address, 4);
    } else {
        utils.checkAlignment(address, numBytes);
    }
    byte[] data = readBytes(address, numBytes);
    return utils.dataToCInteger(data, isUnsigned);
}
 
Example #16
Source File: LinuxDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** Need to override this to relax alignment checks on x86. */
public long readCInteger(long address, long numBytes, boolean isUnsigned)
    throws UnmappedAddressException, UnalignedAddressException {
    // Only slightly relaxed semantics -- this is a hack, but is
    // necessary on x86 where it seems the compiler is
    // putting some global 64-bit data on 32-bit boundaries
    if (numBytes == 8) {
        utils.checkAlignment(address, 4);
    } else {
        utils.checkAlignment(address, numBytes);
    }
    byte[] data = readBytes(address, numBytes);
    return utils.dataToCInteger(data, isUnsigned);
}
 
Example #17
Source File: LinuxDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** From the LinuxDebugger interface */
public LinuxOopHandle readOopHandle(long address)
        throws UnmappedAddressException, UnalignedAddressException,
            NotInHeapException {
    long value = readAddressValue(address);
    return (value == 0 ? null : new LinuxOopHandle(this, value));
}
 
Example #18
Source File: LinuxDebuggerLocal.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** From the LinuxDebugger interface */
public LinuxOopHandle readOopHandle(long address)
        throws UnmappedAddressException, UnalignedAddressException,
            NotInHeapException {
    long value = readAddressValue(address);
    return (value == 0 ? null : new LinuxOopHandle(this, value));
}
 
Example #19
Source File: BsdDebuggerLocal.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** Need to override this to relax alignment checks on x86. */
public long readCInteger(long address, long numBytes, boolean isUnsigned)
    throws UnmappedAddressException, UnalignedAddressException {
    // Only slightly relaxed semantics -- this is a hack, but is
    // necessary on x86 where it seems the compiler is
    // putting some global 64-bit data on 32-bit boundaries
    if (numBytes == 8) {
        utils.checkAlignment(address, 4);
    } else {
        utils.checkAlignment(address, numBytes);
    }
    byte[] data = readBytes(address, numBytes);
    return utils.dataToCInteger(data, isUnsigned);
}
 
Example #20
Source File: BsdDebuggerLocal.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** From the BsdDebugger interface */
public BsdOopHandle readOopHandle(long address)
        throws UnmappedAddressException, UnalignedAddressException,
            NotInHeapException {
    long value = readAddressValue(address);
    return (value == 0 ? null : new BsdOopHandle(this, value));
}
 
Example #21
Source File: BsdDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/** From the BsdDebugger interface */
public BsdAddress readAddress(long address)
        throws UnmappedAddressException, UnalignedAddressException {
    long value = readAddressValue(address);
    return (value == 0 ? null : new BsdAddress(this, value));
}
 
Example #22
Source File: LinuxDebuggerLocal.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public long readJLong(long address)
    throws UnmappedAddressException, UnalignedAddressException {
    utils.checkAlignment(address, jintSize);
    byte[] data = readBytes(address, jlongSize);
    return utils.dataToJLong(data, jlongSize);
}
 
Example #23
Source File: BsdDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/** <P> machDesc may not be null. </P>

    <P> useCache should be set to true if debugging is being done
    locally, and to false if the debugger is being created for the
    purpose of supporting remote debugging. </P> */
    public BsdDebuggerLocal(MachineDescription machDesc,
                              boolean useCache) throws DebuggerException {
        this.machDesc = machDesc;
        utils = new DebuggerUtilities(machDesc.getAddressSize(),
                                      machDesc.isBigEndian()) {
           public void checkAlignment(long address, long alignment) {
             // Need to override default checkAlignment because we need to
             // relax alignment constraints on Bsd/x86
             if ( (address % alignment != 0)
                &&(alignment != 8 || address % 4 != 0)) {
                throw new UnalignedAddressException(
                        "Trying to read at address: "
                      + addressValueToString(address)
                      + " with alignment: " + alignment,
                        address);
             }
           }
        };

        if (useCache) {
            // FIXME: re-test necessity of cache on Bsd, where data
            // fetching is faster
            // Cache portion of the remote process's address space.
            // Fetching data over the socket connection to dbx is slow.
            // Might be faster if we were using a binary protocol to talk to
            // dbx, but would have to test. For now, this cache works best
            // if it covers the entire heap of the remote process. FIXME: at
            // least should make this tunable from the outside, i.e., via
            // the UI. This is a cache of 4096 4K pages, or 16 MB. The page
            // size must be adjusted to be the hardware's page size.
            // (FIXME: should pick this up from the debugger.)
            if (getCPU().equals("ia64")) {
              initCache(16384, parseCacheNumPagesProperty(1024));
            } else {
              initCache(4096, parseCacheNumPagesProperty(4096));
            }
        }

        isDarwin = getOS().equals("darwin");
        workerThread = new BsdDebuggerLocalWorkerThread(this);
        workerThread.start();
    }
 
Example #24
Source File: BsdDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public BsdOopHandle readCompOopHandle(long address)
        throws UnmappedAddressException, UnalignedAddressException,
            NotInHeapException {
    long value = readCompOopAddressValue(address);
    return (value == 0 ? null : new BsdOopHandle(this, value));
}
 
Example #25
Source File: BsdDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public long readJLong(long address)
    throws UnmappedAddressException, UnalignedAddressException {
    utils.checkAlignment(address, jintSize);
    byte[] data = readBytes(address, jlongSize);
    return utils.dataToJLong(data, jlongSize);
}
 
Example #26
Source File: BsdDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public BsdAddress readCompOopAddress(long address)
        throws UnmappedAddressException, UnalignedAddressException {
    long value = readCompOopAddressValue(address);
    return (value == 0 ? null : new BsdAddress(this, value));
}
 
Example #27
Source File: LinuxDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/** From the LinuxDebugger interface */
public LinuxAddress readAddress(long address)
        throws UnmappedAddressException, UnalignedAddressException {
    long value = readAddressValue(address);
    return (value == 0 ? null : new LinuxAddress(this, value));
}
 
Example #28
Source File: LinuxDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public long readJLong(long address)
    throws UnmappedAddressException, UnalignedAddressException {
    utils.checkAlignment(address, jintSize);
    byte[] data = readBytes(address, jlongSize);
    return utils.dataToJLong(data, jlongSize);
}
 
Example #29
Source File: BsdDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public BsdAddress readCompKlassAddress(long address)
        throws UnmappedAddressException, UnalignedAddressException {
    long value = readCompKlassAddressValue(address);
    return (value == 0 ? null : new BsdAddress(this, value));
}
 
Example #30
Source File: LinuxDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/** <P> machDesc may not be null. </P>

    <P> useCache should be set to true if debugging is being done
    locally, and to false if the debugger is being created for the
    purpose of supporting remote debugging. </P> */
    public LinuxDebuggerLocal(MachineDescription machDesc,
                              boolean useCache) throws DebuggerException {
        this.machDesc = machDesc;
        utils = new DebuggerUtilities(machDesc.getAddressSize(),
                                      machDesc.isBigEndian()) {
           public void checkAlignment(long address, long alignment) {
             // Need to override default checkAlignment because we need to
             // relax alignment constraints on Linux/x86
             if ( (address % alignment != 0)
                &&(alignment != 8 || address % 4 != 0)) {
                throw new UnalignedAddressException(
                        "Trying to read at address: "
                      + addressValueToString(address)
                      + " with alignment: " + alignment,
                        address);
             }
           }
        };

        if (useCache) {
            // FIXME: re-test necessity of cache on Linux, where data
            // fetching is faster
            // Cache portion of the remote process's address space.
            // Fetching data over the socket connection to dbx is slow.
            // Might be faster if we were using a binary protocol to talk to
            // dbx, but would have to test. For now, this cache works best
            // if it covers the entire heap of the remote process. FIXME: at
            // least should make this tunable from the outside, i.e., via
            // the UI. This is a cache of 4096 4K pages, or 16 MB. The page
            // size must be adjusted to be the hardware's page size.
            // (FIXME: should pick this up from the debugger.)
            if (getCPU().equals("ia64")) {
              initCache(16384, parseCacheNumPagesProperty(1024));
            } else {
              initCache(4096, parseCacheNumPagesProperty(4096));
            }
        }

        workerThread = new LinuxDebuggerLocalWorkerThread(this);
        workerThread.start();
    }