Commit 37eff056 authored by yann300's avatar yann300

misc

parent 906073d8
...@@ -47,6 +47,7 @@ class BreakpointManager { ...@@ -47,6 +47,7 @@ class BreakpointManager {
*/ */
async jump (direction, defaultToLimit) { async jump (direction, defaultToLimit) {
if (!this.locationToRowConverter) { if (!this.locationToRowConverter) {
console.log('row converter not provided')
return return
} }
var sourceLocation var sourceLocation
...@@ -56,11 +57,12 @@ class BreakpointManager { ...@@ -56,11 +57,12 @@ class BreakpointManager {
sourceLocation = await this.debugger.callTree.extractSourceLocation(currentStep) sourceLocation = await this.debugger.callTree.extractSourceLocation(currentStep)
} catch (e) { } catch (e) {
console.log('cannot jump to breakpoint ' + e) console.log('cannot jump to breakpoint ' + e)
return
} }
var lineColumn = this.locationToRowConverter(sourceLocation) var lineColumn = this.locationToRowConverter(sourceLocation)
if (this.previousLine !== lineColumn.start.line) { if (this.previousLine !== lineColumn.start.line) {
this.previousLine = lineColumn.start.line this.previousLine = lineColumn.start.line
if (this.checkSourceLocation(sourceLocation.file, lineColumn.start.line)) { if (this.hasBreakpointAtLine(sourceLocation.file, lineColumn.start.line)) {
this.debugger.stepManager.jumpTo(currentStep) this.debugger.stepManager.jumpTo(currentStep)
this.event.trigger('breakpointHit', [sourceLocation]) this.event.trigger('breakpointHit', [sourceLocation])
break break
...@@ -81,7 +83,7 @@ class BreakpointManager { ...@@ -81,7 +83,7 @@ class BreakpointManager {
* @param {Int} line - line number where looking for breakpoint * @param {Int} line - line number where looking for breakpoint
* @return {Bool} return true if the given @arg fileIndex @arg line refers to a breakpoint * @return {Bool} return true if the given @arg fileIndex @arg line refers to a breakpoint
*/ */
checkSourceLocation (fileIndex, line) { hasBreakpointAtLine (fileIndex, line) {
if (this.breakpoints[fileIndex]) { if (this.breakpoints[fileIndex]) {
var sources = this.breakpoints[fileIndex] var sources = this.breakpoints[fileIndex]
for (var k in sources) { for (var k in sources) {
......
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