fix(ui): breakpoint on other source causing app crash when debugging
This commit is contained in:
@@ -32,7 +32,7 @@ public class Debugger implements DebugCallbackInternal {
|
|||||||
@Nullable
|
@Nullable
|
||||||
private ScriptExecution mScriptExecution;
|
private ScriptExecution mScriptExecution;
|
||||||
@Nullable
|
@Nullable
|
||||||
private Dim.SourceInfo mSourceInfo;
|
private volatile Dim.SourceInfo mCurrentSourceInfo;
|
||||||
private WeakReference<DebugCallback> mWeakDebugCallback;
|
private WeakReference<DebugCallback> mWeakDebugCallback;
|
||||||
|
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ public class Debugger implements DebugCallbackInternal {
|
|||||||
if (!sourceInfo.url().equals(mSourceUrl)) {
|
if (!sourceInfo.url().equals(mSourceUrl)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mSourceInfo = sourceInfo;
|
mCurrentSourceInfo = sourceInfo;
|
||||||
if(mDebugCallback != null){
|
if(mDebugCallback != null){
|
||||||
mDebugCallback.updateSourceText(sourceInfo);
|
mDebugCallback.updateSourceText(sourceInfo);
|
||||||
}
|
}
|
||||||
@@ -75,6 +75,7 @@ public class Debugger implements DebugCallbackInternal {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mSkipOtherFileBreakpoint = false;
|
mSkipOtherFileBreakpoint = false;
|
||||||
|
mCurrentSourceInfo = lastFrame.sourceInfo();
|
||||||
if(mDebugCallback != null){
|
if(mDebugCallback != null){
|
||||||
mDebugCallback.enterInterrupt(lastFrame, threadTitle, alertMessage);
|
mDebugCallback.enterInterrupt(lastFrame, threadTitle, alertMessage);
|
||||||
}
|
}
|
||||||
@@ -101,8 +102,9 @@ public class Debugger implements DebugCallbackInternal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void breakpoint(int line, boolean enabled) {
|
public void breakpoint(int line, boolean enabled) {
|
||||||
if (mSourceInfo != null) {
|
Dim.SourceInfo sourceInfo = mCurrentSourceInfo;
|
||||||
mSourceInfo.breakpoint(line, enabled);
|
if (sourceInfo != null) {
|
||||||
|
sourceInfo.breakpoint(line, enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +152,7 @@ public class Debugger implements DebugCallbackInternal {
|
|||||||
mDim.detach();
|
mDim.detach();
|
||||||
mScriptExecution = null;
|
mScriptExecution = null;
|
||||||
mSourceUrl = null;
|
mSourceUrl = null;
|
||||||
mSourceInfo = null;
|
mCurrentSourceInfo = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDebugCallback(DebugCallback debugCallback) {
|
public void setDebugCallback(DebugCallback debugCallback) {
|
||||||
|
|||||||
Reference in New Issue
Block a user