Search in sources :

Example 1 with FileBreakpoint

use of jadx.gui.device.debugger.BreakpointManager.FileBreakpoint in project jadx by skylot.

the class DebugController method initBreakpoints.

private void initBreakpoints(List<FileBreakpoint> fbps) {
    if (fbps.size() == 0) {
        return;
    }
    boolean fetch = true;
    for (FileBreakpoint fbp : fbps) {
        try {
            long id = debugger.getClassID(fbp.cls, fetch);
            // only fetch classes from JVM once,
            // if this time this class hasn't been loaded then it won't load next time, cuz JVM is freezed.
            fetch = false;
            if (id > -1) {
                setBreakpoint(id, fbp);
            } else {
                setDelayBreakpoint(fbp);
            }
        } catch (SmaliDebuggerException e) {
            logErr(e);
            failBreakpoint(fbp, e.getMessage());
        }
    }
}
Also used : FileBreakpoint(jadx.gui.device.debugger.BreakpointManager.FileBreakpoint) SmaliDebuggerException(jadx.gui.device.debugger.SmaliDebugger.SmaliDebuggerException)

Example 2 with FileBreakpoint

use of jadx.gui.device.debugger.BreakpointManager.FileBreakpoint in project jadx by skylot.

the class DebugController method setDelayBreakpoint.

private void setDelayBreakpoint(FileBreakpoint bp) {
    boolean hasSet = bpStore.hasSetDelaied(bp.cls);
    bpStore.add(bp, null);
    if (!hasSet) {
        updateQueue.execute(() -> {
            try {
                debugger.regClassPrepareEventForBreakpoint(bp.cls, id -> {
                    List<FileBreakpoint> list = bpStore.get(bp.cls);
                    for (FileBreakpoint fbp : list) {
                        setBreakpoint(id, fbp);
                    }
                });
            } catch (SmaliDebuggerException e) {
                logErr(e);
                failBreakpoint(bp, "");
            }
        });
    }
}
Also used : FileBreakpoint(jadx.gui.device.debugger.BreakpointManager.FileBreakpoint) SmaliDebuggerException(jadx.gui.device.debugger.SmaliDebugger.SmaliDebuggerException)

Aggregations

FileBreakpoint (jadx.gui.device.debugger.BreakpointManager.FileBreakpoint)2 SmaliDebuggerException (jadx.gui.device.debugger.SmaliDebugger.SmaliDebuggerException)2