Commit 710ded61 authored by yann300's avatar yann300

don't stop if previous is jump out and current jump dest

parent 2d9c01aa
...@@ -56,10 +56,11 @@ class BreakpointManager { ...@@ -56,10 +56,11 @@ class BreakpointManager {
return trace[step].depth !== trace[step - 1].depth return trace[step].depth !== trace[step - 1].depth
} }
function hitLine (currentStep, sourceLocation, self) { function hitLine (currentStep, sourceLocation, previousSourceLocation, self) {
// isJumpDestInstruction -> returning from a internal function call // isJumpDestInstruction -> returning from a internal function call
// depthChange -> returning from an external call // depthChange -> returning from an external call
if (helper.isJumpDestInstruction(self.debugger.traceManager.trace[currentStep]) || // sourceLocation.start <= previousSourceLocation.start && ... -> previous src is contained in the current one
if (helper.isJumpDestInstruction(self.debugger.traceManager.trace[currentStep]) && previousSourceLocation.jump === 'o' ||
depthChange(currentStep, self.debugger.traceManager.trace)) { depthChange(currentStep, self.debugger.traceManager.trace)) {
return false return false
} else { } else {
...@@ -85,7 +86,7 @@ class BreakpointManager { ...@@ -85,7 +86,7 @@ class BreakpointManager {
if (this.previousLine !== lineColumn.start.line) { if (this.previousLine !== lineColumn.start.line) {
if (direction === -1 && lineHadBreakpoint) { // TODO : improve this when we will build the correct structure before hand if (direction === -1 && lineHadBreakpoint) { // TODO : improve this when we will build the correct structure before hand
lineHadBreakpoint = false lineHadBreakpoint = false
if (hitLine(currentStep + 1, previousSourceLocation, this)) { if (hitLine(currentStep + 1, previousSourceLocation, sourceLocation, this)) {
return return
} }
} }
...@@ -93,7 +94,7 @@ class BreakpointManager { ...@@ -93,7 +94,7 @@ class BreakpointManager {
if (this.hasBreakpointAtLine(sourceLocation.file, lineColumn.start.line)) { if (this.hasBreakpointAtLine(sourceLocation.file, lineColumn.start.line)) {
lineHadBreakpoint = true lineHadBreakpoint = true
if (direction === 1) { if (direction === 1) {
if (hitLine(currentStep, sourceLocation, this)) { if (hitLine(currentStep, sourceLocation, previousSourceLocation, this)) {
return return
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment