fix breakpoint events

pull/2156/head
yann300 3 years ago
parent 2d1023e600
commit c66cb9455d
  1. 3
      libs/remix-debug/src/code/breakpointManager.ts
  2. 9
      libs/remix-debug/src/debugger/debugger.ts
  3. 12
      libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx

@ -87,6 +87,7 @@ export class BreakpointManager {
*
*/
async jump (fromStep, direction, defaultToLimit, trace) {
this.event.trigger('locatingBreakpoint', [])
let sourceLocation
let previousSourceLocation
let currentStep = fromStep + direction
@ -120,7 +121,7 @@ export class BreakpointManager {
}
currentStep += direction
}
this.event.trigger('NoBreakpointHit', [])
this.event.trigger('noBreakpointHit', [])
if (!defaultToLimit) {
return
}

@ -47,9 +47,18 @@ export class Debugger {
})
this.breakPointManager.event.register('breakpointStep', (step) => {
this.event.trigger('breakpointStep', [])
this.step_manager.jumpTo(step)
})
this.breakPointManager.event.register('noBreakpointHit', (step) => {
this.event.trigger('noBreakpointHit', [])
})
this.breakPointManager.event.register('locatingBreakpoint', () => {
this.event.trigger('locatingBreakpoint', [])
})
this.debugger.setBreakpointManager(this.breakPointManager)
this.debugger.event.register('newTraceLoaded', this, () => {

@ -87,6 +87,18 @@ export const DebuggerUI = (props: DebuggerUIProps) => {
})
})
debuggerInstance.event.register('locatingBreakpoint', async (isActive) => {
setState(prevState => {
return { ...prevState, sourceLocationStatus: 'Locating breakpoint, this might take a while...' }
})
})
debuggerInstance.event.register('noBreakpointHit', async (isActive) => {
setState(prevState => {
return { ...prevState, sourceLocationStatus: '' }
})
})
debuggerInstance.event.register('newSourceLocation', async (lineColumnPos, rawLocation, generatedSources, address) => {
if (!lineColumnPos) {
await debuggerModule.discardHighlight()

Loading…
Cancel
Save