org.jf.dexlib2.writer.DebugWriter Java Examples

The following examples show how to use org.jf.dexlib2.writer.DebugWriter. 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: ClassPool.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Override public void writeDebugItem(@Nonnull DebugWriter<CharSequence, CharSequence> writer,
                                     DebugItem debugItem) throws IOException {
    switch (debugItem.getDebugItemType()) {
        case DebugItemType.START_LOCAL: {
            StartLocal startLocal = (StartLocal)debugItem;
            writer.writeStartLocal(startLocal.getCodeAddress(),
                    startLocal.getRegister(),
                    startLocal.getName(),
                    startLocal.getType(),
                    startLocal.getSignature());
            break;
        }
        case DebugItemType.END_LOCAL: {
            EndLocal endLocal = (EndLocal)debugItem;
            writer.writeEndLocal(endLocal.getCodeAddress(), endLocal.getRegister());
            break;
        }
        case DebugItemType.RESTART_LOCAL: {
            RestartLocal restartLocal = (RestartLocal)debugItem;
            writer.writeRestartLocal(restartLocal.getCodeAddress(), restartLocal.getRegister());
            break;
        }
        case DebugItemType.PROLOGUE_END: {
            writer.writePrologueEnd(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.EPILOGUE_BEGIN: {
            writer.writeEpilogueBegin(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.LINE_NUMBER: {
            LineNumber lineNumber = (LineNumber)debugItem;
            writer.writeLineNumber(lineNumber.getCodeAddress(), lineNumber.getLineNumber());
            break;
        }
        case DebugItemType.SET_SOURCE_FILE: {
            SetSourceFile setSourceFile = (SetSourceFile)debugItem;
            writer.writeSetSourceFile(setSourceFile.getCodeAddress(), setSourceFile.getSourceFile());
        }
        default:
            throw new ExceptionWithContext("Unexpected debug item type: %d", debugItem.getDebugItemType());
    }
}
 
Example #2
Source File: BuilderClassPool.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Override
public void writeDebugItem(@Nonnull DebugWriter<BuilderStringReference, BuilderTypeReference> writer,
                           DebugItem debugItem) throws IOException {
    switch (debugItem.getDebugItemType()) {
        case DebugItemType.START_LOCAL: {
            StartLocal startLocal = (StartLocal)debugItem;
            writer.writeStartLocal(startLocal.getCodeAddress(),
                    startLocal.getRegister(),
                    checkStringReference(startLocal.getNameReference()),
                    checkTypeReference(startLocal.getTypeReference()),
                    checkStringReference(startLocal.getSignatureReference()));
            break;
        }
        case DebugItemType.END_LOCAL: {
            EndLocal endLocal = (EndLocal)debugItem;
            writer.writeEndLocal(endLocal.getCodeAddress(), endLocal.getRegister());
            break;
        }
        case DebugItemType.RESTART_LOCAL: {
            RestartLocal restartLocal = (RestartLocal)debugItem;
            writer.writeRestartLocal(restartLocal.getCodeAddress(), restartLocal.getRegister());
            break;
        }
        case DebugItemType.PROLOGUE_END: {
            writer.writePrologueEnd(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.EPILOGUE_BEGIN: {
            writer.writeEpilogueBegin(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.LINE_NUMBER: {
            LineNumber lineNumber = (LineNumber)debugItem;
            writer.writeLineNumber(lineNumber.getCodeAddress(), lineNumber.getLineNumber());
            break;
        }
        case DebugItemType.SET_SOURCE_FILE: {
            SetSourceFile setSourceFile = (SetSourceFile)debugItem;
            writer.writeSetSourceFile(setSourceFile.getCodeAddress(),
                    checkStringReference(setSourceFile.getSourceFileReference()));
        }
        default:
            throw new ExceptionWithContext("Unexpected debug item type: %d", debugItem.getDebugItemType());
    }
}
 
Example #3
Source File: ClassPool.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
@Override public void writeDebugItem(@Nonnull DebugWriter<CharSequence, CharSequence> writer,
                                     DebugItem debugItem) throws IOException {
    switch (debugItem.getDebugItemType()) {
        case DebugItemType.START_LOCAL: {
            StartLocal startLocal = (StartLocal)debugItem;
            writer.writeStartLocal(startLocal.getCodeAddress(),
                    startLocal.getRegister(),
                    startLocal.getName(),
                    startLocal.getType(),
                    startLocal.getSignature());
            break;
        }
        case DebugItemType.END_LOCAL: {
            EndLocal endLocal = (EndLocal)debugItem;
            writer.writeEndLocal(endLocal.getCodeAddress(), endLocal.getRegister());
            break;
        }
        case DebugItemType.RESTART_LOCAL: {
            RestartLocal restartLocal = (RestartLocal)debugItem;
            writer.writeRestartLocal(restartLocal.getCodeAddress(), restartLocal.getRegister());
            break;
        }
        case DebugItemType.PROLOGUE_END: {
            writer.writePrologueEnd(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.EPILOGUE_BEGIN: {
            writer.writeEpilogueBegin(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.LINE_NUMBER: {
            LineNumber lineNumber = (LineNumber)debugItem;
            writer.writeLineNumber(lineNumber.getCodeAddress(), lineNumber.getLineNumber());
            break;
        }
        case DebugItemType.SET_SOURCE_FILE: {
            SetSourceFile setSourceFile = (SetSourceFile)debugItem;
            writer.writeSetSourceFile(setSourceFile.getCodeAddress(), setSourceFile.getSourceFile());
        }
        default:
            throw new ExceptionWithContext("Unexpected debug item type: %d", debugItem.getDebugItemType());
    }
}
 
Example #4
Source File: BuilderClassPool.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
@Override
public void writeDebugItem(@Nonnull DebugWriter<BuilderStringReference, BuilderTypeReference> writer,
                           DebugItem debugItem) throws IOException {
    switch (debugItem.getDebugItemType()) {
        case DebugItemType.START_LOCAL: {
            StartLocal startLocal = (StartLocal)debugItem;
            writer.writeStartLocal(startLocal.getCodeAddress(),
                    startLocal.getRegister(),
                    checkStringReference(startLocal.getNameReference()),
                    checkTypeReference(startLocal.getTypeReference()),
                    checkStringReference(startLocal.getSignatureReference()));
            break;
        }
        case DebugItemType.END_LOCAL: {
            EndLocal endLocal = (EndLocal)debugItem;
            writer.writeEndLocal(endLocal.getCodeAddress(), endLocal.getRegister());
            break;
        }
        case DebugItemType.RESTART_LOCAL: {
            RestartLocal restartLocal = (RestartLocal)debugItem;
            writer.writeRestartLocal(restartLocal.getCodeAddress(), restartLocal.getRegister());
            break;
        }
        case DebugItemType.PROLOGUE_END: {
            writer.writePrologueEnd(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.EPILOGUE_BEGIN: {
            writer.writeEpilogueBegin(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.LINE_NUMBER: {
            LineNumber lineNumber = (LineNumber)debugItem;
            writer.writeLineNumber(lineNumber.getCodeAddress(), lineNumber.getLineNumber());
            break;
        }
        case DebugItemType.SET_SOURCE_FILE: {
            SetSourceFile setSourceFile = (SetSourceFile)debugItem;
            writer.writeSetSourceFile(setSourceFile.getCodeAddress(),
                    checkStringReference(setSourceFile.getSourceFileReference()));
        }
        default:
            throw new ExceptionWithContext("Unexpected debug item type: %d", debugItem.getDebugItemType());
    }
}
 
Example #5
Source File: ClassPool.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
@Override public void writeDebugItem(@Nonnull DebugWriter<CharSequence, CharSequence> writer,
                                     DebugItem debugItem) throws IOException {
    switch (debugItem.getDebugItemType()) {
        case DebugItemType.START_LOCAL: {
            StartLocal startLocal = (StartLocal)debugItem;
            writer.writeStartLocal(startLocal.getCodeAddress(),
                    startLocal.getRegister(),
                    startLocal.getName(),
                    startLocal.getType(),
                    startLocal.getSignature());
            break;
        }
        case DebugItemType.END_LOCAL: {
            EndLocal endLocal = (EndLocal)debugItem;
            writer.writeEndLocal(endLocal.getCodeAddress(), endLocal.getRegister());
            break;
        }
        case DebugItemType.RESTART_LOCAL: {
            RestartLocal restartLocal = (RestartLocal)debugItem;
            writer.writeRestartLocal(restartLocal.getCodeAddress(), restartLocal.getRegister());
            break;
        }
        case DebugItemType.PROLOGUE_END: {
            writer.writePrologueEnd(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.EPILOGUE_BEGIN: {
            writer.writeEpilogueBegin(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.LINE_NUMBER: {
            LineNumber lineNumber = (LineNumber)debugItem;
            writer.writeLineNumber(lineNumber.getCodeAddress(), lineNumber.getLineNumber());
            break;
        }
        case DebugItemType.SET_SOURCE_FILE: {
            SetSourceFile setSourceFile = (SetSourceFile)debugItem;
            writer.writeSetSourceFile(setSourceFile.getCodeAddress(), setSourceFile.getSourceFile());
        }
        default:
            throw new ExceptionWithContext("Unexpected debug item type: %d", debugItem.getDebugItemType());
    }
}
 
Example #6
Source File: BuilderClassPool.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
@Override
public void writeDebugItem(@Nonnull DebugWriter<BuilderStringReference, BuilderTypeReference> writer,
                           DebugItem debugItem) throws IOException {
    switch (debugItem.getDebugItemType()) {
        case DebugItemType.START_LOCAL: {
            StartLocal startLocal = (StartLocal)debugItem;
            writer.writeStartLocal(startLocal.getCodeAddress(),
                    startLocal.getRegister(),
                    checkStringReference(startLocal.getNameReference()),
                    checkTypeReference(startLocal.getTypeReference()),
                    checkStringReference(startLocal.getSignatureReference()));
            break;
        }
        case DebugItemType.END_LOCAL: {
            EndLocal endLocal = (EndLocal)debugItem;
            writer.writeEndLocal(endLocal.getCodeAddress(), endLocal.getRegister());
            break;
        }
        case DebugItemType.RESTART_LOCAL: {
            RestartLocal restartLocal = (RestartLocal)debugItem;
            writer.writeRestartLocal(restartLocal.getCodeAddress(), restartLocal.getRegister());
            break;
        }
        case DebugItemType.PROLOGUE_END: {
            writer.writePrologueEnd(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.EPILOGUE_BEGIN: {
            writer.writeEpilogueBegin(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.LINE_NUMBER: {
            LineNumber lineNumber = (LineNumber)debugItem;
            writer.writeLineNumber(lineNumber.getCodeAddress(), lineNumber.getLineNumber());
            break;
        }
        case DebugItemType.SET_SOURCE_FILE: {
            SetSourceFile setSourceFile = (SetSourceFile)debugItem;
            writer.writeSetSourceFile(setSourceFile.getCodeAddress(),
                    checkStringReference(setSourceFile.getSourceFileReference()));
        }
        default:
            throw new ExceptionWithContext("Unexpected debug item type: %d", debugItem.getDebugItemType());
    }
}
 
Example #7
Source File: ClassPool.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Override public void writeDebugItem(@Nonnull DebugWriter<CharSequence, CharSequence> writer,
                                     DebugItem debugItem) throws IOException {
    switch (debugItem.getDebugItemType()) {
        case DebugItemType.START_LOCAL: {
            StartLocal startLocal = (StartLocal)debugItem;
            writer.writeStartLocal(startLocal.getCodeAddress(),
                    startLocal.getRegister(),
                    startLocal.getName(),
                    startLocal.getType(),
                    startLocal.getSignature());
            break;
        }
        case DebugItemType.END_LOCAL: {
            EndLocal endLocal = (EndLocal)debugItem;
            writer.writeEndLocal(endLocal.getCodeAddress(), endLocal.getRegister());
            break;
        }
        case DebugItemType.RESTART_LOCAL: {
            RestartLocal restartLocal = (RestartLocal)debugItem;
            writer.writeRestartLocal(restartLocal.getCodeAddress(), restartLocal.getRegister());
            break;
        }
        case DebugItemType.PROLOGUE_END: {
            writer.writePrologueEnd(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.EPILOGUE_BEGIN: {
            writer.writeEpilogueBegin(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.LINE_NUMBER: {
            LineNumber lineNumber = (LineNumber)debugItem;
            writer.writeLineNumber(lineNumber.getCodeAddress(), lineNumber.getLineNumber());
            break;
        }
        case DebugItemType.SET_SOURCE_FILE: {
            SetSourceFile setSourceFile = (SetSourceFile)debugItem;
            writer.writeSetSourceFile(setSourceFile.getCodeAddress(), setSourceFile.getSourceFile());
        }
        default:
            throw new ExceptionWithContext("Unexpected debug item type: %d", debugItem.getDebugItemType());
    }
}
 
Example #8
Source File: BuilderClassPool.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Override
public void writeDebugItem(@Nonnull DebugWriter<BuilderStringReference, BuilderTypeReference> writer,
                           DebugItem debugItem) throws IOException {
    switch (debugItem.getDebugItemType()) {
        case DebugItemType.START_LOCAL: {
            StartLocal startLocal = (StartLocal)debugItem;
            writer.writeStartLocal(startLocal.getCodeAddress(),
                    startLocal.getRegister(),
                    checkStringReference(startLocal.getNameReference()),
                    checkTypeReference(startLocal.getTypeReference()),
                    checkStringReference(startLocal.getSignatureReference()));
            break;
        }
        case DebugItemType.END_LOCAL: {
            EndLocal endLocal = (EndLocal)debugItem;
            writer.writeEndLocal(endLocal.getCodeAddress(), endLocal.getRegister());
            break;
        }
        case DebugItemType.RESTART_LOCAL: {
            RestartLocal restartLocal = (RestartLocal)debugItem;
            writer.writeRestartLocal(restartLocal.getCodeAddress(), restartLocal.getRegister());
            break;
        }
        case DebugItemType.PROLOGUE_END: {
            writer.writePrologueEnd(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.EPILOGUE_BEGIN: {
            writer.writeEpilogueBegin(debugItem.getCodeAddress());
            break;
        }
        case DebugItemType.LINE_NUMBER: {
            LineNumber lineNumber = (LineNumber)debugItem;
            writer.writeLineNumber(lineNumber.getCodeAddress(), lineNumber.getLineNumber());
            break;
        }
        case DebugItemType.SET_SOURCE_FILE: {
            SetSourceFile setSourceFile = (SetSourceFile)debugItem;
            writer.writeSetSourceFile(setSourceFile.getCodeAddress(),
                    checkStringReference(setSourceFile.getSourceFileReference()));
        }
        default:
            throw new ExceptionWithContext("Unexpected debug item type: %d", debugItem.getDebugItemType());
    }
}