Examples of ExceptionWithContext


Examples of org.jf.util.ExceptionWithContext

                    if (currentByteValue <= 0x7f) {
                        result = (result << 4) >> 4;
                    } else {
                        currentByteValue = buf[end++] & 0xff;
                        if (currentByteValue > 0x7f) {
                            throw new ExceptionWithContext(
                                    "Invalid sleb128 integer encountered at offset 0x%x", offset);
                        }
                        result |= currentByteValue << 28;
                    }
                }
View Full Code Here

Examples of org.jf.util.ExceptionWithContext

                    if (currentByteValue > 0x7f) {
                        currentByteValue = buf[end++];

                        // MSB shouldn't be set on last byte
                        if (currentByteValue < 0) {
                            throw new ExceptionWithContext(
                                    "Invalid uleb128 integer encountered at offset 0x%x", offset);
                        } else if ((currentByteValue & 0xf) > 0x07) {
                            if (!allowLarge) {
                                // for non-large uleb128s, we assume most significant bit of the result will not be
                                // set, so that it can fit into a signed integer without wrapping
                                throw new ExceptionWithContext(
                                        "Encountered valid uleb128 that is out of range at offset 0x%x", offset);
                            }
                        }
                        result |= currentByteValue << 28;
                    }
View Full Code Here

Examples of org.jf.util.ExceptionWithContext

                    if (currentByteValue > 0x7f) {
                        currentByteValue = buf[end++];

                        // MSB shouldn't be set on last byte
                        if (currentByteValue < 0) {
                            throw new ExceptionWithContext(
                                    "Invalid uleb128 integer encountered at offset 0x%x", offset);
                        }
                        result |= currentByteValue << 28;
                    }
                }
View Full Code Here

Examples of org.jf.util.ExceptionWithContext

                if (currentByteValue < 0) { // if the MSB is set
                    currentByteValue = buf[end++];
                    if (currentByteValue < 0) { // if the MSB is set
                        currentByteValue = buf[end++];
                        if (currentByteValue < 0) {
                            throw new ExceptionWithContext(
                                    "Invalid uleb128 integer encountered at offset 0x%x", offset);
                        }
                    }
                }
            }
View Full Code Here

Examples of org.jf.util.ExceptionWithContext

                break;
            case 1:
                result = buf[o];
                break;
            default:
                throw new ExceptionWithContext("Invalid size %d for sized int at offset 0x%x", bytes, offset);
        }
        offset = o + bytes;
        return result;
    }
View Full Code Here

Examples of org.jf.util.ExceptionWithContext

        int result = 0;
        switch (bytes) {
            case 4:
                int b = buf[o+3];
                if (b < 0) {
                    throw new ExceptionWithContext(
                            "Encountered valid sized uint that is out of range at offset 0x%x", offset);
                }
                result = b << 24;
                // fall-through
            case 3:
                result |= (buf[o+2] & 0xff) << 16;
                // fall-through
            case 2:
                result |= (buf[o+1] & 0xff) << 8;
                // fall-through
            case 1:
                result |= (buf[o] & 0xff);
                break;
            default:
                throw new ExceptionWithContext("Invalid size %d for sized uint at offset 0x%x", bytes, offset);
        }
        offset = o + bytes;
        return result;
    }
View Full Code Here

Examples of org.jf.util.ExceptionWithContext

                break;
            case 1:
                result = buf[o] << 24;
                break;
            default:
                throw new ExceptionWithContext(
                        "Invalid size %d for sized, right extended int at offset 0x%x", bytes, offset);
        }
        offset = o + bytes;
        return result;
    }
View Full Code Here

Examples of org.jf.util.ExceptionWithContext

                break;
            case 1:
                result = ((long)buf[o]) << 56;
                break;
            default:
                throw new ExceptionWithContext(
                        "Invalid size %d for sized, right extended long at offset 0x%x", bytes, offset);
        }
        offset = o + bytes;
        return result;
    }
View Full Code Here

Examples of org.jf.util.ExceptionWithContext

                break;
            case 1:
                result = buf[o];
                break;
            default:
                throw new ExceptionWithContext("Invalid size %d for sized long at offset 0x%x", bytes, offset);
        }

        offset = o + bytes;
        return result;
    }
View Full Code Here

Examples of org.jf.util.ExceptionWithContext

    public void writeLineNumber(int codeAddress, int lineNumber) throws IOException {
        int lineDelta = lineNumber - currentLine;
        int addressDelta = codeAddress - currentAddress;

        if (addressDelta < 0) {
            throw new ExceptionWithContext("debug info items must have non-decreasing code addresses");
        }
        if (lineDelta < -4 || lineDelta > 10) {
            writeAdvanceLine(lineNumber);
            lineDelta = 0;
        } // no else is intentional here. we might need to advance the PC as well as the line
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.